Network discovery for Cacty
Moderators: Developers, Moderators
- tim_hunter
- Posts: 3
- Joined: Thu Jul 07, 2005 6:15 pm
- Contact:
Network discovery for Cacty
eu fiz um network discovery aki, pois a nossa urgência era grande e queria a opinião de vcs..
this text was writed in Portuguese-Brasil
té mais!!!
this text was writed in Portuguese-Brasil
té mais!!!
- Attachments
-
- screen shot discovery plug-in
- discovery.JPG (105.39 KiB) Viewed 27355 times
Tim Hunter
I have been working on a simular Plugin for a while now, and its just about ready for release. I just need to add a few more options. It currently runs automatically via the poller every few hours (adding option to specify how long between) and you can specify multiple subnets to scan. It only scans hosts that are currently not in your Cacti install (to save time) and allows for easy Addition into Cacti (currently redirects you to the Add Host page with everything already preset except Description and Host Template). At a later date you will be able to specify which host template to use for what OS it finds. It only uses internal Cacti functions to do it works now (before it required NMAP) and should work fine on both Windows and Linux. You currently can specify several different Community Names for it to try, and I am about to have it show on the info page the actual community name that it uses. The contact and location OIDs are properly shown, I just don't have it setup on those particular hosts. It also will DNS the IPs and return the result, but I had it disabled for that screen shot.
Anyways, here is a screen shot of it, I should have it released by the end of the week.
As a side note, does anyone believe it is showing too much info? I'm thinking about trimming down the amount of initial info it shows, but instead have it show the Location, Contact, and Description as a DHTML popup when you mouse over the device.
Anyways, here is a screen shot of it, I should have it released by the end of the week.
As a side note, does anyone believe it is showing too much info? I'm thinking about trimming down the amount of initial info it shows, but instead have it show the Location, Contact, and Description as a DHTML popup when you mouse over the device.
- Attachments
-
- Discover Plugin
- discover.jpeg (233.56 KiB) Viewed 27016 times
Cacti already has internal ping and snmp functions, which work quite nicely, so all I really do is loop through the subnets you request, and query them using the cacti functions. This makes it the most portable as you don't have to install NMap and all its requirements. NMap worked fine at this, and it really wasn't any slower than the script already is (its not blazing fast by any means) but was just too much overhead for me.cacontece wrote:I think there is enough information...
I was wondering to use NMAP, but it seems to be a kind of slow with a lot of hosts...
How did you do it with just PHP functions?
best regards,
cacontece
Heh. Granted, thats not the newest version, that version requires NMap. I went ahead and threw the developmental snapshot up on my site as a beta so everyone can test out and let me know how it works for them. Warning, there are very little configuration options at the moment (well, only 1 actually) which is the subnet to scan, currently on being able to set it like so (ex: 192.168.0.*) or specific IP addresses. You can scan multiple subnets by using a comma, I am currently working on allowing you to use 192.168.0.0/16 or even ranges like 192.168.0.19-192.168.4.254.NHDave wrote:Just grab the iso from his site and extract the plugins dir...lanyao wrote:waiting for your release
Lots of other goodies in it as well
It should start polling a little after you actually set the subnet (5-10 minutes), it should tell you in the Cacti log when it actually does. There is no "error" or debug checking at this point, so don't get your hopes up.
- fmangeant
- Cacti Guru User
- Posts: 2345
- Joined: Fri Sep 19, 2003 8:36 am
- Location: Sophia-Antipolis, France
- Contact:
Hi cigamitcigamit wrote:I went ahead and threw the developmental snapshot up on my site as a beta so everyone can test out and let me know how it works for them.
I installed the discovery plugin 0.1b on top of my test system (Cacti 0.8.6h + patches + plugin architecture 0.8 + monitor 0.4), and get this error when accessing the "discover" tab :
Code: Select all
Unknown column 'hash' in 'order clause'
[size=84]
[color=green]HOWTOs[/color] :
[list][*][url=http://forums.cacti.net/viewtopic.php?t=15353]Install and configure the Net-SNMP agent for Unix[/url]
[*][url=http://forums.cacti.net/viewtopic.php?t=26151]Install and configure the Net-SNMP agent for Windows[/url]
[*][url=http://forums.cacti.net/viewtopic.php?t=28175]Graph multiple servers using an SNMP proxy[/url][/list]
[color=green]Templates[/color] :
[list][*][url=http://forums.cacti.net/viewtopic.php?t=15412]Multiple CPU usage for Linux[/url]
[*][url=http://forums.cacti.net/viewtopic.php?p=125152]Memory & swap usage for Unix[/url][/list][/size]
[color=green]HOWTOs[/color] :
[list][*][url=http://forums.cacti.net/viewtopic.php?t=15353]Install and configure the Net-SNMP agent for Unix[/url]
[*][url=http://forums.cacti.net/viewtopic.php?t=26151]Install and configure the Net-SNMP agent for Windows[/url]
[*][url=http://forums.cacti.net/viewtopic.php?t=28175]Graph multiple servers using an SNMP proxy[/url][/list]
[color=green]Templates[/color] :
[list][*][url=http://forums.cacti.net/viewtopic.php?t=15412]Multiple CPU usage for Linux[/url]
[*][url=http://forums.cacti.net/viewtopic.php?p=125152]Memory & swap usage for Unix[/url][/list][/size]
- fmangeant
- Cacti Guru User
- Posts: 2345
- Joined: Fri Sep 19, 2003 8:36 am
- Location: Sophia-Antipolis, France
- Contact:
Well, I'm running into another issue :
Let's recompile PHP with sockets support...
To all Gentooers, add this to /etc/portage/package.use :
Code: Select all
$ php findhosts.php
02/01/2006 10:25:37 AM - POLLER: Poller[0] Network Discover is now running xx.xx.xx.xx
Fatal error: Call to undefined function socket_create() in /cacti/cacti-0.8.6h/lib/ping.php on line 117
To all Gentooers, add this to /etc/portage/package.use :
Code: Select all
dev-lang/php session cli xml sockets
[size=84]
[color=green]HOWTOs[/color] :
[list][*][url=http://forums.cacti.net/viewtopic.php?t=15353]Install and configure the Net-SNMP agent for Unix[/url]
[*][url=http://forums.cacti.net/viewtopic.php?t=26151]Install and configure the Net-SNMP agent for Windows[/url]
[*][url=http://forums.cacti.net/viewtopic.php?t=28175]Graph multiple servers using an SNMP proxy[/url][/list]
[color=green]Templates[/color] :
[list][*][url=http://forums.cacti.net/viewtopic.php?t=15412]Multiple CPU usage for Linux[/url]
[*][url=http://forums.cacti.net/viewtopic.php?p=125152]Memory & swap usage for Unix[/url][/list][/size]
[color=green]HOWTOs[/color] :
[list][*][url=http://forums.cacti.net/viewtopic.php?t=15353]Install and configure the Net-SNMP agent for Unix[/url]
[*][url=http://forums.cacti.net/viewtopic.php?t=26151]Install and configure the Net-SNMP agent for Windows[/url]
[*][url=http://forums.cacti.net/viewtopic.php?t=28175]Graph multiple servers using an SNMP proxy[/url][/list]
[color=green]Templates[/color] :
[list][*][url=http://forums.cacti.net/viewtopic.php?t=15412]Multiple CPU usage for Linux[/url]
[*][url=http://forums.cacti.net/viewtopic.php?p=125152]Memory & swap usage for Unix[/url][/list][/size]
First of all: This plugin is a very good idea and so long it is also well done -Thank you!
I installed the plugin and it seems that is working correctly, but I have a question about the interval when discover is scanning the subnet(s):
Where can I configure the time-interval? Is it hardcoded at the moment and if so where can I modify it?
Thanks,
Alex.
I installed the plugin and it seems that is working correctly, but I have a question about the interval when discover is scanning the subnet(s):
Where can I configure the time-interval? Is it hardcoded at the moment and if so where can I modify it?
Thanks,
Alex.
I found where I can configure the time-interval:
setup.php:
...
function discovery_poller_bottom () {
global $config;
include_once($config["library_path"] . "/database.php");
$t = read_config_option("discovery_last_poll");
if ($t != '' && time() - $t < 21600)
return;
...
The bold value is the time interval since last poll in seconds, which is by default 6 hours.
Alex.
setup.php:
...
function discovery_poller_bottom () {
global $config;
include_once($config["library_path"] . "/database.php");
$t = read_config_option("discovery_last_poll");
if ($t != '' && time() - $t < 21600)
return;
...
The bold value is the time interval since last poll in seconds, which is by default 6 hours.
Alex.
Who is online
Users browsing this forum: No registered users and 3 guests