cheng029 发表于 2019-1-11 08:54:01

cacti网络流量监测图形分析工具的搭建

  环境:Red Hat Enterprise Linux Server release 6.0 mysql-5.1.57    php-5.3.4rrdtool-1.3.8   net-snmp-5.5-27nginx-1.2.3

  yum install rrdtool -y

  /etc/init.d/mysqld   start      #启动mysql   

  /etc/init.d/php-fpm start      #启动php
  vi /usr/local/nginx/conf/nginx.conf

  usernginx nginx;
worker_processes 2;
events {
    use epoll;
    worker_connections1024;
}
http {
    include       mime.types;
    default_typeapplication/octet-stream;
    sendfile      on;
    keepalive_timeout65;
    server {
      listen       80;
      server_namelocalhost;
       location / {
            root   html;
            indexindex.html index.php index.htm;
      }
      error_page   500 502 503 504/50x.html;
      location = /50x.html {
            root   html;
      }
      location ~ \.php$ {
            root         html;
            fastcgi_pass   127.0.0.1:9000;
            fastcgi_indexindex.php;
            include      fastcgi.conf;
      }
    }

}
  nginx       #启动nginx
  yum install net-snmp-5.5-27.el6.x86_64 net-snmp-devel-5.5-27.el6.x86_64 net-snmp-utils-5.5-27.el6.x86_64   -y
  
  vi /etc/snmp/snmpd.conf
  
  找到并屏蔽
  com2sec notConfigUserdefault       public
  替换成
  com2sec local   localhost         public
com2sec mynetwork 192.168.0.0/24      public
  找到并屏蔽
  group   notConfigGroup v1         notConfigUser
group   notConfigGroup v2c         notConfigUser
  替换成
  group MyRWGroup v1         local

  group MyRWGroup v2c      local
group MyRWGroup usm      local
group MyROGroup v1         mynetwork
group MyROGroup v2c      mynetwork
group MyROGroup usm      mynetwork
  找到并屏蔽
  view    systemview   included      system
  替换成
  view all    included.1                               80
  找到并屏蔽
  accessnotConfigGroup ""      any       noauth    exactsystemview none none
  替换成
  access MyROGroup ""      any       noauth    exactall    none   none
access MyRWGroup ""      any       noauth    exactall    all    none
  找到并修改
  syslocation Unknown (edit /etc/snmp/snmpd.conf)      #版本号
syscontact Root(configure /etc/snmp/snmp.local.conf)    #指定发送邮件
   chkconfig snmpd on
  service snmpd start
   snmpwalk -v 1 -c public localhost IP-MIB::ipAdEntIfIndex   #测试
  IP-MIB::ipAdEntIfIndex.127.0.0.1 = INTEGER: 1
IP-MIB::ipAdEntIfIndex.192.168.0.65 = INTEGER: 2
关于snmpd.conf的修改可以参考
  http://www.cyberciti.biz/nixcraft/linux/docs/uniqlinuxfeatures/mrtg/mrtg_config_step_3.php
  未完待续。。。。。
  




页: [1]
查看完整版本: cacti网络流量监测图形分析工具的搭建