Install Cacti On Windows 7

Posted on by admin

Cacti tool is an open source web based network monitoring and system monitoring graphing solution for IT business. Cacti enables a user to poll services at regular intervals to create graphs on resulting data using RRDtool. Generally, it is used to graph time-series data of metrics such as network bandwidth utilization, CPU load, running processes, disk space etc.

  1. Install Cacti Di Windows 7
  2. Install Cacti On Ubuntu 16

In this how-to we are going to show you how to install and setup complete network monitoring application called Cacti using Net-SNMP tool on RHEL 7.x/6.x/5.x, CentOS 7.x/6.x/5.x and Fedora 24-12 systems using YUM and DNF (Fedora 23 onwards) package manager tool.

From Cacti, go to Settings→Paths and verify/udate your paths to point to the correct locations. Recommended examples are posted below. If you plan on using Spine, then it is very important that all paths include forward slashes instead of backslashes. Cacti --- Install Cacti 0.8.8b by YUM on CentOS 7.x. I want to realize the Hyper-V new function in Windows Server 2012 so that will build a lab in virtualization. Installing Under Windows. Software Components Required (Optional) Apache> - This software is optional if running Windows Internet Information Server.

Cacti Required Packages

The Cacti required following packages to be installed on your Linux operating systems like RHEL / CentOS / Fedora.

  1. Apache : A Web server to display network graphs created by PHP and RRDTool.
  2. MySQL : A Database server to store cacti information.
  3. PHP : A script module to create graphs using RRDTool.
  4. PHP-SNMP : A PHP extension for SNMP to access data.
  5. NET-SNMP : A SNMP (Simple Network Management Protocol) is used to manage network.
  6. RRDTool : A database tool to manage and retrieve time series data like CPU load, Network Bandwidth etc.

Installing Cacti Required Packages on RHEL / CentOS / Fedora

First, we need to install following dependency packages one-by-one using YUM package manager tool.

Install Apache

Apache Web Server Installation

Install MySQL

MariaDB is a community-developed fork of the MySQL database project, and provides a replacement for MySQL. Previously the official supported database was MySQl under RHEL/CentOS 6.x/5.x and Fedora.

Recently, RedHat makes a new transaction from MySQl to MariaDB, as MariaDB is the default implementation of MySQL in RHEL/CentOS 7.x and Fedora 19 onwards..

Installation of MariaDB Database

Install PHP

Install PHP-SNMP

SNMP Installation

Install NET-SNMP

Install RRDTool

Install Rrdtool

Staring Apache, MySQL and SNMP Services

Once you’ve installed all the required software’s for Cacti installation, lets start them one-by-one using following commands.

On RHEL/CentOS 6.x/5.x and Fedora 18-12
On RHEL/CentOS 7.x and Fedora 19 Onwards

Start Services Using systemctl

Install Cacti Di Windows 7

Configure System Start-up Links

Configuring Apache, MySQL and SNMP Services to start on boot.

On RHEL/CentOS 6.x/5.x and Fedora 18-12
On RHEL/CentOS 7.x and Fedora 19 Onwards

Enable Services at Boot Using systemctl

Install Cacti on RHEL / CentOS / Fedora

Here, you need to install and enable EPEL Repository. Once you’ve enabled repository, type the following command to install Cacti application.

Sample Output:

Configuring MySQL Server for Cacti Installation

We need to configure MySQL for Cacti, to do this we need to set password for our newly installed MySQL server and then we will create Cacti database with user Cacti. If you’re MySQL is already password protected, then don’t need to set it again.

Set MySQL Password

To set new password for MySQL server, use the following command. (Note : This is for new MySQL installation only).

Create MySQL Cacti Database

Login into MySQL server with newly created password and create Cacti database with user Cacti and set the password for it.

On RHEL/CentOS 6.x/5.x and Fedora 18-12
On RHEL/CentOS 7.x and Fedora 19 Onwards

Install Cacti Tables to MySQL

Find out the database file path using RPM command, to install cacti tables into newly created Cacti database, use the following command.

Sample Output:

Now we’ve of the location of Cacti.sql file, type the following command to install tables, here you need to type the Cacti user password.

Cacti system monitoring windows 10

Configure MySQL settings for Cacti

Open the file called /etc/cacti/db.php with any editor.

Make the following changes and save the file. Make sure you set password correctly.

Configuring Firewall for Cacti

On RHEL/CentOS 6.x/5.x and Fedora 18-12
On RHEL/CentOS 7.x and Fedora 19 Onwards

Configuring Apache Server for Cacti Installation

Open file called /etc/httpd/conf.d/cacti.conf with your choice of editor.

You need to enabled access to Cacti application for your local network or per IP level. For example we've enabled access to our local LAN network 172.16.16.0/20. In your case, it would be different.

In latest version of Apache (ex: Apache 2.4), you may need to change according to the following settings.

Finally, restart the Apache service.

Setting Cron for Cacti

Open file /etc/cron.d/cacti.

Uncomment the following line. The poller.php script runs every 5mins and collects data of known host which is used by Cacti application to display graphs.

Running Cacti Installer Setup

Finally, Cacti is ready, just go to http://YOUR-IP-HERE/cacti/ & follow the installer instruction through the following screens. Click Next button.

Please choose installation Type as 'New Install'.

Select Cacti New Install

Make sure all the following values are correct before continuing. Click Finish button.

Cacti Login Screen, enter username as admin and password as admin.

Cacti Login Screen

Once you've entered username and password, it will ask you to enter a new password for cacti.

Cacti Console Screen.

Cacti Console Screen

How to Create New Graphs

To create graphs, Click on New Graphs --> Select Host --> Select SNMP - Interface Statistics and Select a graph type In/Out Bits. Click on Create button. Please refer screen below.

Cacti Monitoring Graphs

For more information and usage please visit the Cacti Page.

Share

Cacti functions with any web server which utilizes PHP and MySQL. It's up to the system admin to utilize Microsoft IIS, Apache, or something else.

Microsoft IIS

Install

Configure

Follow:

After following the above guides:

IIS6 has the IIS_WPG user account. IIS7 it's called IIS_IUSRS

  • Give the COMPUTERNAMEIUSR_ and COMPUTERNAMEIIS_WPG users Read & Execute permissions to the file C:Windowssystem32cmd.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 vulnerability in Cacti's code could exploit cmd.exe and not all sites on the IIS server.
    • Right click on cmd.exe and select Properties.
    • Click on the Security tab.
    • Select the IUSR_ account
    • Click on Read & Execute in the Permissions box.
    • Repeat for the IIS_WPG user.
    • Click OK.
  • Both IUSR_ and IIS_WPG users will also need read permissions on C:Inetpubwwwrootcacti and its subfolders.
    • Right click on the folder C:Inetpubwwwrootcacti and select Properties.
    • Click on the Security tab.
    • Click on Add... under the group or user names section.
    • Type in IUSR_ COMPUTERNAME or click Advanced... and Find Now. Repeat for the IIS_WPG account.
    • Click OK to close the select users or groups window.
    • Select the IUSR_ COMPUTERNAME from the list.
    • Select Read & Execute from the Permissions box.
    • Repeat for the IIS_WPG account.
    • At the bottom of the Security tab, click on Advanced....
    • In the Permissions tab, click on Replace permissions entries on all child objects with entries shown here that apply to child objects.
    • Click OK.
    • Click Yes to the Security warning dialog box.
    • Click OK to close the properties window.
  • Give the IUSR_ and IIS_WPG users modify permissions to the folders C:Inetpubwwwrootcactilog and C:Inetpubwwwrootcactirra.
  • 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:
  • Install WOFF mimetypes for TrueType Fonts:

Apache

Make sure to stop the IIS web services before proceeding with the Apache installation or make sure Apache is configured on an alternate port.

Install

  • Download the latest version from Apache Lounge.
  • Make sure to read the Windows specific notes for other Windows tips.
  • Extract the ZIP file to C:Apache24
    • Edit Apache24confhttpd.conf
      • Set ServerRoot
      • Set ServerName
  • Manually run httpd.exe at a command prompt to check for errors.
  • Once error free, execute httpd.exe -k install
  • Download the latest version of PHP 7.0 from http://windows.php.net.
  • Extract the ZIP file to C:PHP
  • Add C:PHP to your Windows PATH environment variable.
    • The Windows path variable can be accessed via the Control Panel at: System Advanced Environment Variables
    • In the System Variables groupbox, find Path and click Edit and add: C:PHP
  • Add a new system variable called PHPRC. Its value should be: C:PHP
  • Add a new system variable called MIBDIRS. Its value should be: C:PHPExtrasmibs
  • Rename C:PHPphp.ini-production to C:PHPphp.ini
  • Find and then uncomment/modify the following lines in C:PHPphp.ini.
  • If using IIS, find, uncomment or add the following lines in C:PHPphp.ini
  • 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.
  • Verify PHP is functional by running the following at the command prompt: php -mIf messages with, Cannot find module are appearing, then there is something wrong with the MIBDIRS variable or missing mib file(s) in the PHPExtrasmib folder.
Install cacti on ubuntu 16

Configure Permissions

  • Change NTFS permissions on C:PHPUploadtemp and C:PHPSession to grant Modify rights to the IUSR_ and IIS_WPG users for only files in the directory.
  • Give the user who will be running the scheduled task, Modify rights to: c:phpextrasmibs.index

MySQL 5.6 / 5.7

  • Download the latest Generally Available MSI Installer from MySQL.com.
  • Launch the MSI
    • Agree to the license
    • Setup Type - Select Server only
    • Click Execute and wait until the installation has completed.
  • Click Next to begin the Product Configuration
  • Type and Networking Page:
    • Config Type: Server Machine
    • Connectivity: Leave the defaults selected (TCP, Port 3306, Open Firewall port for network access)
    • Enable Show Advanced Options
    • Click Next.
  • Accounts and Roles Page:
    • Specify a root password
    • Skip the User Accounts section
    • Click Next.
  • Windows Service Page
    • Leave all defaults enabled
    • Click Next.
  • Plugins and Extensions
    • Leave all defaults disabled
    • Click Next.
  • Advanced Options
    • Enable General Log
    • Enable Slow Query Log
    • Click Next.
  • Apply Server Configuration page
    • Click Execute.
    • Validate all steps are green and were successful.
    • Click Finish
  • Click Next through the remaining screens.

Install TimeZone Database

  • Download TimeZone (POSIX standard) database from: http://dev.mysql.com/downloads/timezones.html
  • Extract file
  • Import:c:> mysql --user=root --password mysql < C:downloadstimezone_posix.sql
  • Validate it works. The two queries below should return the same result in the form of central US time 2007-03-11 01:00:00

Install Cacti Database

  • Create the MySQL database:c:> mysqladmin --user=root --password create cacti
  • Import the default Cacti database:c:> mysql --user=root --password cacti < C:Inetpubwwwrootcacticacti.sql

If you get any errors during this phase, you likely have sql-strict mode enabled or something else misconfigured in my.ini!

  • Create a MySQL username and password for Cacti.

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.

Cacti system monitoring windows 10
  • Download from net-snmp.sourceforge.net
  • Run the installer:
    • Select the Net-SNMP agent service With Windows Extension DLL Support
    • Uncheck Net-SNMP Trap Service
    • Uncheck Perl SNMP Modules
    • Select Encryption support
    • Specify Destination Folder: C:Net-SNMP

Validate

  • From a command prompt run:

C:>snmpwalk

If there are no errors, it's properly installed.

  • Download the latest version from Github or www.cacti.net
  • Extract the ZIP file to the root of your web server directory:
    • IIS: C:Inetpubwwwrootcacti
    • Apache: C:Apache24htdocscacti

Configure Cacti

  • Open a web browser to http://localhost/cacti/
  • Follow the Installation Wizard

Install Cacti On Ubuntu 16

Configure Scheduled Task for Poller

You are going to need to schedule a task while logged on as an Administrator. This task is required for the Poller to run every 5 minutes. Make sure the Task Scheduler service is started and follow the steps below to begin.

  • Open Task Scheduler
  • Create a new Task
  • General Tab
    • Name: Cacti Poller
    • Security Options:
      • Specify the user/service account the task will run under.
      • Select Run whether user is logged on or not
  • Triggers Tab
    • Create a new trigger.
    • Select Daily
    • Reoccur every: 1 days
    • Repeat Task every: 5 minutes for a duration of Indefinitely
    • Select Enabled
    • Click OK
  • Actions Tab
    • Create a new action.
    • Program: C:PHPphp.exe
    • Argument: C:cacti_web_rootpoller.php
    • Start In: C:cacti_web_root
  • Conditions & Settings Tabs
    • Configure per your IT standards.
  • Click OK to create the Task.

Spine is a high speed poller replacement for cmd.php. It is almost 100% compatible with the legacy cmd.php processor and provides much more flexibility, speed and concurrency than cmd.php

Often, the latest compiled binaries of Spine can be found here: http://www.cacti.net/downloads/packages/Windows/. Alternatively, you can compile Spine with Cygwin yourself. Refer to the documentation https://github.com/Cacti/spine/blob/develop/README.md