Dit geeft de verschillen weer tussen de geselecteerde revisie en de huidige revisie van de pagina.
| 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 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:: | ||
| - | | + | |
| + | | ||
| + | |||
| + | inoct_2=$(snmpget -v 1 localhost -c public IF-MIB:: | ||
| outoct_2=$(snmpget -v 1 localhost -c public IF-MIB:: | outoct_2=$(snmpget -v 1 localhost -c public IF-MIB:: | ||
| - | | + | |
| + | in_traffic=$[((inoct_2 * 8) - (inoct_1 * 8)) / 5] | ||
| + | | ||
| + | #echo $in_traffic | ||
| + | echo $in_traffic > / | ||
| + | #echo $out_traffic | ||
| echo $out_traffic >> / | echo $out_traffic >> / | ||