Is very important have a good tool to monitor our devices in a networking. Cacti do this and very well. Cacti offers graphs using rrdtool to monitor the load average, ping latency, disk space and other relevant information over SNMP protocol. SNMP use the UDP port 161 for read and 162 UDP for trap, and use a hierarchial  database named MIB (Management Information Base). MIB is a collection of objects and variables that stores information about an agent.

Image

In our scenario we’ll monitor two servers the NMS server and we’ll add another one to our network.

NMS SERVER CONFIG

– Install mysql, php, httpd, snmpd and cron:

# yum install mysql mysql-server httpd php-mysql php-snmp net-snmp net-snmp-utils cronie

– Configure EPEL repositories:

# rpm -ivh http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-5.noarch.rpm
# rpm --import https://fedoraproject.org/static/217521F6.txt
# yum repolist

Image

– Auto start services:

# service mysqld start
# service http start
# service snmpd start
# service crond start
# chkconfig --levels 235 httpd on
# chkconfig --levels 235 snmpd on
# chkconfig --levels 235 mysqld on
# chkconfig --levels 235 crond on

– Install cacti:

# yum install rrdtool cacti

– Database config:

# mysql -u root
mysql> create database cacti;
mysql> grant all on cacti.* to 'cacti'@'localhost' identified by 'cacti';
mysql> quit;
mysql -u root cacti < /usr/share/doc/cacti-0.8.7i/cacti.sql&#91;/sourcecode&#93;

- cron poller.php:
&#91;sourcecode lang="BASH"&#93;# vi /etc/cron.d/cacti
*/5 * * * * cacti php /usr/share/cacti/poller.php > /dev/null 2>&1

– web files:

# chown -R cacti:root /usr/share/cacti
# vi /usr/share/cacti/include/config.php

Image

# vi /etc/httpd/conf.d/cacti.config

Image

– Iptables rules for web access:

# vi /etc/sysconfig/iptables

Image

# service iptables restart

default user/password: admin // admin

Access: http://ipserver/cacti

check all the tools are installed in our system before install cacti:

– Create graphs:
Management> Devices > device > Add

Image
Create > new graphs

Image

– SNMP Configuation (server client):

# yum nstall net-snmp net-snmp-utils
# chkconfig --levels 235 snmpd on
# vi /etc/snmp/snmpd.conf

Image

# service snmpd start
# vi /etc/sysconfig/iptables

Image

# service iptables restart

check we can collect information about this server:

# snmpwalk -v 2c -c public 192.168.1.58

– Add host cacti:
Management > Devices > Add

Create > New Graphs

Management > Graph Trees > Default Tree > Add

Image

– Section graphs:

Image

Image

Install and configure cacti
Tagged on:                 

3 thoughts on “Install and configure cacti

  • April 17, 2013 at 08:48
    Permalink

    i have follow you all step same to same as posted by you but i am unable to load cacti web page

    CACTI – Blank Page / unable to load

    please reply in my email with solution

    thanks in advanced

    Reply
  • June 27, 2013 at 08:21
    Permalink

    Hello, Ivan!

    Could you tell why wouldn’t my Cacti be able to determine the status of CENTOS machine? Did everything like you said, but still getting Unknown value in the Status column (@Management->Devices) and the RTT stays 0 all the time.

    Regards,
    Alex

    Reply
  • September 27, 2013 at 02:46
    Permalink

    I think need to restart the httpd service before or after iptables change. I also facing that problem. But after restarting the httpd, it is ok.

    Reply

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Follow

Get every new post delivered to your Inbox

Join other followers: