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 19:40] abel [configuratie] |
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 | ||
| + | do | ||
| - | #haal de cumulatieve waarde van de input octets op | + | |
| + | inoct_1=$(snmpget -v 1 localhost -c public IF-MIB:: | ||
| + | outoct_1=$(snmpget -v 1 localhost -c public IF-MIB:: | ||
| - | #haal de cumulatieve waarde van de output octets op | + | sleep 5 |
| - | </ | + | |
| + | inoct_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] | ||
| + | out_traffic=$[((outoct_2 * 8) - (outoct_1 * 8)) / 5] | ||
| + | | ||
| + | echo $in_traffic > / | ||
| + | #echo $out_traffic | ||
| + | echo $out_traffic >> / | ||
| + | |||
| + | done | ||
| + | </ | ||