| Home Profile Fun |
#182 Linux 03.07.2009
The Discovery Plugin of CactiOverview Official documentation and download Warning First steps Configuration Usage without Discovery Templates Usage with Discovery Templates Additional hints Summary Overview, Screenshot 1 Characteristics and features of this plugin: Automatic discovery of devices in a subnet which are not yet monitored by Cacti. It also checks if snmp is active on these devices. Together with Discovery Templates it is possible to automatically associate a device with a Host Template. This is done by reading the snmp sysDescr string of the device. Graphs will then be generated according to the Host Template and added to the tree. Official documentation and download Documentation Download Warning If the plugin recognizes many devices and associates them with a wrong Host Template it is possible that thousands of graphs are being created. It is better to use this plugin only from the command line because you can then see what it does and abort it if necessary. Nevertheless you have to keep the Discovery poller active. If it is set to disabled you can't use the plugin from the command line. The best way to use it with Discovery Templates is like this: if you want to scan the network set the "Poller Frequency" to "Every 4 Weeks". Then run it manually from the command line and set it back to disabled afterwards. But it is safer to not use Discovery Templates so that the plugin just scans and discovers devices but does not make changes in Cacti. In this case you can keep the Discovery poller active. Another idea is to declare a special snmp sysDescr string for all devices which shall be monitored. Then you create a Discovery Plugin with this string. Then there is more control about the whole process. First steps Hint for the tab of the Discovery plugin: When you go to the tab of the Discovery plugin you see a "go" button. You might think that this starts the scanning. But this is not the case. It's just a filter for the list of already discovered devices. The actual scanning happens according to the "Poller Frequency" which can be set in the settings of Cacti. To activate the Discovery plugin you have to go to Console → Settings → Misc. There is a section called "Discover". The most important thing here is to set the "Poller Frequency". Per default it is set to disabled which means that the whole plugin is disabled. Without doing this you get the following output from the command line.: # php -q /var/www/html/plugins/discovery/findhosts.php -f -d Discovery Polling is set to disabled. Configuration, Screenshot 2 As mentioned before the configuration can be changed in Console → Settings → Misc, section "Discover". Use a comma to define several subnets. For several community strings use a colon. You can also define IP ranges, e.g. 192.168.1.30-192.168.1.40. For the last two options I couldn't see any different behaviour wether they were activated or not.: Rerun Data Queries Create Graphs for Up Interfaces Only Is the Poller Frequency set to something else than disabled it can find devices. But it adds only those devices to the list which can be accessed by snmp with the community string from the settings. On the command line it looks like this: 192.168.1.33 is a valid device! Usage without Discovery Templates If you click "Add" on the Discovery tab you can register a discovered device in Cacti. You get to the page of Cacti where you can add devices but the fields are filled out already. If a discovered host is alread registered in Cacti findhosts.php says „Host is already in hosts table!“ and it will not be added to the list of discovered devices. Strangely the column SNMP on the Discovery tab always show "Up" no matter if the device is accessible with snmp or not. Instead the column Status displays "down" as soon as snmp is down. If the device is completely disconnected from the network the column SNMP still shows up but the Status is down. This means you cannot see if the device is disconnected from the network or if just the snmpd is down. Usage with Discovery Templates, Screenshot 3 To create a Discovery Template you have to select a Host Template with a position in the tree for the graphs and the snmp system Description. With the latter one the plugin associates a device with a Host Template and thus creates the graphs in the tree. All this is done automatically if the poller is active. All devices which have been discovered and have been added to Cacti automatically (by the use of a Discovery Template) don't appear in the list on the Discovery tab. The device descriptions in Cacti are set according to the snmp hostnames. Additional hints you can either scan/discover (no Discovery Template is used) or scan/discover with Discovery Templates. Then the discovered devices will be added to Cacti automatically and the graphs will be added to the tree. It is not possible to just let the plugin add devices to Cacti without the creation of the graphs. Summary A useful plugin to find snmp enabled devices in the network. The user has not much control if he uses Discovery Templates. But it can be helpful if used carefully. Nagios and Cacti Cacti Training |