Before you can create traffic graphs, Cacti must have working SNMP support. One way to do this is to compile PHP with SNMP support built in, many times you can install the 'php-snmp' package to do this. The second option is to have Cacti call the snmpget and snmpwalk binaries from your ucd-snmp or net-snmp installation. You can use the about page to determine whether to are using “built-in” or “external” SNMP support.
Now that you have working SNMP support, follow these steps.
- Click Devices on Cacti's menu.
- Click Add to add a new device.
- Type a description, hostname, management IP, and SNMP community. Make sure to select “Generic SNMP-enabled Host” under Host Template and click Create.
- Click Create Graphs for this Host at the top of the page.
- You should see one or more interfaces listed under the Data Query [SNMP - Interface Statistics] box. Place a check next to each interface that you want to graph. Below the box, select type of graph that you want to create (bits, bytes, summation, etc).
- Click Create, and Create again on the following screen to create your graphs.
Cacti 0.8.6 and above requires that you have at least PHP 4.1 or greater installed.
Your installation of PHP does not have MySQL installed or enabled. On binary-based distributions, make sure you have the \'php-mysql\' package installed. Also make sure that \'extension=mysql.so\' is uncommented in your php.ini file.
- You have a connectivity problem with php and mysql. If you're running MySQL 4.1 or 5, then you will need to apply the old password trick for user authentication to work with Cacti. Add the following to the [mysqld] sub-section:
#Use old password encryption method (needed for 4.0 and older clients). old-passwords.
php -i | grep MYSQL
to find the mysql sock file (MYSQL_SOCKET), e.g. at /var/lib/mysql/mysql.sock rather than /tmp/mysql.sock (which is the default location for mysqld).
In this case, create a symlink from /var/lib/mysql/mysql.sock to /tmp/mysql.sock or edit /etc/my.cnf to solve this issue
To reset the admin account password back to the default of 'admin', connect to your Cacti database at the command line.
shell> mysql -u root -p cacti
Now execute the following SQL:
mysql> update user_auth set password=md5('admin') where username='admin';
Run either of the following from the command prompt:
mysqlcheck --auto-repair --databases cacti
Give cactid|spine, the future replacement for poller.php a try. Unlike poller.php, cactid|spine is written in c and makes use of pthreads. On a typical installation, it is not uncommon for cactid to poll about 500 items in less then 10 seconds.
The best thing to do here is to force Cacti to rebuild its poller cache. To do this click Utilities on the Cacti menu, and select Clear Poller Cache.
Redhat 8.0 comes with a broken php-snmp package. Updating your 'php-snmp' and 'net-snmp' packages to their latest versions should fix this problem.
Run snmpconf -g basic_setup and follow the prompts. Also check that the file being used by snmpd is the correct config file. For Redhat Linux, snmpconf creates the /etc/snmpd.conf, but snmpd uses /etc/snmpd/snmpd.conf.
If this doesn't work a very simple config file is:
# contact syslocation Something syscontact "firstname.lastname@example.org" # auth rocommunity public # disk monitoring disk /
For you to actually get graph images, poller.php must run at least once so it can create .rrd files in Cacti's 'rra/' directory. Double check that you configured your /etc/crontab file to execute poller.php every five minutes. Also make sure that the user poller.php runs as has permission to create new files in Cacti's 'rra/' directory.
If all of your settings appear correct, try running poller.php manually by cd'ing to Cacti's directory and typing:
shell> php poller.php
If you have files in your 'rra/' directory, but your graphs still appear as broken images, you should enable graph debug mode see exactly why the graphs are not rendering. To do this go into Cacti, select Graph Management from the menu, select any graph listed, and select Turn On Graph Debug Mode.
More often than not, this problem's cause is permissions. For instance if you run poller.php manually as root for testing, any .rrd files that it creates will be owned by root. Now when poller.php runs from cron, it will not be able to update these .rrd files because they are owned by root. You can double check the owner of your .rrd files by running the following command in your Cacti directory:
shell> ls -al rra/
If only some of your graphs are not updating correctly, double check the Maximum Value field for all data sources used by these graphs. If the value being fed to the .rrd file exceeds its Maximum Value, RRDTool will insert an Unknown and you will see no data on the graph.
This happens because you have the wrong version of RRDTool selected in Cacti. Set it by going to Settings and applying the proper RRDTool Utility Version.
Cacti does this by default to better control graph title formatting. You can change this limit, by going to Cacti Settings on the Cacti menu, selecting the Visual tab, and changing the value for Data Queries - Maximum Field Length.
This occurs because the reboot causes SNMP's counters to reset, which can cause a rather large spike on the graph when RRDTool tries to determine the change between the new small counter value and the large previous value. One way to combat this issue is to specify realistic maximum values for your data sources. RRDTool will ignore any value that is larger than the maximum value.
If you already have a spike on one or more of your graphs, there is a really useful Perl script that will remove them for you.
RRDTool Says: ERROR: unknown option '--slope-mode' or RRDTool Says: ERROR: Garbage ':39:24 To 2005/10/22 16:39:24\\c' after command: COMMENT:From 2005/10/21 16:39:24 To 2005/10/22 16:39:24\\c
This occurs because the version of RRDTool that you are running does not match the RRDTool version Cacti is configured to use. Double check your Cacti Settings and make sure that the RRDTool version matches what version of RRDTool you are running.
Contrary to previous versions of Cacti, you must not put Cacti in your PHP include path. Check your php.ini file to make sure there is not something like include_path = C:/Apache2/htdocs/cacti.
This is caused because newer versions of PHP no longer support the new client libraries for MySQL 4.1.0 and beyond. The universal fix is to apply the old client hack, outlined in the MySQL section. Cacti will not work with the php_mysqli extension.
This is occurring because your Cacti scheduled task is using the same user name you've logged onto the computer with. There are two possible fixes:
- Use a different user name to run the Cacti scheduled task
- Use a windows script to hide the command windows. Only do this after your cacti installation is fully functional!
- Create a file called invisible.vbs. Place it where ever you like.
- Edit invisible.vbs and paste the following
Set objWSHShell = WScript.CreateObject("WScript.Shell") objWSHShell.Run "poller.php", 0, False
- Edit the Cacti scheduled task and change the Run to:
C:\Windows\system32\wscript.exe "C:\invisible.vbs" "C:\Inetpub\wwwroot\cacti\poller.php"
Open up the SNMP Service and click on the Agent tab. Make sure all the service checkboxes are marked (they are not by default). Restart the SNMP service. Also try increasing the SNMP timeout and decreasing the Maximum OID's Per Get Request.
This error message occurs when you use the Win32 version of rrdtool instead of the Cygwin one. RRDTool 1.2.15 and later work with the Win32 build.
It's possible you need to run wmiadap /f which will re-parses all the performance libraries on the system.
I'm getting errors with something like: //Warning: fgets(): supplied argument is not a valid stream resource: <filename>//
This is most likely due to incorrect NTFS permissions on that file/folder. This prevents Cacti from accessing the file(s) to execute the code. Read in the installation guide on what NTFS permissions need to be set.