Cacti -- Advance Ping

一、搭建Cacti

1. 安装epel扩展源:yum install -y epel-release

2. 安装lamp环境:yum install -y httpd php php-mysql mysql mysql-server mysql-devel php-gd libjpeg libjpeg-devel libpng libpng-devel

3. 安装cacti及依赖包:yum install -y cacti net-snmp net-snmp-utils rrdtool

4. 创建cacti日志:mkdir /var/log/cacti ; chmod 777 /var/log/cacti ; touch /usr/share/cacti/log/cacti.log

5. 更改数据存放目录权限:chmod 777 /var/lib/cacti/rra

6. 关联数据库相关操作

   启动数据库: /etc/init.d/mysqld start
   登录mysql:mysql
   mysql> create database cacti;        //创建cacti库
   mysql> grant all on cacti.* to 'cacti'@'localhost' identified by 'cacti';    //创建cacti用户
   mysql> flush privileges;   //刷新权限
   mysql> exit

导入初始数据到cacti库:mysql cacti </usr/share/doc/cacti-0.8.8h/cacti.sql

7. 启动Apache:sed -i 's/#ServerName www.example.com:80/ServerName www.example.com:80/' /etc/httpd/conf/httpd.conf ; /etc/init.d/httpd start

8. 编辑snmp服务配置文件:vim /etc/snmp/snmpd.conf (红色为更改后)

   # Make at least snmpwalk -v 1 localhost -c public system fast again.
   # name incl/excl subtree mask(optional)
   view    systemview    included    .1.3.6.1.2.1
   view    systemview    included    .1.3.6.1.2.1.25.1.1
   view    all           included    .1
    
   # group context sec.model sec.level prefix read write notif
   access  notConfigGroup  ""  any  noauth  exact  all  none  none

9. 启动snmp服务:/etc/init.d/snmpd start

10. 编辑cacti配置文件:vim /usr/share/cacti/include/config.php (红色为修改后)

   $database_type = "mysql";
   $database_default = "cacti";
   $database_hostname = "localhost";
   $database_username = "cacti";
   $database_password = "cacti";
   $database_port = "3306";
   $database_ssl = false;

11. 编辑php配置文件,添加时区:vim /etc/php.ini

Cacti -- Advance Ping
 
12. 执行poller.php, 生成图形:/usr/bin/php /usr/share/cacti/poller.php
    crontab -e 添加:*/5 * * * * /usr/bin/php /usr/share/cacti/poller.php

11. 编辑:vim /etc/httpd/conf/httpd.conf,添加如下规则

<Directory /usr/share/cacti/>
       Order Deny,Allow
       Allow from all
   </Directory>

重启Apache:/etc/init.d/httpd restart

12. 关闭防火墙和SELinux:setenforce 0 ; iptables -F

13. 访问cacti:150.242.59.29/cacti

二、添加 Advance Ping 模块

1. 下载ss_fping.php脚本并放到/usr/share/cacti/scripts目录下:http://forums.cacti.net/download/file.php?id=3435&sid=02ab30ff1e848c79f3e76f04a2396fc1

2. 下载ping模块:http://forums.cacti.net/download/file.php?id=3436&sid=02ab30ff1e848c79f3e76f04a2396fc1

3. 导入ping模块(记得先解压)

Cacti -- Advance Ping

4. 添加对一个主机的监控,这里我以北京电信为主

Cacti -- Advance Ping

Cacti -- Advance Ping

Cacti -- Advance Ping

Cacti -- Advance Ping

Cacti -- Advance Ping

Cacti -- Advance Ping

Cacti -- Advance Ping

Cacti -- Advance Ping

Cacti -- Advance Ping

Cacti -- Advance Ping

Cacti -- Advance Ping

//一般配置完 Advance Ping 模块后5分钟才出图,所以配置完不出图请客官稍等5分钟

上一篇:转:java.sql.SQLException: [Microsoft][ODBC 驱动程序管理器] 未发现数据源名称并且未指定默认驱动程序


下一篇:Number Sequence (HDoj1005)