Monitoring software cacti Building
First, the Environment preparation
1. Install Epel extension Source
[email protected] ~]# Yum install-y epel-release
2. Build Lamp Environment
[[email protected] ~]# yum install -y httpd php php-mysql mysql mysql-server mysql-devel php-gd libjpeg libjpeg-devel libpng-devel[[ Email protected] ~]# /etc/init.d/httpd start is starting httpd: [determining][[email protected] ~]# /etc/init.d/mysqld start Initialization MySQL Database: installing mysql system tables ... Okfilling help tables ... okto start mysqld at boot time you have to copysupport-files/ Mysql.server to the right place for your systemplease 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 cacti password ' New-password ' alternatively you can run:/usr/ bin/mysql_secure_installationwhich will also give you the option of Removing the testdatabases and anonymous user created by default. this isstrongly 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.plcd /usr/mysql-test ; perl mysql-test-run.plplease report any problems with the /usr/bin/mysqlbug script! [OK] starting mysqld: [OK]
3, install cacti monitoring host
[[email protected] ~]# yum install -y cacti net-snmp net-snmp-utils rrdtool net-snmp-devel net-snmp-libs lm-sensors php-xml zlib libpng freetype cairo-devel pango-devel gd[[email protected] ~]# /etc/init.d/snmpd start is starting snmpd: [Determine][[email protected ] ~]# mysql -u rootwelcome to the mysql monitor. commands end with ; or \g.Your MySQL connection id is 4Server version: 5.1.73 source distributioncopyright (c) 2000, 2013, Oracle And/or its affiLiates. all rights reserved. oracle is a registered trademark of oracle corporation and/or Itsaffiliates. other names may be trademarks of their respectiveowners . type ' help; ' or ' \h ' for help. Type ' \c ' to clear the current input statement.mysql> create database cacti;mysql> grant all on cacti.* to ' cactiuser ' @ ' localhost ' identified by ' cactiuser '; query ok, 0 rows affected (0.00 sec) mysql> exitbye[[email protected ] ~]# mysql -u root cacti < /usr/share/doc/cacti-0.8.8b/cacti.sql[[email protected] ~]# vim /usr/share/cacti/include/config.php$database_type = "MySQL"; $database _default = "cacti"; $database _hostname = "localhost"; $database_username = "Cactiuser"; $database _password = "Cactiuser"; $database _port = "3306" ; $database _ssl = false; [[email protected] ~]# vim /etc/httpd/conf.d/cacti.confdeny from all revision changed to allow from all[[email protected] ~]# /etc/init.d/httpd restart Stop httpd: [OK] starting httpd: [OK]
4. Access via browser
If access is not available, please check the host's iptables and SELinux
650) this.width=650; "style=" width:600px;height:441px; "src=" http://s3.51cto.com/wyfs02/M01/6E/70/ Wkiom1v8mzeipsgsaapeoggd1e4262.jpg "title=" cacti install.jpg "alt=" wkiom1v8mzeipsgsaapeoggd1e4262.jpg "border=" 0 " height= "441" hspace= "0" vspace= "0" width= "/>"
Figure: A
650) this.width=650; "style=" width:600px;height:343px; "src=" http://s3.51cto.com/wyfs02/M00/6E/6D/ Wkiol1v8nvghfx3aaahtyqpc2tk897.jpg "title=" New Install.jpg "alt=" wkiol1v8nvghfx3aaahtyqpc2tk897.jpg "border=" 0 " height= "343" hspace= "0" vspace= "0" width= "/>"
Fig.: Two
650) this.width=650; "style=" width:600px;height:732px; "src=" http://s3.51cto.com/wyfs02/M01/6E/6D/ Wkiol1v8nyugxmjzaatojccu5je500.jpg "title=" finish.jpg "alt=" wkiol1v8nyugxmjzaatojccu5je500.jpg "border=" 0 "height= "732" hspace= "0" vspace= "0" width= "/>"
Fig.: Three
To the login, the default account is admin, password for admin
650) this.width=650; "style=" width:600px;height:313px; "src=" http://s3.51cto.com/wyfs02/M02/6E/6D/ Wkiol1v8njhi1b0yaaflckhzxvo091.jpg "title=" login.jpg "alt=" wkiol1v8njhi1b0yaaflckhzxvo091.jpg "border=" 0 "height=" 313 "hspace=" 0 "vspace=" 0 "width="/> "
Fig.: Four
After logging in, the system will force the user to change the password
650) this.width=650; "style=" width:600px;height:370px; "src=" http://s3.51cto.com/wyfs02/M02/6E/70/ Wkiom1v8nn3gaonvaaga7v5ohr0897.jpg "title=" admin.jpg "alt=" wkiom1v8nn3gaonvaaga7v5ohr0897.jpg "border=" 0 "height=" 370 "hspace=" 0 "vspace=" 0 "width="/> "
Fig.: Five
650) this.width=650; "style=" width:600px;height:698px; "src=" Http://s3.51cto.com/wyfs02/M00/6E/6D/wKioL1V8Nt_ Sryb9aalbuz5fwyi217.jpg "title=" ok.jpg "alt=" wkiol1v8nt_sryb9aalbuz5fwyi217.jpg "border=" 0 "height=" 698 "hspace=" 0 " Vspace= "0" width= "/>"
Fig.: Six
Click Graphs-default tree-host Localhost to enter the system monitoring interface
650) this.width=650; "style=" width:600px;height:293px; "src=" http://s3.51cto.com/wyfs02/M01/6E/6D/ Wkiol1v8n5mzft3uaamwqcf4p44338.jpg "title=" graphs.jpg "alt=" wkiol1v8n5mzft3uaamwqcf4p44338.jpg "border=" 0 "height= "293" hspace= "0" vspace= "0" width= "/>"
Fig.: Seven
We see the monitoring interface, there is no plot, set the plot
[[email protected] ~]#/usr/bin/php/usr/share/cacti/poller.php OK u:0.00 s:0.00 r:0.00ok u:0.00 s:0.00 r:0.01ok u:0.00 s: 0.00 R:0.03ok u:0.00 s:0.00 r:0.05ok u:0.00 s:0.00 r:0.0806/13/2015 09:59:49 pm-system stats:time:0.1974 Method:cmd.php Processes:1 threads:n/a hosts:2 hostsperprocess:2 datasources:5 rrdsprocessed:5[[email protected] ~]# crontab-e# let command every 5 minutes The clock executes once */5 * * * */usr/bin/php/usr/share/cacti/poller.php >/dev/null 2>&1
We're refreshing, and the picture's out.
650) this.width=650; "style=" width:600px;height:458px; "src=" http://s3.51cto.com/wyfs02/M02/6E/6D/ Wkiol1v8ojtqrs83aawnkwuhcdm963.jpg "title=" tu.jpg "alt=" wkiol1v8ojtqrs83aawnkwuhcdm963.jpg "border=" 0 "height=" 458 "hspace=" 0 "vspace=" 0 "width=" "/>
Figure: Eight
Data needs to wait for a while before it comes out
650) this.width=650; "style=" width:600px;height:353px; "src=" http://s3.51cto.com/wyfs02/M01/6E/71/ Wkiom1v8opprl2inaasvmdqmkto471.jpg "title=" sss.jpg "alt=" wkiom1v8opprl2inaasvmdqmkto471.jpg "border=" 0 "height=" 353 "hspace=" 0 "vspace=" 0 "width="/> "
Next we add the monitored host
The # is installed on the monitored host [[email protected] ~]# yum install -y net-snmp lm_sensors[ [email protected] ~]# vim /etc/snmp/snmpd.conf#syslocation unknown (edit / etc/snmp/snmpd.conf) syslocation 192.168.1.118# group context sec.model sec.level prefix read write notifaccess notConfigGroup "" any noauth exact all none noneview all included .1 80 Remove the comment "#" [[email protected] ~]# /etc/init.d/snmpD start is starting snmpd: [OK]
Add a host by clicking Add, Console, Devices
650) this.width=650; "style=" width:600px;height:308px; "src=" http://s3.51cto.com/wyfs02/M01/6E/6D/ Wkiol1v8pnzgxyrwaapqpjmlnrk408.jpg "title=" 123.jpg "alt=" wkiol1v8pnzgxyrwaapqpjmlnrk408.jpg "border=" 0 "height=" 308 "hspace=" 0 "vspace=" 0 "width="/> "
Start adding the monitored host information, complete, click Create
650) this.width=650; "style=" width:600px;height:438px; "src=" http://s3.51cto.com/wyfs02/M00/6E/6D/ Wkiol1v8zcvqcuxcaadoogwakeg875.jpg "title=" 11113.jpg "alt=" wkiol1v8zcvqcuxcaadoogwakeg875.jpg "border=" 0 "height=" 438 "hspace=" 0 "vspace=" 0 "width="/> "
Created to see if the communication is OK, create the host, create the item to be monitored click Create Graphs for this host,
650) this.width=650; "style=" width:600px;height:435px; "src=" http://s3.51cto.com/wyfs02/M01/6E/6D/ Wkiol1v8zm-gh-q9aagmwlop-0e215.jpg "title=" 2222.jpg "alt=" wkiol1v8zm-gh-q9aagmwlop-0e215.jpg "border=" 0 "height=" 435 "hspace=" 0 "vspace=" 0 "width="/> "
Select the items you want to monitor, as needed
650) this.width=650; "style=" width:600px;height:314px; "src=" http://s3.51cto.com/wyfs02/M01/6E/71/ Wkiom1v8y5djchuqaaypa7qzyve198.jpg "title=" 444444444444.jpg "alt=" wkiom1v8y5djchuqaaypa7qzyve198.jpg "border=" 0 " height= "314" hspace= "0" vspace= "0" width= "/>"
Monitoring project added, add the host to the monitoring trunk, click on the left graph Trees
650) this.width=650; "style=" width:600px;height:341px; "src=" http://s3.51cto.com/wyfs02/M02/6E/71/ Wkiom1v8y-zsqbceaaxzg1tgohs039.jpg "title=" 555.jpg "alt=" wkiom1v8y-zsqbceaaxzg1tgohs039.jpg "border=" 0 "height=" 341 "hspace=" 0 "vspace=" 0 "width="/> "
Click Add to add a monitored host
650) this.width=650; "style=" width:600px;height:321px; "src=" http://s3.51cto.com/wyfs02/M00/6E/6D/ Wkiol1v8zo7h-ux9aanenukwz4e322.jpg "title=" 66.jpg "alt=" wkiol1v8zo7h-ux9aanenukwz4e322.jpg "border=" 0 "height=" 321 "hspace=" 0 "vspace=" 0 "width=" "/>
Type select host, and then select the hosts you want to add
650) this.width=650; "style=" width:600px;height:296px; "src=" http://s3.51cto.com/wyfs02/M00/6E/71/ Wkiom1v8zq7qzaziaap2fzojdne426.jpg "title=" 7777.jpg "alt=" wkiom1v8zq7qzaziaap2fzojdne426.jpg "border=" 0 "height=" 296 "hspace=" 0 "vspace=" 0 "width="/> "
Add complete, click Save
650) this.width=650; "style=" width:600px;height:263px; "src=" http://s3.51cto.com/wyfs02/M01/6E/6D/ Wkiol1v8zwbqjs8daanmx1asnv0862.jpg "title=" 88888.jpg "alt=" wkiol1v8zwbqjs8daanmx1asnv0862.jpg "border=" 0 "height=" 263 "hspace=" 0 "vspace=" 0 "width="/> "
to the main interface to see if added successfully, it is best to refresh on the monitoring server
[[email protected] ~]# /usr/bin/php /usr/share/cacti /poller.php --forceok u:0.00 s:0.00 r:0.00ok u:0.00 s:0.00 r:0.01ok u : 0.00 s:0.00 r:0.03ok u:0.00 s:0.00 r:0.05ok u:0.00 s:0.00 r:0.08ok u:0.00 s:0.00 r:0.09ok u:0.00 s:0.00 r:0.09ok u:0.00 s:0.00 r:0. 09ok u:0.00 s:0.00 r:0.09ok u:0.00 s:0.00 r:0.09ok u:0.00 s:0.00 r:0.09ok u:0.00 s:0.00 r:0.09ok u:0.00 s:0.00 r:0.09ok u:0.00 s:0.00 r:0.09ok u:0.00 s:0.00 r:0.09ok u:0.00 s:0.00 r:0.09ok u:0.00 s : 0.00 r:0.1006/13/2015 05:16:53 pm - system stats: time:0.2109 method: cmd.php processes:1 threads:n/a hosts:3 hostsperprocess:3 datasources:20 Rrdsprocessed:17
650) this.width=650; "style=" width:600px;height:375px; "src=" http://s3.51cto.com/wyfs02/M00/6E/71/wKiom1V8ZdnS8_ 09aaxt9mv_92i511.jpg "title=" 9999.jpg "alt=" wkiom1v8zdns8_09aaxt9mv_92i511.jpg "border=" 0 "height=" 375 "hspace=" 0 " Vspace= "0" width= "/>"
Successfully added!!
This article is from the "topspeed_king" blog, make sure to keep this source http://mylinuxlife.blog.51cto.com/4706737/1661680
Linux installation cacti