One, is monitored end-linux
1. Install SNMP
Yum Install net-snmp*
2. Configuring SNMP
[[email protected] ~] #grep -v "^#" /etc/snmp/snmpd.conf |grep -v "^$" com2sec notconfiguser default publiccom2sec notconfiguser 192.168.80.132 publicgroup Notconfiggroup v1 notconfigusergroup notConfigGroup v2c notconfiguserview systemview included . 1.3.6.1.2.1.1view systemview included . 1.3.6.1.2.1.25.1.1access notconfiggroup "" any noauth exact all none noneview All included .1 80view mib2 included .iso.org.dod.internet.mgmt.mib-2 fcsyslocation Unknown ( edit /etc/snmp/snmpd.conf) syscontact root <[email protected]> (configure / etc/snmp/snmp.local.conf) Dontlogtcpwrappersconnects yes
3, confirm the normal operation of SNMP, and ensure that not by SELinux, firewall block
NETSTAT-ANPT |grep snmpservice iptables statussetenforce 0
Second, is monitored the end-windows
The test machine is windows7, and you can install the SNMP service in the Control Panel-----add feature
Open Service Manager via Services.msc. Locate the SNMP service, right-click Properties-Security. Add community name and monitor IP
650) this.width=650; "src=" Http://s4.51cto.com/wyfs02/M01/76/5B/wKiom1ZQbGqjykT_AABlmcPux_g325.png "title=" Snmp.png "alt=" Wkiom1zqbgqjykt_aablmcpux_g325.png "/>
Third, monitoring terminal-nagios
1. Install SNMP
Yum Install net-snmp*
2. Download the check_traffic.sh script and move to the Nagios plugin directory
[Email protected] ~]# grep-v "^$"/etc/nagios/resource.cfg |grep-v "^#" $USER 1$=/usr/lib64/nagios/plugins # #nagios插件存 Put directory [[email protected] ~]# CP check_traffic.sh/usr/lib64/nagios/plugins/
3. Define Commands
[[email protected] ~]# vim/etc/nagios/objects/commands.cfgdefine command{command_name check_traffic com Mand_line $USER 1/check_traffic.sh-v 2c-c public-h $HOSTADDRESS $-i $ARG 1$}
Describe the meanings of the next few parameters
The Check_traffic script mainly detects the information of the monitored machine by calling Snmpwalk.
-v Specifies the SNMP protocol version
-c Specifies the community (community) name.
-I index value, this one can be seen
-W warnning value, ARG2 and ARG3 respectively when the NIC's in and out traffic
-C critial Value
3. Define the service
Define service{use Local-service host_name 192.168.80.131 Check_command check_traffic!11-w 400,400-c 600,600}
Nagios monitors linux,windows host network card traffic via Check_traffic