Cacti  install

需要的软件包 cacti

Httpd php php-mysql php-snmp mysql mysql-server

net-snmp net-snmp-utils net-snmp-devel net-snmp-libs

rrdtool

安装rrdtool需要三个软件包

rpm –ivh rrdtool-ver-1.el4.wrl.i386 rrdtool-devel-ver-1.el4.wrl.i386 rrdtool-perl-ver-1.el4.wrl.i386

这三个包要一起装。

tar  –zxvf  cacti-v.tar.gz –C /var/www/html

进入mysql数据库 执行

Create cacti    use cacti

[root@localhost cacti]# mysql cacti < cacti.sql

grant all on cacti.* to cacti@localhost identified by "123456";

flush privileges;

vi /var/www/html/cacti/include/config.php

  $database_default = "cacti";

$database_hostname = "localhost";

  $database_username = "cacti";

  $database_password = "123456"

Useradd  cacti  chown –R cacti /var/www/html/cacti/rrd /var/www/html/cacti/log

Crontab  –e

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

snmpd

1、  查找以下字段:

2、    sec.name  source          community

com2sec notConfigUser  default       public

"comunity" 字段改为你要设置的密码 . 比如 "public".                                            

“default” 改为你想哪台机器可以看到你的 snmp 信息 , 10.10.10 .10

服务端改为 127.0.0.1

 

2 、查找以下字段:

# Finally, grant the group read-only access to the systemview view.

#       group          context sec.model sec.level prefix read   write  notif

access  notConfigGroup ""      any       noauth    exact  all none none

"read" 字段改为 all.

 

3 、查找以下字段:

#           incl/excl subtree                          mask

#view all    included  .1                               80

将该行前面的 "#" 去掉 .

保存关闭 .

/etc/init.d/snmpd start

安装cacti     第一步 一个全新的安装   第二部 完成即可

安装插件

目标功能:

    安装 monitor 插件,提供更简略、直观的设备状态图示;安装 thold 插件,提供设备异常预警。

安装 thold monitor 插件

    1、安装Plugin 补丁

shell> tar zxvf cacti-plugin-ver-tar.gz -C /var/www/html/cacti

shell> cd /var/www/html/cacti/

shell>cp –R /var/www/html/vavti-pligin/* /var/www/html/cacti

shell> patch -p1 -N < cacti-plugin-arch/cacti-plugin-0.8.7b-PA-v2.1.diff

shell> mysql -u cacti -p cacti < cacti-plugin-arch/pa.sql

注意:cacti-plugincacti版本要一致。否则出错

http://youserverip/cacti

utilities----user Management ----you’s admin(你的管理员的账户)

选择plugin Managemet 保存

2 、安装 thold monitor 插件

shell> tar zxvf settings-tar.gz -C /var/www/html/cacti/plugins

shell> tar zxvf thold-tar.gz -C /var/www/html/cacti/plugins

shell> tar zxvf monitor-tar.gz -C /var/www/html/cacti/plugins

shell> cd /var/www/cacti/plugins/

shell> mysql -u cacti -p cacti < thold/thold.sql

shell> mysql -u cacti -p cacti < monitor/monitor.sql

    3config.php配置文件

shell> vi /var/www/html/cacti/include/config.php

添加了这几行

$config[’url_path’] = "/cacti/";       

$plugins = array();

$plugins[] = thold;

$plugins[] = monitor;

Configuration中会出现plugin Managemet这个选项。选择自己需要的插件install并且激活enable

监控win设置

添加删除程序----添加删除程win组建-------管理和监控工具-----简单的网络管理协议(snmp

设置snmp service 属性代理填写联系人和位置

陷阱----团队名称----snmpd设置的名称   陷阱目标---填写监控服务器的IP

安全----接收团队名称---snmpd设置的名臣 接收来自这些主机的snmp数据包---监控服务器的IP