You are on page 1of 11

12/8/2014 Install and configure cacti | root@opentodo#

http://opentodo.net/2012/02/install-and-configure-cacti/ 1/11
root@opentodo#
GNU/Linux and Unix notes RSS - Posts
Install and configure cacti
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.
In our scenario we’ll monitor two servers the NMS server and we’ll add
another one to our network.
NMS SERVER CONFIG
Categories
Backup
Clustering
Database
DNS
GNU/Linux
Kernel
LDAP
Mail
Monitoring
Networking
Search

About the author Contact me
12/8/2014 Install and configure cacti | root@opentodo#
http://opentodo.net/2012/02/install-and-configure-cacti/ 2/11
- Install mysql, php, httpd, snmpd and cron:
- Configure EPEL repositories:
- Auto start services:
- Install cacti:
- Database config:
- cron poller.php:
- web files:
Performance
Scripting
Security
Storage
Unix
Virtualization
Web
Tags
AAA apache2 backup bandwidth
barnyard2 base bind bind9 bind9 logging
bindgraph brute force attacks cacti
centos centos 6 check compile
debian freebsd freeradius
galera github heartbeat
iptables ldap linux lvm make
Monitoring multi-master
mysql nagios named NAT
networking nginx perl
postfix relay scripts snmp
snort ssl tcp tls XenServer
Github
opentodonet
Ivan Mora Pérez
Barcelona
14
Public Repos
1
Public Gists
6
Followers
Follow @ivanimp91
1 # yum install mysql mysql-server httpd php-mysql
php-snmp net-snmp net-snmp-utils cronie
1
2
3
# 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
1
2
3
4
5
6
7
8
# 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
1 # yum install rrdtool cacti
1
2
3
4
5
# 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
1
2
# vi /etc/cron.d/cacti
*/5 * * * * cacti php /usr/share/cacti/poller.php
> /dev/null 2>&1
12/8/2014 Install and configure cacti | root@opentodo#
http://opentodo.net/2012/02/install-and-configure-cacti/ 3/11
- Iptables rules for web access:
default user/password: admin // admin
Access: http://ipserver/cacti
Planet SysAdmin
RISKS Digest: Cybersecurity as
Realpolitik: Black Hat keynote
August 12, 2014
Chris Siebenmann: Copying GPT
partition tables from disk to disk
August 11, 2014
Ben's Practical Admin Blog: Going
Mobile with HP August 11, 2014
LinuxPlanet Blogs
Taking input from user using
whiptail August 10, 2014 Tux
Think
Bad Voltage Season 1 Episode 22:
Oval Ted Bag August 7, 2014
jeremy
RHEL 7 / CentOS 7 : Recovering /
Reset Root Password August 6,
2014 Tejas Barot
1
2
# chown -R cacti:root /usr/share/cacti
# vi /usr/share/cacti/include/config.php
1 # vi /etc/httpd/conf.d/cacti.config
1 # vi /etc/sysconfig/iptables
1 # service iptables restart
12/8/2014 Install and configure cacti | root@opentodo#
http://opentodo.net/2012/02/install-and-configure-cacti/ 4/11
check all the tools are installed in our system before install cacti:
- Create graphs:
Management> Devices > device > Add
12/8/2014 Install and configure cacti | root@opentodo#
http://opentodo.net/2012/02/install-and-configure-cacti/ 5/11
Create > new graphs
- SNMP Configuation (server client):
1
2
3
# yum nstall net-snmp net-snmp-utils
# chkconfig --levels 235 snmpd on
# vi /etc/snmp/snmpd.conf
12/8/2014 Install and configure cacti | root@opentodo#
http://opentodo.net/2012/02/install-and-configure-cacti/ 6/11
check we can collect information about this server:
1
2
# service snmpd start
# vi /etc/sysconfig/iptables
1 # service iptables restart
1 # snmpwalk -v 2c -c public 192.168.1.58
12/8/2014 Install and configure cacti | root@opentodo#
http://opentodo.net/2012/02/install-and-configure-cacti/ 7/11
- Add host cacti:
Management > Devices > Add
Create > New Graphs
Management > Graph Trees > Default Tree > Add
- Section graphs:
12/8/2014 Install and configure cacti | root@opentodo#
http://opentodo.net/2012/02/install-and-configure-cacti/ 8/11
Tweet 0
0 Share
0

Ivan Mora Pérez

February 26, 2012

GNU/Linux, Monitoring, Networking

3 Comments
← ProFTPD + MySQL
Configure an antispam gateway (part I) →
Google+
Ivan Mora Pérez
Related Posts
Monitoring system log files with Swatch
Configuring Nagios (Part I)
Configure NAT in Linux
Blocking Port Scan Attacks with psad
Tagged on: cacti centos graphs Monitoring snmp
3 thoughts on “Install and configure cacti”
0 Me gusta
Seguir 111

jaswant

April 17, 2013 at 08:48

Permalink
12/8/2014 Install and configure cacti | root@opentodo#
http://opentodo.net/2012/02/install-and-configure-cacti/ 9/11

Reply

Reply

Reply
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
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
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.
Leave a Reply

Alex

June 27, 2013 at 08:21

Permalink

Phyo

September 27, 2013 at 02:46

Permalink
12/8/2014 Install and configure cacti | root@opentodo#
http://opentodo.net/2012/02/install-and-configure-cacti/ 10/11
Privacy & Terms
Your email address will not be published. Required fields are marked *
Name *
Email *
Website
Comment
You may use these HTML tags and attributes: <a
href="" title=""> <abbr title=""> <acronym title=""> <b>
<blockquote cite=""> <cite> <code> <del datetime=""> <em> <i>
<q cite=""> <strike> <strong>
Post Comment
Notify me of follow-up comments by email.
Type the text
12/8/2014 Install and configure cacti | root@opentodo#
http://opentodo.net/2012/02/install-and-configure-cacti/ 11/11
Notify me of new posts by email.
Copyright © 2014 root@opentodo# Theme by: ThemeGrill
Powered by: WordPress
Follow
Follow root@opentodo#
Get every new post delivered to your Inbox
Join other followers:
Email Address
Sign me up!