The Cacti Manual

Chapter 3. Installing Under Windows

Last updated: July, 2009


Downloads

Required:

  1. Cacti .  Latest version available.
  2. RRDTool . Minimum version: 1.0 . Recommended: 1.2.26 Win32 Build
    Note: Cygwin build for versions before 1.2.15 are required. Win32 build should work fine after 1.2.15.

    Note: RRDTool 1.3.x is only supported in Cacti 0.8.7c or later.
  3. PHP . Minimum: 4.3.6 .  Recommended: 5.2 .x  Download the installer.
  4. MySQL . Minimum: 4.1 .  Recommended: 5.0.x   Download the Windows MSI Installer file, NOT Windows Essentials.
    Note: MySQL 5 is only supported in Cacti 0.8.6i or later.

Optional:

  1. Spine . Latest version available.
  2. Cygwin . Recommended: 1.5.x   Download setup.exe .
  3. Apache .  Minimum version: 2.0 . Recommended version: 2.2.x .  Download the MSI installer.
  4. Net-SNMP . Minimum: 5.3.1 .  Recommended: 5.4 .x Download the Win32 installer.
  5. Cacti-Security script to configure NTFS permissions automatically for you.  Xcacls will be needed. 

Back to Top

 

Installations

Log on as an Administrator and install the following pieces of software.

 

Cacti
Recommended Install Path: C:/Inetpub/wwwroot/cacti/

  • Extract the cacti zip file to the root of your web server directory.  This will be c:/inetpub/wwwroot if you are using the default installation of IIS. The extracted directory will be called cacti-0.8.7e . Rename it to cacti .

 

PHP
Recommended Install Path: C:/PHP/
Note: Do not install into a path containing spaces (i.e. C:/Program Files/PHP/).
Note: PHP 5.2.10 and later dropped ISAPI support in favor for FastCGI.

  • Double-click on the php installer to start it running.
    1. Click Next to the welcome page.
    2. Click I Agree to accept the license agreement.
    3. At the Destination Folder page, change the path to: C:/PHP/ and click Next .
    4. At the Web Server page:
      1. PHP 5.2.9 or earlier: select IIS ISAPI Module and click Next .
      2. PHP 5.2.10 or later: select IIS FastCGI and click Next .
    5. At the Choose Item page, do the following:
      1. Click on the Program folder and select entire feature will be installed on local hard drive . The icon should now be white.
      2. Click on the Script Executable folder and select entire feature will be installed on local hard drive . The icon should now be white.
      3. Under the Extensions folder, select MySQL , SNMP , and Sockets to be installed. If you want to use LDAP authentication in Cacti, also enable the LDAP extension.
    6. Click Next .
    7. Click Install .
    8. Once done installing, click Finish .
  • Create new folders under C:/PHP/ called Uploadtem, Session and MIBS .
  • Move the contents of the C:/usr/mibs/ folder to C:/PHP/Extras/mibs/ .

 

MySQL
Recommended Install Path: C:/MySQL/

  • Extract the MySQL zip file to a temporary directory (e.g. C:/Temp) and run the Setup.exe file.
    1. At the Welcome screen, click Next .
    2. At the Setup Type screen, select Custom and click Next .
    3. At the Custom Setup screen for component selection, leave the defaults.
    4. At the bottom of the page, click on Change... and alter the destination folder to be C:/MySQL/ and click OK .
    5. Click on Next .
    6. Click Install to proceed with the installation.
    7. Close the MySQL Enterprise screen.
    8. At the Wizard Completed screen, leave Configure MySQL Server now checked and click Finish .
  • MySQL Service Instance Configuration Wizard
    1. At the Welcome screen, click Next .
    2. At the MySQL Service Instance Configuration screen, select Detailed Configuration and click Next .
    3. At the server type screen, select Server Machine and click Next .
    4. At the database usage screen, select Non-Transactional Database Only and click Next .
    5. At the concurrent connection screen, select Decision Support OLAP and click Next .
    6. At the networking options page, check Enabled TCP/IP networking and leave default port 3306.  Uncheck Enable Strict Mode .  Click Next .
    7. At the default character set page, select Standard Character Set and click Next .
    8. At the Windows options page, check Install as Windows Service and Include Bin Directory in Windows PATH . Click Next .
    9. At the security options page, type in a root password.  Click Next .
    10. At the Ready to execute page, click on Execute .
    11. Click on Finish .

 

RRDTool
Recommended Install Path: C:/RRDTool/

  • Extract the rrdtool zip file to C:/RRDTool/.

 

Now at this point you have enough installed to configure and test before adding further complication and problems.  Continue on to the patching section.

 

 

Installations - Optional Components

These various components are not required for Cacti to function.  Some are a choice of preference or performance.

 

Spine
Recommended Install Path:
C:/Spine/
Information: Spine is a poller for Cacti that primarily strives to be as fast as possible. For this reason it is written in native C, makes use of POSIX threads, and is linked directly against the net-snmp library for minimal SNMP polling overhead. Spine is a replacement for the default cmd.php poller so you must decide if using Spine makes sense for your installation.  It is highly recommended that users start out with the default cmd.php poller until their installation is fully functional!  Cactid was renamed to Spine for the 0.8.7 release.

Cactid is for Cacti 0.8.6 and below.
Spine is for Cacti 0.8.7 and above.

  • Extract the spine zip file to C:/Spine/

WARNING: Spine is only compiled with Cygwin and thusly needs a few Cygwin dlls on the system.  These are included with the downloaded zip file.  This can become a problem if RRDTool is also compiled under a different Cygwin version, since then there will be different Cygwin dll versions on the system which can cause issues.  If you're using a Win32 build of RRDTool, then nothing to worry about.  There are a few ways to solve the problem:

  1. Install a base install of Cygwin and delete all cygwin files from the RRDTool and Spine folders.
  2. Move RRDTool and Spine into the same folder, so they share the Cygwin dlls.  Your mileage may vary due to each binary being compiled against a different Cygwin version.

 

Cygwin
Recommended Install Path: C:/Cygwin/
Information: Cygwin is a Linux-like environment for Windows.  The benefit of having Cygwin installed is so there that there are only one set of Cygwin dlls on the system.  Both RRDTool and Spine come with cygwin dlls and can cause version conflicts.  If you plan on compiling RRDTool or Spine, Cygwin is required.

  1. Run setup.exe.
  2. Once you reach the portion of setup entitled Select Packages , install the following:
    Base (whole thing)
    Libs
    libart_lgpl
         libfreetype26
    libintl3
         libpng12
    readline
         zlib
    Utils
    patch
    Web
    wget
  3. Add c:/cygwin/bin to your system path.
  4. Move setup.exe to c:/cygwin for future use.

 

Apache
Recommended Install Path: C:/Apache2/
Note: Do not install into a path containing spaces (i.e. C:/Program Files/Apache/) unless you're prepared to deal with 8.3 filenames.
Information: Using Apache instead of IIS is purely preferential as Cacti works with either. 

  • If planning on using Apache, it should be installed before installing PHP.

  • Make sure you have stopped & disabled all IIS services before you proceed with the Apache installation. 

  • Run the apache setup msi file
    1. At the Welcome screen, click Next .
    2. At the license agreement screen, select I Accept and click Next .
    3. At the Read this first page, click Next .
    4. At the Server Information page, enter in the network domain, server name and email (if applicable) and click Next .
    5. At the Setup type page, select Typical and click Next .
    6. At the Destination folder page, click on Change... .  Change the folder name to C:/Apache2/ . Click OK and then Next .
    7. Click Install .
    8. Click Finish to close the installer.

 

Net-SNMP
Recommended Install Path: C:/Net-SNMP/
Information: If PHP 5.2 is not installed, then Net-SNMP should be installed.  If you plan to use any hosts with SNMP v3 support, you must install the Net-SNMP binaries, since the PHP SNMP extension does not handle SNMPv3.  You do NOT need to install/use the Net-SNMP SNMP agent. The Microsoft SNMP agent is recommended.  The Net-SNMP binaries are useful when creating custom scripts, as they provide an easy way to query SNMP data from devices.

  • Run the net-snmp installer
    1. At the Welcome page, click Next .
    2. At the license agreement page, select I Agree and click Next .
    3. At the Components page:
      1. Check Base Components .
      2. Under Net-SNMP Agent Service, check With Windows Extension DLL support .
      3. Uncheck Net-SNMP trap service
      4. Uncheck Perl SNMP modules
      5. Uncheck Development files
    4. Click Next .
    5. At the Installation location page, change the destination folder to C:/Net-SNMP/ .  Click Next .
    6. At the Start menu folder location page, leave the default and click Install .
    7. Once done installing, click Finish .

 


Back to Top

 

Appling Patches

  1. There are two methods of applying patches to Cacti:
    1. If you have Cygwin installed (installation instructions further down in this guide), then the patch instructions which use wget and patch, will work. 
    2. The other method requires you to visit http://www.cacti.net/downloads/patches/<cacti version>/pre-patched/ and manually download and replace the patched files.
  2. You must reapply file/folder security on the files patched, due to the fact they will not likely inherit the correct permissions. Double check they are correct.

Back to Top

 

Configuration

PHP:

  1. Verify the PHP installer properly added C:/PHP/ to your Windows PATH environment variable.

    1. The Windows path variable can be accessed via the Control Panel at: System | Advanced | Environment Variables

    2. In the System Variables groupbox, find Path and click Edit .  Make sure C:/PHP / is in there somewhere.

  2. Verify the PHP installer properly added a new system variable called PHPRC . Its value should be C:/PHP/ .

  3. Add a new system variable called MIBDIRS .  Its value should be C:/PHP/Extras/mibs

    1. Refer to step 1 on the location of the System Variables

    2. Under the System variables groupbox, click on New .

    3. In the Variable name field, type MIBDIRS .

    4. In the Variable value field, type C:/PHP/Extras/mibs

    5. Click OK and close the dialog boxes.

  4. Find and then uncomment/modify the following lines in C:/PHP/php.ini .

    fastcgi
    .impersonate = 1
    
    register_argc_argv = On
    safe_mode = Off
    cgi .fix_pathinfo = 1
    cgi.force_redirect = 0
    upload_tmp_dir = "C:/PHP/Uploadtemp "
    session.save_path="C:/PHP/Session"
  5. The following resource limits should be changed from their defaults.  Depending on the scripts, amount of data being returned and number of devices you use, they might need to be further increased at a later period in time.

    max_execution_time = 60 ; Maximum execution time of each script, in seconds
    max_input_time = 120 ; Maximum amount of time each script may spend parsing request data
    memory_limit = 128M ; Maximum amount of memory a script may consume (8MB)
  6. If you have had previous versions of PHP installed, you had likely moved the PHP system files to in the Windows directory structure. If so, you will have to remove those files. Please review your PHP installation documentation for instructions on removing those files.

  7. Change NTFS permissions on C:/PHP/Uploadtemp and C:/PHP/Session to grant Modify rights to the IUSR_ and IIS_WPG users for only files in the directory.

  8. Give the user who will be running the scheduled task, Modify rights to: c:/php/extras/mibs/.index

 

IIS:

Instead of retyping all the instructions configuring PHP for FastCGI, please read the following links. For IIS 7, read this link . For IIS 5.1 and 6, read this link .

 

The instructions below are for older PHP versions which use the ISAPI module. FastCGI users will still need to follow the bottom half of the instructions though, just disregard the php5isapi.dll stuff.

Note: IIS6 has the IIS_WPG user account. IIS7 it's called IIS_USRS.

  1. Start the Internet Information Services (IIS) Manager, right click on Default Web Site and select Properties

  2. Under the ISAPI Filters tab:

    1. Click on Add .

    2. In the Filter Name field, type: .php .

    3. In the Executable field, click on Browse...

    4. Navigate to C:/PHP/php5isapi.dll .

    5. Click OK .

  3. Under the Home Directory tab:

    1. Verify the PHP installer created a mapping for the .PHP extension to C:/PHP/php5isapi.dll

    2. Verify the .PHP mapping has All Verbs and Script Engine checked.

  4. Under the Documents tab, add index.php to the list.

  5. Click OK to close the Default Website Properties window.

  6. If using IIS6, go to Web Service Extensions and add a new Web Service Extension .  Name the extension php , click Add and browse to C:/PHP/php5isapi.dll ,  enable Set Extension status to Enable , and click OK .
  7. Under the Default Web Site , right click on Cacti folder and select Properties .
    1. Click on the Documents tab
    2. Click on Add... .
    3. In the Default Document Name field, type in: index.php and click OK .
    4. Select index.php in the default document list and move it to the top.
    5. Click OK to close the cacti properties window.
  8. Give the COMPUTERNAME/IUSR_ and COMPUTERNAME/IIS_WPG users R ead & Execute permissions to the file C:/Windows/system32/cmd.exe .   Yes, this can be a large security hole, but it's required so RRDTool can be launched for graphing by the anonymous web account.  For slightly improved security, one can specify a separate custom User account which would be used for the /wwwroot/Cacti/ site.  Then, instead of using IUSR_ everywhere throughout this document, replace it with the custom User account.  This way, only a security hole in Cacti's code could exploit cmd.exe and not all sites on the IIS server.
    1. Right click on cmd.exe and select Properties .
    2. Click on the Security tab.
    3. Select the IUSR_ account
    4. Click on Read & Execute in the Permissions box.
    5. Repeat for the IIS_WPG user.
    6. Click OK .
  9. Both IUSR_ and IIS_WPG users will also need read permissions on C:/Inetpub/wwwroot/cacti/ and its subfolders.
    1. Right click on the folder C:/Inetpub/wwwroot/cacti and select Properties .
    2. Click on the Security tab.
    3. Click on Add... under the group or user names section.
    4. Type in IUSR_ COMPUTERNAME or click Advanced... and Find Now.  Repeat for the IIS_WPG account.
    5. Click OK to close the select users or groups window.
    6. Select the IUSR_ COMPUTERNAME from the list.
    7. Select Read & Execute from the Permissions box.
    8. Repeat for the IIS_WPG account.
    9. At the bottom of the Security tab, click on Advanced... .
    10. In the Permissions tab, click on Replace permissions entries on all child objects with entries shown here that apply to child objects .
    11. Click OK .
    12. Click Yes to the Security warning dialog box.
    13. Click OK to close the properties window.
  10. Give the IUSR_ and IIS_WPG users modify permissions to the folders C:/Inetpub/wwwroot/cacti/log and C:/Inetpub/wwwroot/cacti/rra .
  11. Completely stop and start the IIS service using the following commands from the command prompt.  Alternatively, use the Service MMC snap-in under Administrative Tools.

    net stop iisadmin
    
    
    net start w3svc
  12. Verify PHP is functional by running: php -m at the command prompt.

    Note: If messages with, Cannot find module appearing, then there is something wrong with the MIBDIRS variable or missing mib files in the PHP/Extras/mib folder.  Make sure the MySQL, SNMP and Sockets PHP modules are in the list.
    c:/>
     php -m
    
    [PHP Modules]
    bcmath
    calendar
    com_dotnet
    ctype
    date
    dom
    filter
    ftp
    hash
    iconv
    json
    libxml
    mssql
    mysql
    odbc
    pcre
    Reflection
    session
    SimpleXML
    snmp
    sockets
    SPL
    standard
    tokenizer
    wddx
    xml
    xmlreader
    xmlwriter
    zlib

    [Zend Modules]

 

RRDTool

  1. If you plan on installing Cygwin, remove all DLL files from the C:/rrdtool directory.  Otherwise, nothing to configure.

 

MySQL

  1. Stop the MySQL service.

  2. Edit your C:/MySQL/my.ini file

  3. Verify you don't have a sql-mode defined.  If so, comment it out.

  4. You will need to apply the old client hack for user authentication to work with Cacti.
    1. Add the following to the [mysqld] sub-section:
      #Use old password encryption method (needed for 4.0 and older clients).
      old-passwords
  5. Start the MySQL service.

  6. Set a password for the root user (if not set already during MySQL installation)

    c:/>
    
     mysqladmin --user=root password somepassword
    
    c:/> mysqladmin --user=root --password reload
  7. Create the MySQL database:

    c:/>
     mysqladmin --user=root --password create cacti
    
    
  8. Import the default Cacti database:

    c:/>
     mysql --user=root --password cacti < c:/inetpub/wwwroot/cacti/cacti.sql
    
    

    Note: If you get any errors during this phase, you likely have sql-strict mode enabled or something else misconfigured in my.ini!
  9. Create a MySQL username and password for Cacti.

    c:/>
     mysql --user=root --password mysql
    
    
    mysql> GRANT ALL ON cacti.* TO cactiuser@localhost IDENTIFIED BY 'cactipw';
    mysql> flush privileges;
  10. You will also need to update the cactiuser account with the old password style:
    mysql>
     UPDATE mysql.user SET Password = OLD_PASSWORD('cactipw') WHERE Host = 'localhost' AND User = 'cactiuser';
    
    mysql> FLUSH PRIVILEGES;
    mysql> exit

 

Cacti
  1. Reboot your server.  Some times environment variables and services need to be reset in order for everything to work properly.
  2. Edit c:/inetpub/wwwroot/cacti/include/config.php and specify the MySQL user, password and database for your Cacti configuration.

    $database_default = "cacti";
    $database_hostname = "localhost";
    $database_username = "cactiuser";
    $database_password = "cactipw";

  3. Point your web browser to http://localhost/cacti/
    You should be presented with the Cacti Installation Guide page. 

  4. Click Next .
  5. Select New Install for the type of installation.  Click Next .
  6. Verify the RRDTool, PHP, Cacti Log File, paths and RRDTool Utility version are all correct.  Ignore the Net-SNMP paths unless it was previously installed. Click Finish .
  7. At the User Login page, log in the with a username of admin and password of admin . You will be required to change this password immediately.
    Note: If you are brought back to the User Login page with no error messages, then you have have a PHP session/cookie problem.
  8. Once logged in, click on Settings and then the Paths tab. Verify/update your paths to point to the correct locations. Recommended examples are posted below.  If you plan on using Spine in the future, then it is very important that your all your paths and scripts use forward slashes. Additionally, RRDTool 1.0 used a mono-spaced font while RRDTool 1.2 defaults to variable width font. Using the latter will cause graph text to not align properly. That being the case, a solution is to specify a mono-spaced font like VeraMono or DejaVuSansMono-Roman in the RRDTool Default Font Path (i.e. C:/windows/fonts/VeraMono.ttf ).  Google for these fonts, as they don't come with Windows.

    PHP Binary Path:

    c:/php/php.exe

    RRDTool Binary Path:

    c:/rrdtool/rrdtool.exe

    RRDTool Default Font Path:

    c:/windows/fonts/arial.ttf

    RRDTool Version:

    Select the appropriate version

    SNMPGET, SNMPWALK, SNMPBULKWALK, SNMPGETNEXT Paths:

    c:/net-snmp/bin/snmpget.exe
    c:/net-snmp/bin/snmpwalk.exe
    c:/net-snmp/bin/snmpbulkwalk.exe
    c:/net-snmp/bin/snmpgetnext.exe

    Cacti Logfile Path:

    c:/inetpub/wwwroot/cacti/log/cacti.log

    Spine Path:

    c:/Spine/Spine.exe
  9. Click on Devices . Delete Localhost, since it's set up to use the Linux host template.  
  10. In the upper right corner, click on Add .   Fill in the following information and then click Add .
    Description: localhost
    
    Hostname: localhost
    Host Template: Windows 2000/XP
  11. You should now be looking at the localhost device screen.  Right under it's name, there should be some SNMP Information listed regarding the system, uptime, hostname, location and contact.  If not, you should double check the SNMP settings on the server and firewall settings.  In the upper right-hand corner, click on Create Graphs for this Host .
  12. On the following screen, select a disk partition and network interface.  At the bottom of the page, click on Create .
  13. Log into the user account you'll be using  for the scheduled task and verify starting a Cacti polling cycle works.  Do this by running the following from the command prompt: 
    php c:/inetpub/wwwroot/cacti/poller.php

    The output should look something like this after several command windows pop up:
    C:/>
     php c:/inetpub/wwwroot/cacti/poller.php
    
    10/28/2009 04:57:12 PM - SYSTEM STATS: Time:1.7272 Method:cmd.php Processes:1 Threads:N/A Hosts:1 HostsPerProcess:2 DataSources:4 RRDsProcessed:2
    After this has ran once, you should have cacti.log  in /cacti/log/  and rrd files in /cacti/rra/ .
  14. You are going to need to schedule a task while logged on as an Administrator account, so poller.php can run every 5 minutes. Make sure the Task Scheduler service is started and follow the steps below to begin.

    1. Select Start --> Settings --> Control Panel and double click on Scheduled Tasks .

    2. Double click on Add Scheduled Task .

    3. Click Next and Browse on the following screen. Find c:/php and select php.exe . Choose Daily on and click Next .

    4. Click Next again without changing the time or date settings.

    5. When entering a username and password make sure the user has modify permissions to the following directories:

      c:/inetpub/wwwroot/cacti/rra/
      c:/inetpub/wwwroot/cacti/log/

      Make sure the user has Read & Execute permissions to the following directories:

      c:/php/
      c:/inetpub/wwwroot/cacti/
      c:/rrdtool/
    6. Click Next and Finish to close the wizard.

    7. Right click on the task you just created, and select Properties .

    8. Select the Schedule tab.

    9. Make sure Daily is selected and click the Advanced button.

    10. Check the Repeat checkbox, set the repetition for every 5 minutes, set the duration for 24 hours, and check the If the task is still running, stop it at this time checkbox.

    11. Click OK

    12. In the Run textbox enter the following text making sure to use the appropriate paths.

      c:/php/php.exe c:/inetpub/wwwroot/cacti/poller.php

      The start in box should say c:/inetpub/wwwroot/cacti .

  15. After waiting 10 minutes (aka 2 polling cycles), one should be able to view the graphs.

  16. Go to Graph Management and click on each graph to view its progress.

  17. Go to Graph Trees and click on Default Tree .

  18. Click on Add .

  19. Under Tree Item Type, select Host . Click on Create and then Save .

  20. View the new graph tree by clicking on the Graphs tab at the top of the screen.

 

Configuration - Optional Components

Apache:

  1. Add the following lines to your httpd.conf file in the c:/apache2/conf directory:

    LoadModule php5_module "c:/php/
    
    
    php5apache2_2.dll"
    
    AddType application/x-httpd-php .php
    PHPIniDir "C:/php"

    DirectoryIndex index.php index.html index.htm
  2. Restart the Apache service.

 

Net-SNMP

  1. Append the MIBDIRS system variable with the path of Net-SNMP MIB files.

    MIBDIRS=c:/php/extras/mibs;C:/Net-SNMP/share/snmp/mibs	

Spine
  1. Modify the Spine.conf file in c:/Spine to include the following statements.

    DB_Host      	IP Address or Hostname (not localhost)
    DB_Database cacti
    DB_User cactiuser
    DB_Password cactipw
    DB_Port 3306
  2. If you have Cygwin installed, remove the DLL files from the c:/Spine directory.

 


Back to Top

 

Troubleshooting:

  1. If you're not getting any graphs or rrd files created, it's possibly because Cacti is not collecting valid data. You must wait at least two polling cycles for data to show up in a graph. To check if Cacti is collecting valid data from your device in question, do the following:
    1. Turn the Poller Logging Level in Cacti to debug (Settings | Polling level) for one cycle, wait for Cacti to run
    2. This is an example of a successful SNMP query:
      CMDPHP: Poller[0] Host[2] DS[18] SNMP: v1: 192.168.100.1, dsname: traffic_out, oid: .1.3.6.1.2.1.2.2.1.16.1, output: 322328722
      CMDPHP: Poller[0] Host[2] DS[18] SNMP: v1: 192.168.100.1, dsname: traffic_in, oid: .1.3.6.1.2.1.2.2.1.10.1, output: 426701050
      If the output was NaN, then Cacti did not collect any data. This is where either the Net-SNMP tools or GetIF comes in handy for testing SNMP.
      1. Test if you're able to retrieve SNMP data manually using the OID Cacti failed on. You might need to remove the last number from the OID when doing this. For example, in the case of retrieving interface data, instead of using .1.3.6.1.2.1.2.2.1.10.1 in the example above, you should snmpwalk .1.3.6.1.2.1.2.2.1. Using Net-SNMP snmpwalk, you would do:
        C:/net-snmp/bin>snmpwalk -v 1 -c public 192.168.2.1 .1.3.6.1.2.1.2.2.1
      2. If you still receive no SNMP output, then you either didn't properly configure the SNMP agent or there is a firewall blocking the data.
    3. Another thing you'll want to look for in the log file are CACTI2RRD entries. These are when Cacti updates the rrd files with the data it collected during a polling cycle. Here is an example of one from my traffic collected from above:
      POLLER: Poller[0] CACTI2RRD: c:/rrdtool/rrdtool.exe update C:/inetpub/wwwroot/cacti/rra/cable_modem_traffic_1.rrd --template traffic_out:traffic_in 1141333802:322328722:426701050
    4. If you saw in the log file Cacti updating the rrd file, but the modification date never changed on the rrd file, then you have a permission problem somewhere. Check the IUSR and IIS_WPG user accounts have read/execute rights on rrdtool.exe and cmd.exe. They'll also need modfiy rights to the /cacti/rra and /cacti/log folders.
    5. Follow this guide on debugging NaN's.


Back to Top

 

Optimizations:
There are several things you can do to speed up your Cacti web server.  It's suggested that you only apply these after you have a fully functional Cacti installation.

  1. Switch the polling agent in Cacti from cmd.php to Spine.exe.  Go to Settings | Poller | Type .  Don't forget to configure your C:/Spine/Spine.conf file.
  2. Install the Zend Optimizer for PHP.  
  3. Set up the query cache in MySQL.  Read about how to properly configure the settings .  You will need to stop the MySQL service when you edit c:/mysql/my.ini and put in the following:
    #The memory allocated to store results from old queries.
    query_cache_size=16M
    #Don't cache results that are bigger than this.
    query_cache_limit=1M
    #Query cache type to use.
    query_cache_type=1
  4. Install FastCGI , which can offer x4 to x8 improvement (for IIS users at least).
  5. An An extensive list of other optimizations for PHP and MySQL can be found over at phplens.com .
  6. Install the Cacti plugin architecture and Boost plugin .


Back to Top

 

FAQ (eventually added to the FAQ section of Cacti)

 

Q: Call to undefined function mysql_connect() in C:/Inetpub/www/cacti/lib/adodb/drivers/adodb-mysql.inc.php on line 338
A:
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 above. Cacti will not work with the php_mysqli extension.

 

Q: How do I stop the command windows from opening every 5 minutes?
A:  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:

  1. Use a different user name to run the Cacti scheduled task
  2. Use a windows script to hide the command windows.  Only do this after your cacti installation is fully functional!
    1. Create a file called invisible.vbs .  Place it where ever you like.
    2. Edit invisible.vbs and paste the following
      Set objWSHShell = WScript.CreateObject("WScript.Shell")
      objWSHShell.Run "poller.php", 0, False
    3. Edit the Cacti scheduled task and change the Run to:
      C:/Windows/system32/wscript.exe "C:/invisible.vbs" "C:/Inetpub/wwwroot/cacti/poller.php"


Q:  I see errors in the cacti.log file. How to I find out what is wrong?

A:  Turn up the logging level in Cacti.  In Cacti go to Settings and change the Poller Logging Level to Debug for one cycle . If you notice your log file is filled with WEBLOG entries, which makes it hard to follow what is going on, then uncheck all of the Web Events , save and wait for the next polling cycle.

Q: Does Cacti use MIB files?

A: No. But they are handy to have around when making custom scripts in conjunction with Net-SNMP or GetIF. PHP SNMP and Net-SNMP do use MIB files to resolve OIDs to friendly names.

Q: How can I debug SNMP output from a device?
A: The easiest tools are either GetIf or Net-SNMP .   GetIf is fairly self explanatory since it has a GUI.  Using the MBrowser tab is handy for navigating the SNMP trees and OIDs.  Net-SNMP is comprised of several tools. You'll want to use snmpget and snmpwalk.   An example of parsing the interfaces on a device would be:

C:/net-snmp/bin/>
 snmpwalk -v 1 -c public 127.0.0.1 .1.3.6.1.2.1.2.2
An alternative would be to use a MIB name. This of course does require the use of MIB files:
C:/net-snmp/bin/>
 snmpwalk -v 1 -c public 127.0.0.1 ifDescr


Q: Why doesn't Windows return Disk or CPU usage via SNMP?
A: 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.

 

Q: How do I get FastCGI working?

A: For IIS 7, read this link . For IIS 5.1 and 6, read this link .

 

The following has been superceeded by the above FAQ. Left in for history.
Q: How do I get FastCGI to work with Windows 20003?

A: A little modification needs to be done to the existing documentation .  
  1. Make sure IIS_WPG account has read/execute rights on the PHP and Cacti folders.
  2. Use the following modified fastcgi.reg file (assumes you're using PHP5)
    Windows Registry Editor Version 5.00

    [HKEY_LOCAL_MACHINE/SOFTWARE/FASTCGI]
    "S"StartServers"=dword:00000002
    "IncrementServers"=dword:00000002
    "MaxServers"=dword:00000019
    "Timeout"=dword:00000258

    [HKEY_LOCAL_MACHINE/SOFTWARE/FASTCGI/.php]
    "AppPath"="c://php//php-cgi.exe"
    "BindPath"="php-fcgi"
  3. Create a web site extension called  fastcgi . Add isapi_fcgi.dll and php-cgi.exe .
  4. In the Default Website , under ISAPI filters , create a new filter in addition to the PHP one.  Call it fastcgi and point it to isapi_fcgi.dll .
  5. Under the Home Directory tab, select Configuration and, change the .php extension to use isapi_fcgi.dll .

 

Q: ERROR: change root is not supported by your OS or at least by this copy of rrdtool.
A:
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.

Q: All my graphs are blank. Enabling graph debugging reveals a blank RRDTool Says output. What's wrong?
A:
It's very likely the NTFS permissions on cmd.exe or rrdtool.exe is not set correctly.  Both need Read/Execute rights by the web server.  Read about the exact details in the installation guide.

Q: When attempting to run poller.php or cmd.php you get, This script is only meant to run at the command line .
A:
 Most likely caused by a misconfiguration in your php.ini file. Make sure the following is set in it:
register_argc_argv = On
safe_mode = Off
Another possibility is a logic bug in cmd.php only present in Cacti 0.8.6j and PHP 5.2.  Open cmd.php and go to line 49. Change it to:
if (version_compare("5.2.0", PHP_VERSION, ">=")) {


Q: How do I get WMI scripts working on remote computers?
A:
There are several things one needs to do to accomplish this:
  1. Open a hole in the firewall for DCOM.  For the Windows XP SP2 or Windows 2003 SP1 firewall, do the following:
    1. Open up the Windows Firewall control panel
    2. Click on Add Port .
    3. Name: DCOM
      Port: 135
      Type: TCP
    4. You might need to change the scope of the rule, depending on where you will be remotely querying the server from.
    5. Start | Run: gpedit.msc
    6. Navigate to: Computer Configuration | Administrative Templates | Network | Network Connections | Windows Firewall
    7. Enable the following:
      Allow remote administration exception
      Allow local port exceptions
  2. Edit WMI security
    1. Start | Run: wmimgmt.msc.
    2. Get properties on WMI Control .

    3. Go to the Security tab
    4. Click on the Root folder, then the security button at the bottom
    5. Click on Advanced
    6. Add the cactiuser account that's going to be used. Assign the following rights:
      Enable Account
      Enable Remote
    7. Change the Apply onto to to: This namespace and subnamespaces .
    8. Click OK several times and close the WMI window.
  3. Edit DCOM security
    1. Start | Run: dcomcnfg
    2. Navigate to: Component Services | Computers | My Computer .
    3. Get properties on My Computer
    4. Click on the COM Security tab.
    5. Under Launch and Activate Permissions , click on Edit Limits
    6. Add the cactiuser account that's going to be used.  Assign the following rights:
      Remote Activation
    7. Click OK and exit.

Q: Why doesn't a WMI counter say it exists when I know it should?
A:
It's possible you need to run wmiadap /f which will re-parses all the performance libraries on the system.

 

Q: I don't see any graphs on the main graph page, but when I click on one, I see 4 graphs with data.
A: 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.

 

Q: Why do my graphs randomly not have any text while the data is properly displayed?
A: It seems there is a bug in newer versions of PHP 4 & 5, specifically in php4ts.dll. Get php4ts.dll from PHP 4.3.11 and replace the current one in your PHP directory. *WARNING* not responsible for any adverse affects this might have on your system.

 

Q: How does one know if Cacti has debugging logging properly enabled?
A: It seems there is a bug in Cacti were even though the logging level is set to DEBUG, you do not truly get debugging output.

If your log file is filled with something like the following which constantly repeats, Cacti is NOT in debugging mode:

CMDPHP: Poller[0] DEBUG: SQL Assoc: "select  poller_output.output,  poller_output.time,  poller_output.local_data_id,  poller_item.rrd_path,  <snip>
CMDPHP: Poller[0] DEBUG: SQL Assoc: "select poller_id,end_time from poller_time where poller_id = 0"

If your log file contains things like the following, then debugging logging is properly enabled:

CMDPHP: Poller[0] Host[1] SNMP: Host responded to SNMP
CMDPHP: Poller[0] DEBUG: SQL Exec: "update host set status = '3', status_event_count = '0', status_fail_date = '2006-01-19 02:20:10', <snip>
CMDPHP: Poller[0] Host[1] RECACHE: Processing 3 items in the auto reindex cache for 'ares.mydomain.com'.
CMDPHP: Poller[0] DEBUG: SQL Exec: "update poller_reindex set assert_value='368365818' where host_id='1' and data_query_id='8' and arg1='.1.3.6.1.2.1.1.3.0'"
CMDPHP: Poller[0] DEBUG: SQL Exec: "update poller_reindex set assert_value='368365819' where host_id='1' and data_query_id='14' and arg1='.1.3.6.1.2.1.1.3.0'"
CMDPHP: Poller[0] Host[1] DS[10] SNMP: v2: ares.mydomain.com, dsname: proc, oid: .1.3.6.1.2.1.25.1.6.0, output: 53
CMDPHP: Poller[0] DEBUG: SQL Exec: "insert into poller_output (local_data_id,rrd_name,time,output) values (10,'proc','2006-05-28 09:20:02','53')"
CMDPHP: Poller[0] DEBUG: SQL Assoc: "select poller_id,end_time from poller_time where poller_id = 0"
CMDPHP: Poller[0] DEBUG: SQL Assoc: "select poller_output.output, poller_output.time, poller_output.local_data_id, poller_item.rrd_path, <snip>
CMDPHP: Poller[0] DEBUG: SQL Exec: "delete from poller_output where local_data_id='10' and rrd_name='proc' and time='2006-05-28 09:20:02'"
POLLER: Poller[0] CACTI2RRD: c:/rrdtool/rrdtool.exe update c:/cacti/rra/ares_proc_10.rrd

 

Q: What are the NTFS permissions that need to be set for Cacti to function?
A:

AliasUsername/GroupDesciption
TaskUserDomain/UsenameThe user account that runs the scheduled task for Cacti.
IIS_USERIUSR_COMPUTERNAMEInternet Guest Account (Windows NT/2000/XP/2003)
IIS_USERIUSRInternet Guest Account (Windows Vista/2008)
IIS_SERVICEIIS_WPGIIS Service Account (Windows 2003)
IIS_SERVICEIIS_USRSIIS Service Account (Windows Vista/2008)

 

PathUserNTFS Permissions
C:/Spine/TaskUserRead & Execute
C:/Cygwin/bin/TaskUserRead & Execute
C:/Inetpub/wwwroot/cacti/TaskUserRead & Execute
 IIS_USERRead & Execute
C:/Inetpub/wwwroot/cacti/rra/IIS_SERVICE Modify
 IIS_USERModify
 TaskUserModify
C:/Inetpub/wwwroot/cacti/log/IIS_SERVICEModify
IIS_USERModify
 TaskUserModify
C:/PHP/IIS_USERRead & Execute
 TaskUserRead & Execute
C:/PHP/sessiondata/IIS_USERModify (Files only)
C:/PHP/uploadtemp/IIS_USERModify (Files only)
C:/Net-SNMP/IIS_USERRead & Execute
C:/RRDTool/IIS_USER Read & Execute
 TaskUserRead & Execute
C:/Windows/System32/cmd.exeIIS_USERRead & Execute
 IIS_SERVICERead & Execute
 TaskUserRead & Execute

 

Q: How do I reset the default permissions and user rights for IIS?
A
: http://support.microsoft.com/kb/812614

 

Q: How do I repair my Cacti database?
A: Run the following from the command prompt:

  • mysqlcheck --auto-repair --databases cacti
    OR
  • php <cactipath>/cli/repair_database.php

Q: I'm getting errors with something like: Warning: fgets(): supplied argument is not a valid stream resource: <filename>
A: 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 up above in the installation guide on what NTFS permissions need to be set.

Q: How do I configure Microsoft SNMP?
A: Read HOW TO: Configure the Simple Network Management Protocol (SNMP) Service in Windows Server 2003

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值