SlideShare une entreprise Scribd logo
1  sur  21
Télécharger pour lire hors ligne
How To Install and Configure Cacti on Linux
i | P a g e
Contents
Overview.......................................................................................................................................................1
Applies To......................................................................................................................................................1
Slideshare Documentation – Screenshots ....................................................................................................1
Cacti NNM – Pre-requisites...........................................................................................................................1
Query – Packages Installed ...........................................................................................................................1
Step 1: Install Packages.................................................................................................................................2
Install Apache2..........................................................................................................................................2
Install MySQL ............................................................................................................................................3
Install Net-SNMP.......................................................................................................................................4
Install PHP .................................................................................................................................................5
Install PHP SNMP ..................................................................................................................................6
List PHP – Configuration Files Loaded.......................................................................................................7
Install RRDTool..........................................................................................................................................7
Step 2: Configure Apache Service (HTTPD)...................................................................................................7
Apache Service - Status.............................................................................................................................7
Apache Service - OS Startup Status...........................................................................................................8
Apache Service – Modify OS Startup Status .............................................................................................8
Starting Apache Webserver......................................................................................................................8
Configure Apache - ServerName...............................................................................................................8
Step 3: Configure MySQL Service (mysqld)...................................................................................................9
MySQL Service - Status .............................................................................................................................9
MySQL Service - OS Startup Status ...........................................................................................................9
MySQL Service – Modify OS Startup Status..............................................................................................9
Setup MySQL Database Server .................................................................................................................9
Connect MySQL Database...................................................................................................................10
Set MySQL root password...................................................................................................................10
MySQL Login – Root User....................................................................................................................10
Step 4: Configure SNMP Service .................................................................................................................11
Default SNMP Configuration...................................................................................................................11
Counting SNMP Line – Default Config.................................................................................................11
Minimal SNMP Configuration .................................................................................................................11
How To Install and Configure Cacti on Linux
ii | P a g e
Create SNMP Configuration File .........................................................................................................11
Test SNMP Configuration....................................................................................................................11
Counting SNMP Line – Customized Config..........................................................................................11
SNMP Service - Status.............................................................................................................................12
SNMP Service - OS Startup Status...........................................................................................................12
SNMP Service – Modify OS Startup Status..............................................................................................12
Starting SNMP service.............................................................................................................................12
Step 4: Install RRDTool Package..................................................................................................................12
Step 5: Install Cacti Package........................................................................................................................13
Configure MySQL for Cacti......................................................................................................................13
Create and Configure cacti User .........................................................................................................13
Test MySQL connection – Cacti User ..................................................................................................13
Find Cacti SQL Script ...........................................................................................................................14
Import Cacti Database Table Script.....................................................................................................14
Verify Cacti Database Import Status...................................................................................................14
Configure cacti DB Connection Parameters........................................................................................14
Edit DB Connection Parameters..........................................................................................................14
Configure Apache for Cacti .................................................................................................................15
Restart httpd Service ..........................................................................................................................15
Set Cron job for cacti pooling..............................................................................................................16
Step 6: Cacti Monitoring Setup...................................................................................................................16
Tool Information.....................................................................................................................................16
Identify SNMP & RRDTool Versions....................................................................................................17
Launch Cacti Application.........................................................................................................................17
App Step 1 – Welcome screen ............................................................................................................17
App Step 2 – Installation Type ............................................................................................................17
App Step 3 – Executables Path............................................................................................................18
App Step 4 – First Login.......................................................................................................................19
App Step 5 – Reset Password (admin) ................................................................................................19
App Step 6 – Create Graphs................................................................................................................19
How To Install and Configure Cacti
1 | P a g e
Overview
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 status, performance of different devices viz., system, network,
processes, etc. At regular intervals to create graphs on resulting data using RRDtool. By default data is
pooled every 5 minutes.
Applies To
CentOS 6.x / RHEL 6.x
Slideshare Documentation – Screenshots
This documentation is available with screenshots at http://slideshare.net
Cacti NNM – Pre-requisites
Few of the major pre-requisites are;
Apache A Web server to display network graphs created by PHP and RRDTool.
MySQL A Database server to store cacti information.
PHP A script module to create graphs using RRDTool.
PHP-SNMP A PHP extension for SNMP to access data.
NET-SNMP A SNMP (Simple Network Management Protocol) is used to manage
network.
RRDTool A database tool to manage and retrieve time series data like CPU load,
Network Bandwidth etc.
Query – Packages Installed
rpm -qa | grep ^httpd*
rpm -qa | grep ^mysql*
rpm -qa | grep ^net*
rpm -qa | grep ^php-*
rpm -qa | grep ^rrd*
How To Install and Configure Cacti
2 | P a g e
Step 1: Install Packages
Apache2 yum install httpd httpd-devel
MySQL yum install mysql mysql-server
PHP yum install php-mysql php-pear php-common php-gd php-devel php php-mbstring php-cli
SNMP yum install net-snmp-utils php-snmp net-snmp-libs php-pear-Net-SMTP
RRD yum install rrdtool
Install Apache2
Install the Apache2 package using yum and dependent packages.
yum install httpd httpd-devel
How To Install and Configure Cacti
3 | P a g e
Install MySQL
Install the MySQL package using yum and dependent packages.
yum install mysql mysql-server
How To Install and Configure Cacti
4 | P a g e
Install Net-SNMP
Install the Net-SNMP package using yum and dependent packages.
yum install net-snmp-utils php-snmp net-snmp-libs php-pear-NET-SMTP
How To Install and Configure Cacti
5 | P a g e
Install PHP
Install the PHP package using yum and dependent packages.
yum install php-mysql php-pear php-common php-gd php-devel php php-mbstring php-cli
How To Install and Configure Cacti
6 | P a g e
Install PHP SNMP
To install php snmp packages using yum and dependent packages.
yum install net-snmp-utils php-snmp net-snmp-libs php-pear-NET-SMTP
How To Install and Configure Cacti
7 | P a g e
List PHP – Configuration Files Loaded
After installation, you can list the php configurations loaded, execute the command “php --ini”"
Output:
Install RRDTool
Install the RRDTool package using yum and dependent packages.
yum install rrdtool
Step 2: Configure Apache Service (HTTPD)
Apache Service - Status
Check the status of httpd, execute the command
service httpd status
Output:
httpdd service status:
httpd is stopped
How To Install and Configure Cacti
8 | P a g e
Apache Service - OS Startup Status
Check the OS startup status of apache web server service, execute the command
chkconfig httpd --list
Output:
httpd service start-up setting:
httpd 0:off 1:off 2:off 3:off 4:off 5:off 6:off
Apache Service – Modify OS Startup Status
Modify OS startup status of apache web server; service to auto-start at levels (3, 4, 5) execute the
command
chkconfig httpd on
Output:
httpd service start-up setting:
httpd 0:off 1:off 2:on 3:on 4:on 5:on 6:off
Starting Apache Webserver
service httpd start
Output:
Starting httpd: httpd: Could not reliably determine the server's fully qualified domain name, using
192.168.2.92 for ServerName
[ OK ]
Configure Apache - ServerName
vi /etc/httpd/conf/httpd.conf
Find and replace attribute value of “ServerName” to respective hostname or FQDN of the host and restart
httpd service.
Example:
ServerName etpl01nm01pr.ftech.com
service httpd restart
Output:
Stopping httpd: [ OK ]
Starting httpd: [ OK ]
After restarting httpd service, access in browser access the URL http://vcp01tst02pr.ftech.com/ or
http://<IP Address> default apache page should be displayed.
How To Install and Configure Cacti
9 | P a g e
Step 3: Configure MySQL Service (mysqld)
MySQL Service - Status
Check the status of mysql database, execute the command
service mysqld status
Output:
mysqld service status:
mysqld is stopped
MySQL Service - OS Startup Status
Check the OS startup status of mysql database service, execute the command
chkconfig mysqld --list
Output:
mysqld service start-up setting:
mysqld 0:off 1:off 2:off 3:off 4:off 5:off 6:off
MySQL Service – Modify OS Startup Status
Modify OS startup of MySQL Database server; service to auto-start at levels (3, 4, 5) execute the command
chkconfig --levels 345 mysqld on
Output:
mysqld service start-up setting:
mysqld 0:off 1:off 2:off 3:on 4:on 5:on 6:off
Setup MySQL Database Server
When you start the mysqld daemon for the first time, default database would be created and further
hardening can be considered later on.
service mysqld start
Output:
mysqld service starting:
Initializing MySQL database: Installing MySQL system tables...
OK
Filling help tables...
OK
To start mysqld at boot time you have to copy
support-files/mysql.server to the right place for your system
How To Install and Configure Cacti
10 | P a g e
PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
To do so, start the server, then issue the following commands:
/usr/bin/mysqladmin -u root password 'new-password'
/usr/bin/mysqladmin -u root -h vcp01tst02pr password 'new-password'
Alternatively you can run:
/usr/bin/mysql_secure_installation
which will also give you the option of removing the test
databases and anonymous user created by default. This is
strongly recommended for production servers.
See the manual for more instructions.
You can start the MySQL daemon with:
cd /usr ; /usr/bin/mysqld_safe &
You can test the MySQL daemon with mysql-test-run.pl
cd /usr/mysql-test ; perl mysql-test-run.pl
Please report any problems with the /usr/bin/mysqlbug script!
[ OK ]
Starting mysqld: [ OK ]
Connect MySQL Database
By default no password is set, you will be logged into mysql prompt. You can test by executing command;
since we have already configured with root password. Without passing password to mysql command it
will fail to connect.
mysql
mysql> q
Set MySQL root password
To set MySQL root user password; execute the command
/usr/bin/mysqladmin -u root -h localhost password 'your-new-password'
or
/usr/bin/mysqladmin -u root -h vcp01tst02pr password 'your-new-password'
MySQL Login – Root User
mysql -uroot -proot123$
mysql> q
How To Install and Configure Cacti
11 | P a g e
Step 4: Configure SNMP Service
Default SNMP Configuration
No configuration changes are needed “/etc/snmp/snmpd.conf” file; to test execute the command
snmpwalk -v 1 -c public -O e 127.0.0.1 | head -1
Output:
SNMPv2-MIB::sysDescr.0 = STRING: Linux vcp01tst02pr 2.6.32-358.23.2.el6.x86_64 #1 SMP Wed
Oct 16 18:37:12 UTC 2013 x86_64
Counting SNMP Line – Default Config
snmpwalk -v 1 -c public -O e 127.0.0.1 | wc -l
Output:
33
Minimal SNMP Configuration
Optionally, if you would like to customize or minimal configuration;
mv /etc/snmp/snmpd.conf /etc/snmp/snmpd.conf.original
Create SNMP Configuration File
vi /etc/snmp/snmpd.conf
Add the below lines;
rocommunity public
syslocation "VCP, Bangalore"
syscontact mvcp@domain.com
Test SNMP Configuration
snmpwalk -v 1 -c public -O e 127.0.0.1 | head -1
Output:
SNMPv2-MIB::sysDescr.0 = STRING: Linux vcp01tst02pr 2.6.32-358.23.2.el6.x86_64 #1 SMP Wed
Oct 16 18:37:12 UTC 2013 x86_64
Counting SNMP Line – Customized Config
snmpwalk -v 1 -c public -O e 127.0.0.1 | wc -l
Output:
3304
How To Install and Configure Cacti
12 | P a g e
SNMP Service - Status
Check the status of snmp service, execute the command
service snmpd status
Output:
snmpd service status:
snmpd is stopped
SNMP Service - OS Startup Status
Check the OS startup status of apache web server service, execute the command
chkconfig snmpd --list
Output:
snmpd service start-up setting:
snmpd 0:off 1:off 2:off 3:off 4:off 5:off 6:off
SNMP Service – Modify OS Startup Status
Modify OS startup status of snmp; service to auto-start at levels (3, 4, 5) execute the command
chkconfig --levels 345 snmpd on
Output:
snmpd service start-up setting:
snmpd 0:off 1:off 2:on 3:on 4:on 5:on 6:off
Starting SNMP service
service snmpd start
Output:
snmpd service starting:
Starting snmpd: [ OK ]
Step 4: Install RRDTool Package
yum install rrdtool
How To Install and Configure Cacti
13 | P a g e
Step 5: Install Cacti Package
yum install cacti
Configure MySQL for Cacti
In order to cacti to work, configuration have to be done, the steps are listed below.
Create and Configure cacti User
mysql -uroot -proot123$
mysql> create database cacti;
mysql> use cacti;
mysql> grant all privileges on *.* to cacti@localhost identified by 'cacti123$';
mysql> grant all privileges on *.* to cacti@vcp01tst02pr identified by 'cacti123$';
mysql> flush privileges;
mysql> q
Test MySQL connection – Cacti User
mysql -ucacti -pcacti123$
mysql>
mysql> q
How To Install and Configure Cacti
14 | P a g e
Find Cacti SQL Script
rpm -ql cacti | grep "cacti.sql"
Output:
/usr/share/doc/cacti-0.8.8b/cacti.sql
Import Cacti Database Table Script
mysql -ucacti -pcacti123$ cacti < /usr/share/doc/cacti-0.8.8b/cacti.sql
Verify Cacti Database Import Status
mysql -ucacti -pcacti123$ -hlocalhost cacti
mysql> show tables;
Note: show tables; query should list 52 rows (tables).
Configure cacti DB Connection Parameters
To configure cacti application database connection parameters, update MySQL database connection
parameters settings in the file
vi /etc/cacti/db.php
Edit DB Connection Parameters
/* make sure these values reflect your actual database/host/user/password */
$database_type = "mysql";
$database_default = "cacti";
$database_hostname = "localhost";
$database_username = "cacti";
$database_password = "cacti123$";
$database_port = "3306";
$database_ssl = false;
How To Install and Configure Cacti
15 | P a g e
Configure Apache for Cacti
In order to access cacti on web, edit and append below configuration lines the in file
vi /etc/httpd/conf.d/cacti.conf
Sample Configuration snippet:
#
# Add cacti alias and point the directory where cacti is installed.
#
Alias /cacti /usr/share/cacti
#
# Add cacti access restrictions from specific IP range / subnet
#
<Directory /usr/share/cacti/>
Order Deny,Allow
Deny from all
Allow from 192.168.1.0/24
Allow from 192.168.2.0/24
</Directory>
Restart httpd Service
service httpd restart
Output:
Apache Service Restart:
Stopping httpd: [ OK ]
Starting httpd: [Fri Mar 18 21:15:23 2014] [warn] The Alias directive in
/etc/httpd/conf.d/cacti.conf at line 59 will probably never match because it overlaps an earlier
Alias.
[ OK ]
Note: In this case there are duplicate alias for “cacti”; so remove one of the aliases for defined
cacti, save and restart apache service.
How To Install and Configure Cacti
16 | P a g e
Set Cron job for cacti pooling
Cacti pools data every 5 minutes once, for pooling data cron job has be created, add the crontab entry as
per the below line.
crontab -e
*/5 * * * * cacti /usr/bin/php /usr/share/cacti/poller.php > /dev/null 2>&1
crontab -l
Note: data pooling is done via snmp; ensure SNMP is configured for the device / server that needs to be
monitored on cacti.
Step 6: Cacti Monitoring Setup
Before you launch Cacti monitoring application, make sure you have installed all the required packages
and their respective binaries exists.
For NET-SNMP & RRDTool identify the versions installed on the server, you can query for package
installed, check “App Step 3 - Executables Path” section in “Launching Cacti”.
This information is required while configuring cacti application.
Tool Information
Tool Binary Find Default Path
RRDTool Rrdtool which rrdtool /usr/bin/
PHP Php which php /usr/bin/
SNMP Walk snmpwalk which snmpwalk /usr/bin/
SNMP Get snmpget which snmpget /usr/bin/
SNMP Bulk Walk snmpbulkwalk which snmpbulkwalk /usr/bin/
SNMP Get Next snmpgetnext which snmpgetnext /usr/bin/
Cacti Logger cacti.log ls /usr/share/cacti/log /usr/share/cacti/log
How To Install and Configure Cacti
17 | P a g e
Identify SNMP & RRDTool Versions
SNMP Utility Version
rpm -qa | grep net-snmp
RRDTool Version
rpm -qa | grep rrdtool
Launch Cacti Application
To launch and configure cacti; in the browser access the URL http://<Your Cacti Host>/cacti/ or
http://<Cacti Host IP Address>/cacti/;
App Step 1 – Welcome screen
First run; initial setup screen; click on “Next” button.
App Step 2 – Installation Type
Choose the option whether the installation is a “New Install” or “upgrade”
How To Install and Configure Cacti
18 | P a g e
App Step 3 – Executables Path
From the “Tool Information” section the collated information should be validated.
How To Install and Configure Cacti
19 | P a g e
App Step 4 – First Login
In Login Screen, enter default username as “admin” and password as “admin”
App Step 5 – Reset Password (admin)
You need to reset the default password to a new password
App Step 6 – Create Graphs
Upon launching, click on “Create Graphs” and choose the host that you would like to get generate the
graphs.

Contenu connexe

Tendances

ネットワークエンジニアはどこでウデマエをみがくのか?
ネットワークエンジニアはどこでウデマエをみがくのか?ネットワークエンジニアはどこでウデマエをみがくのか?
ネットワークエンジニアはどこでウデマエをみがくのか?
Yuya Rin
 

Tendances (20)

SD-WAN導入の現場でみえてきたアレコレ
SD-WAN導入の現場でみえてきたアレコレSD-WAN導入の現場でみえてきたアレコレ
SD-WAN導入の現場でみえてきたアレコレ
 
02B_AWS IoT Core for LoRaWANのご紹介
02B_AWS IoT Core for LoRaWANのご紹介02B_AWS IoT Core for LoRaWANのご紹介
02B_AWS IoT Core for LoRaWANのご紹介
 
Geekなぺーじ ネットワーク技術者ではない方々向けIPv6セミナー2
Geekなぺーじ ネットワーク技術者ではない方々向けIPv6セミナー2Geekなぺーじ ネットワーク技術者ではない方々向けIPv6セミナー2
Geekなぺーじ ネットワーク技術者ではない方々向けIPv6セミナー2
 
OSC 2011 Hokkaido 自宅SAN友の会(後半)
OSC 2011 Hokkaido 自宅SAN友の会(後半)OSC 2011 Hokkaido 自宅SAN友の会(後半)
OSC 2011 Hokkaido 自宅SAN友の会(後半)
 
インフラチームのリモートワーク
インフラチームのリモートワークインフラチームのリモートワーク
インフラチームのリモートワーク
 
Consulによる運用自律化体験ハンズオンとConsul活用事例紹介
Consulによる運用自律化体験ハンズオンとConsul活用事例紹介Consulによる運用自律化体験ハンズオンとConsul活用事例紹介
Consulによる運用自律化体験ハンズオンとConsul活用事例紹介
 
ISPの向こう側、どうなってますか
ISPの向こう側、どうなってますかISPの向こう側、どうなってますか
ISPの向こう側、どうなってますか
 
[Node-RED] ファンクションノードのデバッグどうしてる?
[Node-RED] ファンクションノードのデバッグどうしてる?[Node-RED] ファンクションノードのデバッグどうしてる?
[Node-RED] ファンクションノードのデバッグどうしてる?
 
安定したネットワークを提供するためのラック内環境を考えてみる
安定したネットワークを提供するためのラック内環境を考えてみる安定したネットワークを提供するためのラック内環境を考えてみる
安定したネットワークを提供するためのラック内環境を考えてみる
 
「おうちクラウド」が今熱い!
「おうちクラウド」が今熱い!「おうちクラウド」が今熱い!
「おうちクラウド」が今熱い!
 
Wakamonog6 “ISPのネットワーク”って どんなネットワーク?
Wakamonog6 “ISPのネットワーク”って どんなネットワーク?Wakamonog6 “ISPのネットワーク”って どんなネットワーク?
Wakamonog6 “ISPのネットワーク”って どんなネットワーク?
 
Pycon2017 instagram keynote
Pycon2017 instagram keynotePycon2017 instagram keynote
Pycon2017 instagram keynote
 
Openstack
OpenstackOpenstack
Openstack
 
ネットワークエンジニアはどこでウデマエをみがくのか?
ネットワークエンジニアはどこでウデマエをみがくのか?ネットワークエンジニアはどこでウデマエをみがくのか?
ネットワークエンジニアはどこでウデマエをみがくのか?
 
C# でブロックチェーン実装
C# でブロックチェーン実装C# でブロックチェーン実装
C# でブロックチェーン実装
 
パケットキャプチャの勘どころ Ssmjp 201501
パケットキャプチャの勘どころ Ssmjp 201501パケットキャプチャの勘どころ Ssmjp 201501
パケットキャプチャの勘どころ Ssmjp 201501
 
StackStormを活用した運用自動化の実践
StackStormを活用した運用自動化の実践StackStormを活用した運用自動化の実践
StackStormを活用した運用自動化の実践
 
【Interop Tokyo 2016】 初心者でもわかるCisco SDNの概要
【Interop Tokyo 2016】 初心者でもわかるCisco SDNの概要【Interop Tokyo 2016】 初心者でもわかるCisco SDNの概要
【Interop Tokyo 2016】 初心者でもわかるCisco SDNの概要
 
あなたのところに専用線が届くまで
あなたのところに専用線が届くまであなたのところに専用線が届くまで
あなたのところに専用線が届くまで
 
IPv6 最新動向 〜世界共通語で最適化が進むインターネット〜
IPv6 最新動向 〜世界共通語で最適化が進むインターネット〜IPv6 最新動向 〜世界共通語で最適化が進むインターネット〜
IPv6 最新動向 〜世界共通語で最適化が進むインターネット〜
 

En vedette

En vedette (20)

How to Install Configure and Use sysstat utils on RHEL 7
How to Install Configure and Use sysstat utils on RHEL 7How to Install Configure and Use sysstat utils on RHEL 7
How to Install Configure and Use sysstat utils on RHEL 7
 
Install VMWare Tools CentOS 7
Install VMWare Tools CentOS 7Install VMWare Tools CentOS 7
Install VMWare Tools CentOS 7
 
How to Install MariaDB Server or MySQL Server on CentOS 7
How to Install MariaDB Server or MySQL Server on CentOS 7How to Install MariaDB Server or MySQL Server on CentOS 7
How to Install MariaDB Server or MySQL Server on CentOS 7
 
How To Create RDS Database for WordPress in AWS on RHEL 7 or CentOS 7
How To Create RDS Database for WordPress in AWS on RHEL 7 or CentOS 7How To Create RDS Database for WordPress in AWS on RHEL 7 or CentOS 7
How To Create RDS Database for WordPress in AWS on RHEL 7 or CentOS 7
 
How To Install OpenFire in CentOS 7
How To Install OpenFire in CentOS 7How To Install OpenFire in CentOS 7
How To Install OpenFire in CentOS 7
 
LSOF Command Usage on RHEL 7
LSOF Command Usage on RHEL 7LSOF Command Usage on RHEL 7
LSOF Command Usage on RHEL 7
 
Install and Configure WordPress in AWS on RHEL 7 or CentOS 7
Install and Configure WordPress in AWS on RHEL 7 or CentOS 7Install and Configure WordPress in AWS on RHEL 7 or CentOS 7
Install and Configure WordPress in AWS on RHEL 7 or CentOS 7
 
How To Add DVD ISO to YUM Repository in CentOS 6
How To Add DVD ISO to YUM Repository in CentOS 6How To Add DVD ISO to YUM Repository in CentOS 6
How To Add DVD ISO to YUM Repository in CentOS 6
 
How To Create EBS Snapshot and Restore EBS Snapshot – Linux Instance
How To Create EBS Snapshot and Restore EBS Snapshot – Linux InstanceHow To Create EBS Snapshot and Restore EBS Snapshot – Linux Instance
How To Create EBS Snapshot and Restore EBS Snapshot – Linux Instance
 
How To Connect Amazon AWS EC2 with Key Pair – Linux
How To Connect Amazon AWS EC2 with Key Pair – LinuxHow To Connect Amazon AWS EC2 with Key Pair – Linux
How To Connect Amazon AWS EC2 with Key Pair – Linux
 
How to Install and Configure AWS CLI on RHEL 7
How to Install and Configure AWS CLI on RHEL 7How to Install and Configure AWS CLI on RHEL 7
How to Install and Configure AWS CLI on RHEL 7
 
How To Configure VNC Server on CentOS 7
How To Configure VNC Server on CentOS 7How To Configure VNC Server on CentOS 7
How To Configure VNC Server on CentOS 7
 
TFTP Installation Configuration Guide
TFTP Installation Configuration GuideTFTP Installation Configuration Guide
TFTP Installation Configuration Guide
 
How To Audit Server Login and Shutdown or Reboot Activity
How To Audit Server Login and Shutdown or Reboot ActivityHow To Audit Server Login and Shutdown or Reboot Activity
How To Audit Server Login and Shutdown or Reboot Activity
 
How to install and configure firewall on ubuntu os
How to install and configure firewall on ubuntu osHow to install and configure firewall on ubuntu os
How to install and configure firewall on ubuntu os
 
File Space Usage Information and EMail Report - Shell Script
File Space Usage Information and EMail Report - Shell ScriptFile Space Usage Information and EMail Report - Shell Script
File Space Usage Information and EMail Report - Shell Script
 
Installation CentOS 6.3
Installation CentOS 6.3Installation CentOS 6.3
Installation CentOS 6.3
 
How To Configure Amazon EC2 Load Balancer
How To Configure Amazon EC2 Load BalancerHow To Configure Amazon EC2 Load Balancer
How To Configure Amazon EC2 Load Balancer
 
How to Configure Amazon AWS EC2 Elastic IP Address
How to Configure Amazon AWS EC2 Elastic IP AddressHow to Configure Amazon AWS EC2 Elastic IP Address
How to Configure Amazon AWS EC2 Elastic IP Address
 
Bash Script Disk Space Utilization Report and EMail
Bash Script Disk Space Utilization Report and EMailBash Script Disk Space Utilization Report and EMail
Bash Script Disk Space Utilization Report and EMail
 

Similaire à How to Install and Configure Cacti on Linux

WebHost Manager User Manual
WebHost Manager User ManualWebHost Manager User Manual
WebHost Manager User Manual
webhostingguy
 
WebHost Manager User Manual
WebHost Manager User ManualWebHost Manager User Manual
WebHost Manager User Manual
webhostingguy
 
Configuring and managing a red
Configuring and managing a redConfiguring and managing a red
Configuring and managing a red
zied01
 
Firewall and proxy servers howto
Firewall and proxy servers howtoFirewall and proxy servers howto
Firewall and proxy servers howto
Kumar
 
Maa wp sun_apps11i_db10g_r2-2
Maa wp sun_apps11i_db10g_r2-2Maa wp sun_apps11i_db10g_r2-2
Maa wp sun_apps11i_db10g_r2-2
Sal Marcus
 
Plesk 8.1 for Windows
Plesk 8.1 for WindowsPlesk 8.1 for Windows
Plesk 8.1 for Windows
webhostingguy
 
Plesk 8.1 for Windows
Plesk 8.1 for WindowsPlesk 8.1 for Windows
Plesk 8.1 for Windows
webhostingguy
 
Zend Server Ce Reference Manual V403
Zend Server Ce Reference Manual V403Zend Server Ce Reference Manual V403
Zend Server Ce Reference Manual V403
SMKF Plus Bani Saleh
 
Plesk 8.1 for Windows
Plesk 8.1 for WindowsPlesk 8.1 for Windows
Plesk 8.1 for Windows
webhostingguy
 

Similaire à How to Install and Configure Cacti on Linux (20)

WebHost Manager User Manual
WebHost Manager User ManualWebHost Manager User Manual
WebHost Manager User Manual
 
WebHost Manager User Manual
WebHost Manager User ManualWebHost Manager User Manual
WebHost Manager User Manual
 
Configuring and managing a red
Configuring and managing a redConfiguring and managing a red
Configuring and managing a red
 
Cluster administration rh
Cluster administration rhCluster administration rh
Cluster administration rh
 
Air cam ug
Air cam ugAir cam ug
Air cam ug
 
Eta nonfab-deploy-guide-2019oct
Eta nonfab-deploy-guide-2019octEta nonfab-deploy-guide-2019oct
Eta nonfab-deploy-guide-2019oct
 
UsersGuide
UsersGuideUsersGuide
UsersGuide
 
UsersGuide
UsersGuideUsersGuide
UsersGuide
 
Guia do usuario para interface web do at 8000 s
Guia do usuario para interface web do at 8000 sGuia do usuario para interface web do at 8000 s
Guia do usuario para interface web do at 8000 s
 
Firewall and proxy servers howto
Firewall and proxy servers howtoFirewall and proxy servers howto
Firewall and proxy servers howto
 
Presentation data center deployment guide
Presentation   data center deployment guidePresentation   data center deployment guide
Presentation data center deployment guide
 
Maa wp sun_apps11i_db10g_r2-2
Maa wp sun_apps11i_db10g_r2-2Maa wp sun_apps11i_db10g_r2-2
Maa wp sun_apps11i_db10g_r2-2
 
Maa wp sun_apps11i_db10g_r2-2
Maa wp sun_apps11i_db10g_r2-2Maa wp sun_apps11i_db10g_r2-2
Maa wp sun_apps11i_db10g_r2-2
 
Perceptive nolij web installation and upgrade guide 6.8.x
Perceptive nolij web installation and upgrade guide 6.8.xPerceptive nolij web installation and upgrade guide 6.8.x
Perceptive nolij web installation and upgrade guide 6.8.x
 
Cluster in linux
Cluster in linuxCluster in linux
Cluster in linux
 
Plesk 8.1 for Windows
Plesk 8.1 for WindowsPlesk 8.1 for Windows
Plesk 8.1 for Windows
 
Plesk 8.1 for Windows
Plesk 8.1 for WindowsPlesk 8.1 for Windows
Plesk 8.1 for Windows
 
Zend Server Ce Reference Manual V403
Zend Server Ce Reference Manual V403Zend Server Ce Reference Manual V403
Zend Server Ce Reference Manual V403
 
CONTINUOUS SYSTEMS, NONSTOP OPERATIONS WITH JUNOS
CONTINUOUS SYSTEMS, NONSTOP OPERATIONS WITH JUNOSCONTINUOUS SYSTEMS, NONSTOP OPERATIONS WITH JUNOS
CONTINUOUS SYSTEMS, NONSTOP OPERATIONS WITH JUNOS
 
Plesk 8.1 for Windows
Plesk 8.1 for WindowsPlesk 8.1 for Windows
Plesk 8.1 for Windows
 

Plus de VCP Muthukrishna

Plus de VCP Muthukrishna (20)

How to Fix Duplicate Packages in YUM on CentOS 7
How to Fix Duplicate Packages in YUM on CentOS 7How to Fix Duplicate Packages in YUM on CentOS 7
How to Fix Duplicate Packages in YUM on CentOS 7
 
How To Install and Configure GNome on CentOS 7
How To Install and Configure GNome on CentOS 7How To Install and Configure GNome on CentOS 7
How To Install and Configure GNome on CentOS 7
 
How To Connect to Active Directory User Validation
How To Connect to Active Directory User ValidationHow To Connect to Active Directory User Validation
How To Connect to Active Directory User Validation
 
How To Connect To Active Directory PowerShell
How To Connect To Active Directory PowerShellHow To Connect To Active Directory PowerShell
How To Connect To Active Directory PowerShell
 
How To List Files on Remote Server - PowerShell
How To List Files on Remote Server - PowerShellHow To List Files on Remote Server - PowerShell
How To List Files on Remote Server - PowerShell
 
How To List Files and Display In HTML Format
How To List Files and Display In HTML FormatHow To List Files and Display In HTML Format
How To List Files and Display In HTML Format
 
How To Check and Delete a File via PowerShell
How To Check and Delete a File via PowerShellHow To Check and Delete a File via PowerShell
How To Check and Delete a File via PowerShell
 
Zimbra Troubleshooting - Mails not being Delivered or Deferred or Connection ...
Zimbra Troubleshooting - Mails not being Delivered or Deferred or Connection ...Zimbra Troubleshooting - Mails not being Delivered or Deferred or Connection ...
Zimbra Troubleshooting - Mails not being Delivered or Deferred or Connection ...
 
How To Setup SSH Keys on CentOS 7
How To Setup SSH Keys on CentOS 7How To Setup SSH Keys on CentOS 7
How To Setup SSH Keys on CentOS 7
 
How To Install and Configure Open SSH Server on Ubuntu
How To Install and Configure Open SSH Server on UbuntuHow To Install and Configure Open SSH Server on Ubuntu
How To Install and Configure Open SSH Server on Ubuntu
 
Windows PowerShell Basics - How To List PSDrive Info
Windows PowerShell Basics - How To List PSDrive InfoWindows PowerShell Basics - How To List PSDrive Info
Windows PowerShell Basics - How To List PSDrive Info
 
How To List Nginx Modules Installed / Complied on CentOS 7
How To List Nginx Modules Installed / Complied on CentOS 7How To List Nginx Modules Installed / Complied on CentOS 7
How To List Nginx Modules Installed / Complied on CentOS 7
 
Windows PowerShell Basics – How To Create powershell for loop
Windows PowerShell Basics – How To Create powershell for loopWindows PowerShell Basics – How To Create powershell for loop
Windows PowerShell Basics – How To Create powershell for loop
 
How To Construct IF and Else Conditional Statements
How To Construct IF and Else Conditional StatementsHow To Construct IF and Else Conditional Statements
How To Construct IF and Else Conditional Statements
 
How To Create PowerShell Function Mandatory Parameter and Optional Parameter
How To Create PowerShell Function Mandatory Parameter and Optional ParameterHow To Create PowerShell Function Mandatory Parameter and Optional Parameter
How To Create PowerShell Function Mandatory Parameter and Optional Parameter
 
How To Create Power Shell Function Mandatory Parameter Value
How To Create Power Shell Function Mandatory Parameter ValueHow To Create Power Shell Function Mandatory Parameter Value
How To Create Power Shell Function Mandatory Parameter Value
 
How To Create PowerShell Function
How To Create PowerShell FunctionHow To Create PowerShell Function
How To Create PowerShell Function
 
How To Disable IE Enhanced Security Windows PowerShell
How To Disable IE Enhanced Security Windows PowerShellHow To Disable IE Enhanced Security Windows PowerShell
How To Disable IE Enhanced Security Windows PowerShell
 
How To Check IE Enhanced Security Is Enabled Windows PowerShell
How To Check IE Enhanced Security Is Enabled Windows PowerShellHow To Check IE Enhanced Security Is Enabled Windows PowerShell
How To Check IE Enhanced Security Is Enabled Windows PowerShell
 
How To Configure Nginx Load Balancer on CentOS 7
How To Configure Nginx Load Balancer on CentOS 7How To Configure Nginx Load Balancer on CentOS 7
How To Configure Nginx Load Balancer on CentOS 7
 

Dernier

Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
vu2urc
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
Enterprise Knowledge
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 

Dernier (20)

Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 

How to Install and Configure Cacti on Linux

  • 1. How To Install and Configure Cacti on Linux i | P a g e Contents Overview.......................................................................................................................................................1 Applies To......................................................................................................................................................1 Slideshare Documentation – Screenshots ....................................................................................................1 Cacti NNM – Pre-requisites...........................................................................................................................1 Query – Packages Installed ...........................................................................................................................1 Step 1: Install Packages.................................................................................................................................2 Install Apache2..........................................................................................................................................2 Install MySQL ............................................................................................................................................3 Install Net-SNMP.......................................................................................................................................4 Install PHP .................................................................................................................................................5 Install PHP SNMP ..................................................................................................................................6 List PHP – Configuration Files Loaded.......................................................................................................7 Install RRDTool..........................................................................................................................................7 Step 2: Configure Apache Service (HTTPD)...................................................................................................7 Apache Service - Status.............................................................................................................................7 Apache Service - OS Startup Status...........................................................................................................8 Apache Service – Modify OS Startup Status .............................................................................................8 Starting Apache Webserver......................................................................................................................8 Configure Apache - ServerName...............................................................................................................8 Step 3: Configure MySQL Service (mysqld)...................................................................................................9 MySQL Service - Status .............................................................................................................................9 MySQL Service - OS Startup Status ...........................................................................................................9 MySQL Service – Modify OS Startup Status..............................................................................................9 Setup MySQL Database Server .................................................................................................................9 Connect MySQL Database...................................................................................................................10 Set MySQL root password...................................................................................................................10 MySQL Login – Root User....................................................................................................................10 Step 4: Configure SNMP Service .................................................................................................................11 Default SNMP Configuration...................................................................................................................11 Counting SNMP Line – Default Config.................................................................................................11 Minimal SNMP Configuration .................................................................................................................11
  • 2. How To Install and Configure Cacti on Linux ii | P a g e Create SNMP Configuration File .........................................................................................................11 Test SNMP Configuration....................................................................................................................11 Counting SNMP Line – Customized Config..........................................................................................11 SNMP Service - Status.............................................................................................................................12 SNMP Service - OS Startup Status...........................................................................................................12 SNMP Service – Modify OS Startup Status..............................................................................................12 Starting SNMP service.............................................................................................................................12 Step 4: Install RRDTool Package..................................................................................................................12 Step 5: Install Cacti Package........................................................................................................................13 Configure MySQL for Cacti......................................................................................................................13 Create and Configure cacti User .........................................................................................................13 Test MySQL connection – Cacti User ..................................................................................................13 Find Cacti SQL Script ...........................................................................................................................14 Import Cacti Database Table Script.....................................................................................................14 Verify Cacti Database Import Status...................................................................................................14 Configure cacti DB Connection Parameters........................................................................................14 Edit DB Connection Parameters..........................................................................................................14 Configure Apache for Cacti .................................................................................................................15 Restart httpd Service ..........................................................................................................................15 Set Cron job for cacti pooling..............................................................................................................16 Step 6: Cacti Monitoring Setup...................................................................................................................16 Tool Information.....................................................................................................................................16 Identify SNMP & RRDTool Versions....................................................................................................17 Launch Cacti Application.........................................................................................................................17 App Step 1 – Welcome screen ............................................................................................................17 App Step 2 – Installation Type ............................................................................................................17 App Step 3 – Executables Path............................................................................................................18 App Step 4 – First Login.......................................................................................................................19 App Step 5 – Reset Password (admin) ................................................................................................19 App Step 6 – Create Graphs................................................................................................................19
  • 3. How To Install and Configure Cacti 1 | P a g e Overview 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 status, performance of different devices viz., system, network, processes, etc. At regular intervals to create graphs on resulting data using RRDtool. By default data is pooled every 5 minutes. Applies To CentOS 6.x / RHEL 6.x Slideshare Documentation – Screenshots This documentation is available with screenshots at http://slideshare.net Cacti NNM – Pre-requisites Few of the major pre-requisites are; Apache A Web server to display network graphs created by PHP and RRDTool. MySQL A Database server to store cacti information. PHP A script module to create graphs using RRDTool. PHP-SNMP A PHP extension for SNMP to access data. NET-SNMP A SNMP (Simple Network Management Protocol) is used to manage network. RRDTool A database tool to manage and retrieve time series data like CPU load, Network Bandwidth etc. Query – Packages Installed rpm -qa | grep ^httpd* rpm -qa | grep ^mysql* rpm -qa | grep ^net* rpm -qa | grep ^php-* rpm -qa | grep ^rrd*
  • 4. How To Install and Configure Cacti 2 | P a g e Step 1: Install Packages Apache2 yum install httpd httpd-devel MySQL yum install mysql mysql-server PHP yum install php-mysql php-pear php-common php-gd php-devel php php-mbstring php-cli SNMP yum install net-snmp-utils php-snmp net-snmp-libs php-pear-Net-SMTP RRD yum install rrdtool Install Apache2 Install the Apache2 package using yum and dependent packages. yum install httpd httpd-devel
  • 5. How To Install and Configure Cacti 3 | P a g e Install MySQL Install the MySQL package using yum and dependent packages. yum install mysql mysql-server
  • 6. How To Install and Configure Cacti 4 | P a g e Install Net-SNMP Install the Net-SNMP package using yum and dependent packages. yum install net-snmp-utils php-snmp net-snmp-libs php-pear-NET-SMTP
  • 7. How To Install and Configure Cacti 5 | P a g e Install PHP Install the PHP package using yum and dependent packages. yum install php-mysql php-pear php-common php-gd php-devel php php-mbstring php-cli
  • 8. How To Install and Configure Cacti 6 | P a g e Install PHP SNMP To install php snmp packages using yum and dependent packages. yum install net-snmp-utils php-snmp net-snmp-libs php-pear-NET-SMTP
  • 9. How To Install and Configure Cacti 7 | P a g e List PHP – Configuration Files Loaded After installation, you can list the php configurations loaded, execute the command “php --ini”" Output: Install RRDTool Install the RRDTool package using yum and dependent packages. yum install rrdtool Step 2: Configure Apache Service (HTTPD) Apache Service - Status Check the status of httpd, execute the command service httpd status Output: httpdd service status: httpd is stopped
  • 10. How To Install and Configure Cacti 8 | P a g e Apache Service - OS Startup Status Check the OS startup status of apache web server service, execute the command chkconfig httpd --list Output: httpd service start-up setting: httpd 0:off 1:off 2:off 3:off 4:off 5:off 6:off Apache Service – Modify OS Startup Status Modify OS startup status of apache web server; service to auto-start at levels (3, 4, 5) execute the command chkconfig httpd on Output: httpd service start-up setting: httpd 0:off 1:off 2:on 3:on 4:on 5:on 6:off Starting Apache Webserver service httpd start Output: Starting httpd: httpd: Could not reliably determine the server's fully qualified domain name, using 192.168.2.92 for ServerName [ OK ] Configure Apache - ServerName vi /etc/httpd/conf/httpd.conf Find and replace attribute value of “ServerName” to respective hostname or FQDN of the host and restart httpd service. Example: ServerName etpl01nm01pr.ftech.com service httpd restart Output: Stopping httpd: [ OK ] Starting httpd: [ OK ] After restarting httpd service, access in browser access the URL http://vcp01tst02pr.ftech.com/ or http://<IP Address> default apache page should be displayed.
  • 11. How To Install and Configure Cacti 9 | P a g e Step 3: Configure MySQL Service (mysqld) MySQL Service - Status Check the status of mysql database, execute the command service mysqld status Output: mysqld service status: mysqld is stopped MySQL Service - OS Startup Status Check the OS startup status of mysql database service, execute the command chkconfig mysqld --list Output: mysqld service start-up setting: mysqld 0:off 1:off 2:off 3:off 4:off 5:off 6:off MySQL Service – Modify OS Startup Status Modify OS startup of MySQL Database server; service to auto-start at levels (3, 4, 5) execute the command chkconfig --levels 345 mysqld on Output: mysqld service start-up setting: mysqld 0:off 1:off 2:off 3:on 4:on 5:on 6:off Setup MySQL Database Server When you start the mysqld daemon for the first time, default database would be created and further hardening can be considered later on. service mysqld start Output: mysqld service starting: Initializing MySQL database: Installing MySQL system tables... OK Filling help tables... OK To start mysqld at boot time you have to copy support-files/mysql.server to the right place for your system
  • 12. How To Install and Configure Cacti 10 | P a g e PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER ! To do so, start the server, then issue the following commands: /usr/bin/mysqladmin -u root password 'new-password' /usr/bin/mysqladmin -u root -h vcp01tst02pr password 'new-password' Alternatively you can run: /usr/bin/mysql_secure_installation which will also give you the option of removing the test databases and anonymous user created by default. This is strongly recommended for production servers. See the manual for more instructions. You can start the MySQL daemon with: cd /usr ; /usr/bin/mysqld_safe & You can test the MySQL daemon with mysql-test-run.pl cd /usr/mysql-test ; perl mysql-test-run.pl Please report any problems with the /usr/bin/mysqlbug script! [ OK ] Starting mysqld: [ OK ] Connect MySQL Database By default no password is set, you will be logged into mysql prompt. You can test by executing command; since we have already configured with root password. Without passing password to mysql command it will fail to connect. mysql mysql> q Set MySQL root password To set MySQL root user password; execute the command /usr/bin/mysqladmin -u root -h localhost password 'your-new-password' or /usr/bin/mysqladmin -u root -h vcp01tst02pr password 'your-new-password' MySQL Login – Root User mysql -uroot -proot123$ mysql> q
  • 13. How To Install and Configure Cacti 11 | P a g e Step 4: Configure SNMP Service Default SNMP Configuration No configuration changes are needed “/etc/snmp/snmpd.conf” file; to test execute the command snmpwalk -v 1 -c public -O e 127.0.0.1 | head -1 Output: SNMPv2-MIB::sysDescr.0 = STRING: Linux vcp01tst02pr 2.6.32-358.23.2.el6.x86_64 #1 SMP Wed Oct 16 18:37:12 UTC 2013 x86_64 Counting SNMP Line – Default Config snmpwalk -v 1 -c public -O e 127.0.0.1 | wc -l Output: 33 Minimal SNMP Configuration Optionally, if you would like to customize or minimal configuration; mv /etc/snmp/snmpd.conf /etc/snmp/snmpd.conf.original Create SNMP Configuration File vi /etc/snmp/snmpd.conf Add the below lines; rocommunity public syslocation "VCP, Bangalore" syscontact mvcp@domain.com Test SNMP Configuration snmpwalk -v 1 -c public -O e 127.0.0.1 | head -1 Output: SNMPv2-MIB::sysDescr.0 = STRING: Linux vcp01tst02pr 2.6.32-358.23.2.el6.x86_64 #1 SMP Wed Oct 16 18:37:12 UTC 2013 x86_64 Counting SNMP Line – Customized Config snmpwalk -v 1 -c public -O e 127.0.0.1 | wc -l Output: 3304
  • 14. How To Install and Configure Cacti 12 | P a g e SNMP Service - Status Check the status of snmp service, execute the command service snmpd status Output: snmpd service status: snmpd is stopped SNMP Service - OS Startup Status Check the OS startup status of apache web server service, execute the command chkconfig snmpd --list Output: snmpd service start-up setting: snmpd 0:off 1:off 2:off 3:off 4:off 5:off 6:off SNMP Service – Modify OS Startup Status Modify OS startup status of snmp; service to auto-start at levels (3, 4, 5) execute the command chkconfig --levels 345 snmpd on Output: snmpd service start-up setting: snmpd 0:off 1:off 2:on 3:on 4:on 5:on 6:off Starting SNMP service service snmpd start Output: snmpd service starting: Starting snmpd: [ OK ] Step 4: Install RRDTool Package yum install rrdtool
  • 15. How To Install and Configure Cacti 13 | P a g e Step 5: Install Cacti Package yum install cacti Configure MySQL for Cacti In order to cacti to work, configuration have to be done, the steps are listed below. Create and Configure cacti User mysql -uroot -proot123$ mysql> create database cacti; mysql> use cacti; mysql> grant all privileges on *.* to cacti@localhost identified by 'cacti123$'; mysql> grant all privileges on *.* to cacti@vcp01tst02pr identified by 'cacti123$'; mysql> flush privileges; mysql> q Test MySQL connection – Cacti User mysql -ucacti -pcacti123$ mysql> mysql> q
  • 16. How To Install and Configure Cacti 14 | P a g e Find Cacti SQL Script rpm -ql cacti | grep "cacti.sql" Output: /usr/share/doc/cacti-0.8.8b/cacti.sql Import Cacti Database Table Script mysql -ucacti -pcacti123$ cacti < /usr/share/doc/cacti-0.8.8b/cacti.sql Verify Cacti Database Import Status mysql -ucacti -pcacti123$ -hlocalhost cacti mysql> show tables; Note: show tables; query should list 52 rows (tables). Configure cacti DB Connection Parameters To configure cacti application database connection parameters, update MySQL database connection parameters settings in the file vi /etc/cacti/db.php Edit DB Connection Parameters /* make sure these values reflect your actual database/host/user/password */ $database_type = "mysql"; $database_default = "cacti"; $database_hostname = "localhost"; $database_username = "cacti"; $database_password = "cacti123$"; $database_port = "3306"; $database_ssl = false;
  • 17. How To Install and Configure Cacti 15 | P a g e Configure Apache for Cacti In order to access cacti on web, edit and append below configuration lines the in file vi /etc/httpd/conf.d/cacti.conf Sample Configuration snippet: # # Add cacti alias and point the directory where cacti is installed. # Alias /cacti /usr/share/cacti # # Add cacti access restrictions from specific IP range / subnet # <Directory /usr/share/cacti/> Order Deny,Allow Deny from all Allow from 192.168.1.0/24 Allow from 192.168.2.0/24 </Directory> Restart httpd Service service httpd restart Output: Apache Service Restart: Stopping httpd: [ OK ] Starting httpd: [Fri Mar 18 21:15:23 2014] [warn] The Alias directive in /etc/httpd/conf.d/cacti.conf at line 59 will probably never match because it overlaps an earlier Alias. [ OK ] Note: In this case there are duplicate alias for “cacti”; so remove one of the aliases for defined cacti, save and restart apache service.
  • 18. How To Install and Configure Cacti 16 | P a g e Set Cron job for cacti pooling Cacti pools data every 5 minutes once, for pooling data cron job has be created, add the crontab entry as per the below line. crontab -e */5 * * * * cacti /usr/bin/php /usr/share/cacti/poller.php > /dev/null 2>&1 crontab -l Note: data pooling is done via snmp; ensure SNMP is configured for the device / server that needs to be monitored on cacti. Step 6: Cacti Monitoring Setup Before you launch Cacti monitoring application, make sure you have installed all the required packages and their respective binaries exists. For NET-SNMP & RRDTool identify the versions installed on the server, you can query for package installed, check “App Step 3 - Executables Path” section in “Launching Cacti”. This information is required while configuring cacti application. Tool Information Tool Binary Find Default Path RRDTool Rrdtool which rrdtool /usr/bin/ PHP Php which php /usr/bin/ SNMP Walk snmpwalk which snmpwalk /usr/bin/ SNMP Get snmpget which snmpget /usr/bin/ SNMP Bulk Walk snmpbulkwalk which snmpbulkwalk /usr/bin/ SNMP Get Next snmpgetnext which snmpgetnext /usr/bin/ Cacti Logger cacti.log ls /usr/share/cacti/log /usr/share/cacti/log
  • 19. How To Install and Configure Cacti 17 | P a g e Identify SNMP & RRDTool Versions SNMP Utility Version rpm -qa | grep net-snmp RRDTool Version rpm -qa | grep rrdtool Launch Cacti Application To launch and configure cacti; in the browser access the URL http://<Your Cacti Host>/cacti/ or http://<Cacti Host IP Address>/cacti/; App Step 1 – Welcome screen First run; initial setup screen; click on “Next” button. App Step 2 – Installation Type Choose the option whether the installation is a “New Install” or “upgrade”
  • 20. How To Install and Configure Cacti 18 | P a g e App Step 3 – Executables Path From the “Tool Information” section the collated information should be validated.
  • 21. How To Install and Configure Cacti 19 | P a g e App Step 4 – First Login In Login Screen, enter default username as “admin” and password as “admin” App Step 5 – Reset Password (admin) You need to reset the default password to a new password App Step 6 – Create Graphs Upon launching, click on “Create Graphs” and choose the host that you would like to get generate the graphs.