packetmischief.ca

Network Monitoring with Cacti


To quote the Cacti site (www.cacti.net):

Cacti is a complete network graphing solution designed to harness the power of RRDTool's data storage and graphing functionality. Cacti provides a fast poller, advanced graph templating, multiple data acquisition methods, and user management features out of the box. All of this is wrapped in an intuitive, easy to use interface that makes sense for LAN-sized installations up to complex networks with hundreds of devices.

Cacti does a good job of allowing the user to customize the look of the graphs through a template system. Management of the data sources is also handled via templates. Cacti is capable of walking SNMP tables (such as the ifTable) and allowing the user to select which objects in the table they want to graph. Cacti can graph an almost unlimited range of data and is fully expandable via a vendor-provided MIBs as well as 3rd-party scripts used for data capture.


CLI Scripts

These scripts are meant to be run from the command line and are generally used for administration and maintenance of the Cacti installation.

add_threshold_contact.php

This script is meant to be used with the Threshold v0.3.7 plugin from cactiusers.org.

Starting with the 0.3.7 version of the Thold plugin (that's the version that's compatible with Cacti 0.8.7) the email alerts are no longer sent to one globally configured email address (the one configured under Settings, Thold). Instead, each threshold has a list of users assigned to it that will receive email alerts.

This script is meant to help users who are upgrading to 0.3.7 so that they can configure email alerts after they've upgraded and it's also meant as a bulk updater of threshold alert recipients.

Usage: add_threshold_contact.php [-r] [-d <descr>] [-h <hostname>] -u <username>

-d <descr>    Only add <username> as a contact if the threshold
              belongs to a device with description <descr>.
              Wildcards can be used by using '%'.
-h <hostname> Only add <username> as a contact if the threshold
              belongs to a device with hostname <hostname>.
              Wildcards can be used by using '%'.
-u <username> The Cacti user to add as a contact. Unless -d
              and/or -h are specified, the user will be added
              to all thresholds.
-r            Removes the contact from the specified thresholds
              instead of adding.

The list of possible email recipients is taken from Cacti's built-in user database. If you want multiple people to receive alerts, create a user for each of them in Cacti, adjust their permissions as needed (which could include disabling the user if you don't want that person to login and only want them to receive alerts via email) and add an email address for them. If you have existing user(s) that you want to recieve alerts, go into User Management and add an email address for each of them.

The script:

Script Server Scripts

These scripts are meant to be used with the Cacti script server.

ss_mysql_local.php

This script captures and returns data from the MySQL server running on the same server that Cacti itself is running on. Put the script in the scripts/ directory, import the graph templates and then create the graphs.

These graphs are from my personal Cacti server. The only thing that MySQL is used for on that server is for Cacti hence the very low usage.






Cacti Bugs

Bugs that I've run into in Cacti and the Cacti Plugin Architecture.

Cacti 0.8.7

Cacti Plugin Architecture