Gebruikershulpmiddelen

Site-hulpmiddelen


werkinstructies:snmp:monitoring_centos7

Verschillen

Dit geeft de verschillen weer tussen de geselecteerde revisie en de huidige revisie van de pagina.

Link naar deze vergelijking

Beide kanten vorige revisie Vorige revisie
werkinstructies:snmp:monitoring_centos7 [2016/08/25 21:04]
abel [Eeen custom OID/MIB maken]
werkinstructies:snmp:monitoring_centos7 [2016/08/25 22:38] (huidige)
abel [Eeen custom OID/MIB maken]
Regel 78: Regel 78:
 #!/bin/bash #!/bin/bash
  
-while true +while true
 do do
  
-  #haal de cumulatieve waarde van de input octets op elke seconde en deel het verschil door +  #haal de cumulatieve waarde van de input en output  octets op elke seconde en deel het verschil door 5
-  inoct_1=$(snmpget -v 1 localhost -c public IF-MIB::ifInOctets.2 | cut -d' ' -f4) +
-  sleep 3 +
-  inoct_2=$(snmpget -v 1 localhost -c public IF-MIB::ifIntOctets.2 | cut -d' ' -f4) +
-  in_traffic= $[((inoct_2 * 8) - (inoct_1 * 8)) / 3] +
-  echo $in_traffic > /var/tmp/nettraffic+
  
-  #haal de cumulatieve waarde van de output octets op elke 3 seconde en deel het verschil door 3+  inoct_1=$(snmpget -v 1 localhost -c public IF-MIB::ifInOctets.2 | cut -d' ' -f4)
   outoct_1=$(snmpget -v 1 localhost -c public IF-MIB::ifOutOctets.2 | cut -d' ' -f4)   outoct_1=$(snmpget -v 1 localhost -c public IF-MIB::ifOutOctets.2 | cut -d' ' -f4)
-  sleep 3+ 
 +  sleep 
 + 
 +  inoct_2=$(snmpget -v 1 localhost -c public IF-MIB::ifInOctets.2 | cut -d' ' -f4)
   outoct_2=$(snmpget -v 1 localhost -c public IF-MIB::ifOutOctets.2 | cut -d' ' -f4)   outoct_2=$(snmpget -v 1 localhost -c public IF-MIB::ifOutOctets.2 | cut -d' ' -f4)
-  out_traffic= $[((outoct_2 * 8) - (outoct_1 * 8)) / 3]+ 
 +  in_traffic=$[((inoct_2 * 8) - (inoct_1 * 8)) / 5] 
 +  out_traffic=$[((outoct_2 * 8) - (outoct_1 * 8)) / 5] 
 +  #echo $in_traffic 
 +  echo $in_traffic > /var/tmp/nettraffic 
 +  #echo $out_traffic
   echo $out_traffic >> /var/tmp/nettraffic   echo $out_traffic >> /var/tmp/nettraffic
  
werkinstructies/snmp/monitoring_centos7.1472151891.txt.gz · Laatst gewijzigd: 2016/08/25 21:04 door abel