Linux监控工具Cacti安装部署详解(2)

2.监控服务端2的资源及测试

A)在服务端2安装net-snmp及配置

[root@sever2 ~]# yum install net-snmp* -y          #安装

[root@sever2 ~]# cd /etc/snmp/

[root@sever2 snmp]# vim snmpd.conf                 #进入配置文件

 40 #      sec.name source          community

 41 #com2secnotConfigUser  default      public

 42 com2sec local    localhost          wen      #添加本地资源,名字任意(wen)

 43 com2sec mynetwork172.25.25.0/24      wen      #允许25网段的监控

 49 #group  notConfigGroup v1          notConfigUser

 50 #group  notConfigGroup v2c          notConfigUser

 51 group MyRWGroupv1        local

 52 group MyRWGroupv2c        local

 53 group MyRWGroupusm        local

 54 group MyROGroupv1        mynetwork

 55 group MyROGroupv2c        mynetwork

 56 group MyROGroupusm        mynetwork

 62 view    systemview    included  .1.3.6.1.2.1

 63 view    systemview    included  .1.3.6.1.2.1.25.1.1

 64 view all    included .1                              80

 69 #access  notConfigGroup ""      any      noauth    exact  systemview none none

 70 access MyROGroup""      any      noauth   exact  all    none  none

 71 access MyRWGroup""      any      noauth   exact  all    all   none

170 syslocation RHEL6.5        #类型

171 syscontact Root <mi@server2.example.com>      #出现问题时发送邮件的地址

331 disk / 10000                                  #允许监控磁盘

[root@sever2 snmp]# /etc/init.d/snmpd start        #开启

Starting snmpd:                                           [  OK  ]

[root@sever2 snmp]# snmpwalk -v 1 -c wen localhostIP-MIB::ipAdEntIfIndex  #测试数据,正常

IP-MIB::ipAdEntIfIndex.127.0.0.1 = INTEGER: 1

IP-MIB::ipAdEntIfIndex.172.25.25.2 = INTEGER: 2

在服务端1测试,正常

[root@sever1 ~]$ snmpwalk -v 1 -c wen 172.25.25.2IP-MIB::ipAdEntIfIndex   

IP-MIB::ipAdEntIfIndex.127.0.0.1 = INTEGER: 1

IP-MIB::ipAdEntIfIndex.172.25.25.2 = INTEGER: 2

[root@sever1 ~]$ snmpwalk -v 1 -c wen 172.25.25.2.1.3.6.1.4.1.2021.9

UCD-SNMP-MIB::dskIndex.1 = INTEGER: 1

UCD-SNMP-MIB::dskPath.1 = STRING: /

UCD-SNMP-MIB::dskDevice.1 = STRING:/dev/mapper/VolGroup-lv_root

UCD-SNMP-MIB::dskMinimum.1 = INTEGER: 10000

UCD-SNMP-MIB::dskMinPercent.1 = INTEGER: -1

UCD-SNMP-MIB::dskTotal.1 = INTEGER: 7853764

UCD-SNMP-MIB::dskAvail.1 = INTEGER: 6464416

UCD-SNMP-MIB::dskUsed.1 = INTEGER: 990400

UCD-SNMP-MIB::dskPercent.1 = INTEGER: 13

UCD-SNMP-MIB::dskPercentNode.1 = INTEGER: 6

UCD-SNMP-MIB::dskTotalLow.1 = Gauge32: 7853764

UCD-SNMP-MIB::dskTotalHigh.1 = Gauge32: 0

UCD-SNMP-MIB::dskAvailLow.1 = Gauge32: 6464416

UCD-SNMP-MIB::dskAvailHigh.1 = Gauge32: 0

UCD-SNMP-MIB::dskUsedLow.1 = Gauge32: 990400

UCD-SNMP-MIB::dskUsedHigh.1 = Gauge32: 0

UCD-SNMP-MIB::dskErrorFlag.1 = INTEGER: noError(0)

UCD-SNMP-MIB::dskErrorMsg.1 = STRING:

B)在图形界面添加设备及测试

选择add添加设备

wKioL1gZwuai89q8AABWFlP68EA197.png

依次填写设备名、ip、类型;将默认的public改写成文件里添加的名字(wen)选择create

wKioL1gZwuyhPEOcAAFwXXc76s8249.png

wKiom1gZwu6AhmfGAAB5XTMFhCc212.png

选择create之后,如下图,点击Create Graphs for this Host

wKioL1gZwu-Bh6P8AABLWftmGaI624.png

如下图选择,点击create,设备添加成功

wKiom1gZwvHhzRRnAADzVDmloQo922.png

点击Graph Trees之后,如图,点击Default Trees

wKioL1gZwvKgG_6zAABbknu2TUw551.png

如图,点击Add

wKiom1gZwvPTHP1lAADgVKIIV4g000.png

在Tree ltem Type中选择Host Host中选择server2 Round Robin Archive中选择5 Minute,点击create

wKioL1gZwvWhC_fTAADu0cFegJw032.png

C)测试  点击graphs

wKiom1gZwvfRV5fcAAEuiEeTt64160.png

等5分钟后刷新,如图:

wKioL1gZwviToykeAAEgXD1C_tc098.png

linux

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/5ed7c79b54e93ff4da990430fdb5043c.html