yum创库的搭建

[root@localhost ~]# vim /etc/yum.repos.d/rhel-debuginfo.repo

cacti的安装与监控_的

dns指向

[root@localhost ~]# vim /etc/resolv.conf

cacti的安装与监控_安装_02

挂载光盘

[root@localhost ~]# mount /dev/cdrom /mnt/cdrom/

安装cacti

[root@localhost ~]# yum install httpd php php-mysql php-snmp mysql-server perl-DBD-MySQL php-pdo net-snmp net-snmp-libs net-snmp-utils net-snmp-devel ruby ruby-devel

导入cacti软件包

[root@localhost ~]# cd cacti/

[root@localhost cacti]# ll

cacti的安装与监控_blank_03

[root@localhost cacti]# yum localinstall rrdt* --nogpgcheck –y

[root@localhost cacti]# chkconfig httpd on

[root@localhost cacti]# service httpd start

[root@localhost cacti]# chkconfig mysqld on

[root@localhost cacti]# service mysqld start

编辑snmp文件

[root@localhost cacti]# vim /etc/snmp/snmpd.conf

cacti的安装与监控_安装_04

cacti的安装与监控_的_05

[root@localhost cacti]# chkconfig snmpd on

[root@localhost cacti]# service snmpd start

新建cacti数据库

[root@localhost cacti]# mysql

mysql> CREATE DATABASE cacti;

mysql> grant all privileges on cacti.* to cacti@localhost identified by 'cacti';

mysql> grant all privileges on cacti.* to cacti@127.0.0.1 identified by 'cacti';

mysql> grant all privileges on cacti.* to cacti@192.168.101.0 identified by 'cacti';

mysql> flush privileges;

mysql> \q

新建cacti帐号

[root@localhost cacti]# useradd cacti

[root@localhost cacti]# passwd cacti

测试php页面

[root@localhost cacti]# cd /var/www/html/

[root@localhost html]# vim index.php

<?php

phpinfo();

?>

cacti的安装与监控_安装_06

编辑测试mysql与php的链接

[root@localhost html]# vim index.php

<?php

$link=mysql_connect('127.0.0.1','root','');

if ($link)

echo "it is success!";

else

echo "it is not success!";

?>

cacti的安装与监控_border_07

[root@localhost html]# cd

[root@localhost ~]# cd cacti/

[root@localhost cacti]# tar -zxvf cacti-0.8.7g.tar.gz -C /var/www/html

[root@localhost cacti]# cd /var/www/html/

[root@localhost html]# mv cacti-0.8.7g cacti

[root@localhost html]# cd cacti/

[root@localhost cacti]# chown -R root.root *

[root@localhost cacti]# vim include/config.php

cacti的安装与监控_border_08

导入数据库

[root@localhost cacti]# mysql -ucacti -pcacti cacti </var/www/html/cacti/cacti.sql

cacti的安装:

cacti的安装与监控_blank_09

cacti的安装与监控_blank_10

cacti的安装与监控_安装_11

cacti的安装与监控_border_12

cacti的安装与监控_target_13

cacti的安装与监控_blank_14

查看本机监控

cacti的安装与监控_安装_15

编辑计划任务

[root@localhost cacti]# crontab -e

*/5 * * * * php /var/www/html/cacti/poller.php >/dev/null 2&gt;&1

cacti的安装与监控_blank_16

修改snmp配置版本

new graphs-----Edit this host

cacti的安装与监控_安装_17

选择snmp版本2

cacti的安装与监控_blank_18

查看被监控主机是否链接

[root@localhost cacti]# snmpwalk -v2c -c public 192.168.101.178

监控window系统主机

控制面板---添加删除程序---添加或删除windows组件---管理和监视工具

cacti的安装与监控_的_19

cacti的安装与监控_target_20

我的电脑----管理----服务和应用程序---服务---snmp service---属性

cacti的安装与监控_target_21

cacti的安装与监控_blank_22

配置cacti的windows监控

cacti的安装与监控_border_23

链接不成功显示

cacti的安装与监控_target_24

链接成功显示

cacti的安装与监控_target_25

编辑windows监控信息

cacti的安装与监控_target_26

cacti的安装与监控_的_27

cacti的安装与监控_的_28

新建graph tree用于管理windows2003

cacti的安装与监控_的_29

将新建的sevices挂在到tree上

cacti的安装与监控_border_30

windows2003监控信息

cacti的安装与监控_安装_31

监控linux系统

[root@mail ~]# mount /dev/cdrom /mnt/cdrom/

[root@mail ~]# cd /mnt/cdrom/Server/

[root@mail Server]# yum install net-snmp

[root@mail ~]# vim /etc/snmp/snmpd.conf

cacti的安装与监控_blank_32

cacti的安装与监控_target_33

[root@mail ~]# chkconfig snmpd on

[root@mail ~]# service snmpd start

配置linux系统监控

新建linux系统tree

cacti的安装与监控_blank_34

编辑linux系统devices

cacti的安装与监控_安装_35

cacti的安装与监控_的_36

cacti的安装与监控_blank_37

将linux添加linux管理tree下

cacti的安装与监控_target_38

linux系统监控信息

cacti的安装与监控_的_39

linux下web监控

[root@localhost cacti]# cd ApacheStats_0.8.2/

[root@localhost ApacheStats_0.8.2]# ll

cacti的安装与监控_的_40

[root@localhost ApacheStats_0.8.2]# mv ss_apache_stats.php /var/www/html/cacti/scripts/

导入apache模块

cacti的安装与监控_的_41

cacti的安装与监控_target_42

添加web监控

cacti的安装与监控_安装_43

cacti的安装与监控_安装_44

cacti的安装与监控_target_45

[root@mail ~]# vim /etc/httpd/conf/httpd.conf、

cacti的安装与监控_blank_46

<VirtualHost *:80>

<location /server-status>

SetHandler server-status

Order Deny,Allow

Deny from all

Allow from all

</location>

</VirtualHost>

[root@mail ~]# service httpd restart

监控web

cacti的安装与监控_border_47

cacti的安装与监控_target_48

mysql的监控

导入所需插件

[root@localhost ~]# cd cacti/better-cacti-templates-1.1.8/

[root@localhost better-cacti-templates-1.1.8]# ll

total 52

-rw-r--r-- 1 root root 19071 Jun 18 15:13 COPYING

-rw-r--r-- 1 root root 7472 Jun 18 15:13 Changelog

-rw-r--r-- 1 root root 1933 Jun 18 15:13 README

drwxr-xr-x 2 root root 4096 Jun 18 15:13 definitions

drwxr-xr-x 2 root root 4096 Jun 18 15:13 misc

drwxr-xr-x 2 root root 4096 Jun 18 15:13 scripts

drwxr-xr-x 2 root root 4096 Jun 18 15:13 templates

drwxr-xr-x 2 root root 4096 Jun 18 15:13 tools

[root@localhost better-cacti-templates-1.1.8]# cd scripts/

[root@localhost scripts]# cp ss_get_mysql_stats.php /var/www/html/cacti/scripts/

[root@localhost scripts]# vim /var/www/html/cacti/scripts/ss_get_mysql_stats.php

cacti的安装与监控_border_49

[root@localhost scripts]# chown cacti:cacti /var/www/html/cacti/cache/

[root@localhost scripts]# chmod 777 /var/www/html/cacti/cache/

客户端主机配置

[root@mail ~]# mount /dev/cdrom /mnt/cdrom/

[root@mail ~]# yum install mysql-server

[root@mail ~]# chkconfig mysqld on

[root@mail ~]# service mysqld start

[root@mail ~]# mysql

mysql&gt; grant process,super on *.* to 'cacti'@'192.168.101.180' identified by 'cacti';

mysql&gt; flush privileges;

mysql&gt; \q

[root@mail ~]# vim /etc/snmp/snmpd.conf

cacti的安装与监控_blank_50

cacti的安装与监控_的_51

[root@mail ~]# service snmpd restart

主机监控链接检测

[root@localhost scripts]# snmpwalk -v 2c -c public localhost sysUpTime

DISMAN-EVENT-MIB::sysUpTimeInstance = Timeticks: (279121) 0:46:31.21

导入模块

cacti的安装与监控_安装_52

cacti的安装与监控_安装_53

cacti的安装与监控_target_54

cacti的安装与监控_安装_55

cacti的安装与监控_border_56

cacti的安装与监控_blank_57

mysql监控信息

cacti的安装与监控_安装_58

模块管理组件

安装插件管理器

[root@localhost ~]# cd cacti/

[root@localhost cacti]# tar -zxvf cacti-plugin-0.8.7g-PA-v2.8.tar.gz

[root@localhost cacti]# cp -R cacti-plugin-arch/* /var/www/html/cacti/

进入cacti的目录

[root@localhost cacti]# cd /var/www/html/cacti/

[root@localhost cacti]# mysql -ucacti -pcacti cacti &lt;pa.sql

打补丁

[root@localhost cacti]# patch -p1 -N &lt;cacti-plugin-0.8.7g-PA-v2.8.diff

编辑php的配置文件

[root@localhost cacti]# vim include/config.php

改变url路径为 /cacti/

cacti的安装与监控_blank_59

拆解插件

[root@localhost cacti]# tar -zxvf monitor-latest.tgz

[root@localhost cacti]# tar -zxvf thold-latest.tgz

[root@localhost cacti]# tar -zxvf settings-latest.tgz

安装插件

[root@localhost cacti]# mv monitor-0.9/ /var/www/html/cacti/plugins/monitor

[root@localhost cacti]# mv thold-0.41/ /var/www/html/cacti/plugins/thold

[root@localhost cacti]# mv settings-0.6/ /var/www/html/cacti/plugins/settings

添加管理控制plugin management

cacti的安装与监控_target_60

cacti的安装与监控_blank_61

到控制台中启用插件

cacti的安装与监控_的_62

cacti的安装与监控_border_63

安装成功

cacti的安装与监控_安装_64