监控软件cacti添加主机

简介:

1.在被监控主机安装snmp服务

[root@db01 ~]# yum install net-snmp* -y 

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

access notConfigGroup "" any noauth exact all none none   #取消注释(systemview修改为all)

view all    included  .1   80   #取消注释

view mib2   included  .iso.org.dod.internet.mgmt.mib-2 fc  #取消注释

com2sec notConfigUser  cacti服务端IP  public      #添加一行

[root@db01 ~]# vim /etc/sysconfig/iptables

-A INPUT -m state --state NEW -m udp -p udp --dport 161 -s cacti服务器地址 -j ACCEPT

[root@db01 ~]# /etc/init.d/snmpd restart

Stopping snmpd:            [FAILED]

Starting snmpd:        [  OK  ]

[root@db01 ~]# /etc/init.d/iptables restart

iptables: Setting chains to policy ACCEPT: filter   [  OK  ]

iptables: Flushing firewall rules:      [  OK  ]

iptables: Unloading modules:       [  OK  ]

iptables: Applying firewall rules:     [  OK  ]

[root@db01 ~]# 


2.在cacti服务器主机添加客户机

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

access  notConfigGroup "" any   noauth  exact  all   none none

view all    included  .1    80

view mib2   included  .iso.org.dod.internet.mgmt.mib-2 fc

com2sec notConfigUser   all  public

proc mountd

proc ntalkd 4

proc sendmail 10 1

disk / 10000

load 12 14 14

[root@db02 thold]# /etc/init.d/snmpd restart

Stopping snmpd:       [  OK  ]

Starting snmpd:      [  OK  ]

[root@db02 thold]# 

[root@db02 rra]# snmpwalk -c public -v 2c 客户机IP地址 if    #输出网卡信息

IF-MIB::ifIndex.1 = INTEGER: 1

IF-MIB::ifIndex.2 = INTEGER: 2

IF-MIB::ifIndex.3 = INTEGER: 3

IF-MIB::ifDescr.1 = STRING: lo

IF-MIB::ifDescr.2 = STRING: eth0

IF-MIB::ifDescr.3 = STRING: eth1

IF-MIB::ifType.1 = INTEGER: softwareLoopback(24)


3.在cacti界面添加客户主机(被控端)

wKioL1dRMBqjIK8IAACDnn7mCZs988.png-wh_50

wKioL1dRMBqwVU5rAABUszyhaq8248.png-wh_50

wKiom1dRLxrCXS0MAAC-Rik8u84330.png-wh_50

wKiom1dRLxqCDjp1AADk5jMLWbo253.png-wh_50

wKioL1dRMBzD6-puAABKm_qw4mQ526.png-wh_50

wKioL1dRMBzCUvJMAAB_3Yrjrlo822.png-wh_50

wKiom1dRLxuhUICpAABtJrVgRvM340.png-wh_50


4.在cacti服务端强制生成图形

[root@db02 rra]# /usr/bin/php /var/www/html/cacti/poller.php --force

[root@db02 rra]# chown  apache:apache /var/www/html/cacti/rra/*

等会就出图了

wKiom1dRL_azlF2-AACgSFdBpMg831.png-wh_50










本文转自 z597011036 51CTO博客,原文链接:http://blog.51cto.com/tongcheng/1785824,如需转载请自行联系原作者
目录
相关文章
|
25天前
|
监控 数据可视化 BI
服务器监控软件Zabbix
【10月更文挑战第19天】
39 6
|
监控 安全 虚拟化
使用Cacti监控Esxi
cacti esxi
2167 0
|
Web App开发 关系型数据库 测试技术
|
监控 关系型数据库 MySQL
|
关系型数据库 PHP Apache