Dit geeft de verschillen weer tussen de geselecteerde revisie en de huidige revisie van de pagina.
| 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 3 seconde en deel het verschil door 3 | + | #haal de cumulatieve waarde van de input en output |
| - | inoct-1=$(snmpget -v 1 localhost -c public IF-MIB:: | + | |
| - | sleep 3 | + | |
| - | inoct-2=$(snmpget -v 1 localhost -c public IF-MIB:: | + | |
| - | in-traffic= $[((inoct-2 * 8) - (inoct-1 * 8)) / 3] | + | |
| - | echo $in-traffic > / | + | |
| - | | + | |
| - | outoct-1=$(snmpget -v 1 localhost -c public IF-MIB:: | + | outoct_1=$(snmpget -v 1 localhost -c public IF-MIB:: |
| - | sleep 3 | + | |
| - | | + | sleep 5 |
| - | | + | |
| - | echo $out-traffic | + | |
| + | outoct_2=$(snmpget -v 1 localhost -c public IF-MIB:: | ||
| + | |||
| + | | ||
| + | out_traffic=$[((outoct_2 * 8) - (outoct_1 | ||
| + | | ||
| + | echo $in_traffic > / | ||
| + | #echo $out_traffic | ||
| + | echo $out_traffic | ||
| done | done | ||