kidys 发表于 2019-1-9 13:27:02

cacti 监控

  cacti监控主机安装
  # yum install -y epel-release ; yum install -y httpd php php-mysql mysql mysql-server mysql-devel php-gd libjpeg libjpeg-devel libpng libpng-devel ; yum install -y cacti net-snmp net-snmp-utils rrdtool
  # vi /etc/httpd/conf.d/cacti.conf
  大概22行的位置,把"Deny from all" 改为"Allow from all"
  # /etc/init.d/mysqld restart ; /etc/init.d/httpd restart ; /etc/init.d/snmpd restart

  # mysql -uroot-e "create database cacti" ; mysql -uroot -e "grant all on cacti.* to 'cacti'@'127.0.0.1'>  # vi /usr/share/cacti/include/config.php
  # 大概26-32行,修改内容如下
  $database_type = "mysql";
  $database_default = "cacti";
  $database_hostname = "127.0.0.1";
  $database_username = "cacti";
  $database_password = "cacti";
  $database_port = "3306";
  $database_ssl = false;
  web操作,访问http://192.168.10.29/cacti/,点两下“next”和一次”Finish“ 即可。输入默认用户名admin密码admin 登录,第一次登陆必须重新设置新的密码
  # vi /etc/php.ini
  date.timezone = 'Asia/Chongqing'
  # /usr/bin/php /usr/share/cacti/poller.php
  # crontab -e
  */5 * * * */usr/bin/php /usr/share/cacti/poller.php
  cacti添加客户端(被监控主机)
  # yum install -y net-snmp
  # vi /etc/snmp/snmpd.conf
  syslocation Unknown (edit /etc/snmp/snmpd.conf)
  syscontact Root(configure /etc/snmp/snmp.local.conf)
  # 修改为
  syslocation 10.39
  syscontact Root a945168@163.com
  # 另还有两处需要修改
  access notConfigGroup "" any noauth exact all none none
  view all included .1 80
  # /etc/init.d/snmpd start
  到cacti主机用 web登陆cacti后台,看图操作
  图一、
http://s2.运维网.com/wyfs02/M02/78/D2/wKiom1aDqDjhzlc-AAE-sGXARTo529.png
  图二、
http://s4.运维网.com/wyfs02/M02/78/D1/wKioL1aDqnOyd6eHAAFMd_U3cbw758.png
  图三、
http://s5.运维网.com/wyfs02/M02/78/D3/wKiom1aDqsSiJU30AACTeRPnsWs593.png
  图四、
http://s3.运维网.com/wyfs02/M00/78/D3/wKiom1aDq0jjS3w1AABVTqGqwDs198.png
  图五、
http://s4.运维网.com/wyfs02/M01/79/1E/wKiom1aJ0DfSQzG3AABsoxNsBWA286.png
  图六、
http://s3.运维网.com/wyfs02/M02/79/1C/wKioL1aJ0KLQl6mSAACFPlz-cnk214.png
  图七、
http://s2.运维网.com/wyfs02/M00/79/1E/wKiom1aJ0L3DJLDtAABhe-HFlkU518.png
  图八、
http://s1.运维网.com/wyfs02/M01/79/1C/wKioL1aJ0RmRoDknAACTAxH5-KU616.png
  到监控主机上使用命令强制刷新
  # /usr/bin/php /usr/share/cacti/poller.php --force
  至此监控搭建完毕

页: [1]
查看完整版本: cacti 监控