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
Volgende revisie
Vorige revisie
werkinstructies:snmp:monitoring_centos7 [2016/08/25 21:01]
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 -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 + 
-  outoct-2=$(snmpget -v 1 localhost -c public IF-MIB::ifOutOctets.2 | cut -d' ' -f4) +  sleep 
-  out-traffic= $[((outoct-2 * 8) - (outoct-* 8)) / 3+ 
-  echo $out-traffic >> /var/tmp/nettraffic+  inoct_2=$(snmpget -v 1 localhost -c public IF-MIB::ifInOctets.| cut -d' ' -f4) 
 +  outoct_2=$(snmpget -v 1 localhost -c public IF-MIB::ifOutOctets.2 | cut -d' ' -f4) 
 + 
 +  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
  
 done done
werkinstructies/snmp/monitoring_centos7.1472151699.txt.gz · Laatst gewijzigd: 2016/08/25 21:01 door abel