Nagios monitors the network when it reaches a set value, then the alarm
Take advantage of the resources available online to do the following:
https://github.com/cloved/check_traffic/releases Download the latest version of the shell script
Download check_traffic.sh V1.4.0, the attachment has been uploaded
#被监控端/Client
cd /usr/local/nagios/libexec/ #下载此脚本chmod 755 check_traffic.sh# yum install net-snmp-utils net-snmp net-snmp-libs bc -y #因脚本里面需要用到bc # mv /etc/snmp/snmpd.conf /etc/snmp/snmpd.conf.bak# vim /etc/snmp/snmpd.conf #配置snmp # cat /etc/snmp/ snmpd.conf|grep -v ^\# |sed '/^$/d ' com2sec notconfiguser default 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 fcaccess notconfiggroup "" Any noauth exact all none nonesyslocation Unknown (edit /etc/snmp/snmpd.conf) syscontact root <[email protected]> (Configure /etc/snmp/snmp.local.conf) DONTLOGTCPWRAPPERSCONNECTS&NBSP;YES#&NBSP;SERVICE&NBSP;SNMPD&NBSP;START#&NBSP;SNMPD -L #测试snmp配置文件Error opening specified endpoint "" Server exiting with code 1# ./check _traffic.sh -v 2c -c public -h localhost -l -vvvv #测试本机的网口, The main value is the number List interface for host localhost after index. interface index 1 orresponding to lointerface index 2 orresponding to eth0interface index 3 orresponding to eth1# ./check_traffic.sh -V 2c -C public -H 127.0.0.1 -i 2 -w 2000,3000 -c 3001,5000 -k –bok - it Is the first time of this plugins to run, or some data file lost. we will get the data from the next time.# ll /var/tmp/check_traffic_127.0.0.1_2__itnms.hist_dat_64 #检查权限, the owning user and group are nagios# This script has help to explain, with-H view, above -I 2 is to monitor eth0,-w 2000,3000 is incoming 2000k/s, or send 3000k/s will prompt warning# -v 1|2c|3# Specify the version of snmp## -c community# specify the community## -h host# specify the host## -6 use 64 bit counter, ifHC* instead of if*.## -r use range inStead of single value in warning and critical threshold;## -i interface# Specify the interface## -N interface name# specify the interface name## -L List all Interfaces on specify host## -B/b Switch to B/s or bps, default is -b, bps## -K/M switch to k or m (bsp,b/s), default is -k
#被监控端/Client
Vim/usr/local/nagios/etc/nrpe.cfgcommand[check_traffic]=/usr/local/nagios/libexec/check_traffic.sh-v 2c-c Public -H 127.0.0.1-i 2-w 2000,4000-c 4000,6000-k-b# service nrped restart
#监控端/Service Side
vim /usr/local/nagios/etc/objects/linuxhost.cfgdefine host{ use mylinux-server,service-pnp Host_name 192_168_23_ 2 alias server tongji address 192.168.23.2 } vim /usr /local/nagios/etc/objects/linux13.cfgdefine service{ use linux-service,service-pnp host_name 192_168_1_2 service_description check network check_command check_nrpe!check_traffic }
When you're done, restart the Nagios and start collecting data, such as the following tips for about 2 minutes to see the graphical interface.
Pnp4nagios Version 0.6.24
Please check the "documentation for information" about the following error.
XML file "/usr/local/pnp4nagios/var/perfdata/192_168_1_2/check_network.xml" not found. <a href= "HTTP://DOCS.PNP4NAGIOS.ORG/FAQ/6" >read FAQ online</a>
file [line]:
application/models/data.php [312]:
Back
On the Nagios page you will see
650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M02/59/82/wKioL1TVtKrxU-KtAAF2YWxDtcg182.jpg "title=" Qq20150207144131.jpg "alt=" Wkiol1tvtkrxu-ktaaf2ywxdtcg182.jpg "/>
650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M01/59/82/wKioL1TVtSCzM_1xAAN9h1HCNAk383.jpg "title=" Qq20150207144232.jpg "alt=" Wkiol1tvtsczm_1xaan9h1hcnak383.jpg "/>
This graph will have in,out network card traffic, which can be verified on the server Ifstat
in addition, http://nagios.manubulon.com/ This site is also worth a look, there are http://nagios.manubulon.com/check_snmp_int.pl scripts that also enable monitoring of the network
This article is from the "back Line Swallow" blog, please make sure to keep this source http://bbotte.blog.51cto.com/6205307/1612660
Nagios's network monitoring