pandorafms/pandora_agents/unix/plugins/pandora_netusage

15 lines
401 B
Plaintext
Raw Normal View History

2014-09-22 11:27:35 +02:00
#!/bin/bash
OUT=`netstat -as | grep "OutOctets" | awk '{ print $2 }'`
IN=`netstat -as | grep "InOctets" | awk '{ print $2 }'`
TOTAL=`expr $OUT + $IN`
echo "<module>"
echo " <name>Network_Usage_Bytes</name>"
echo " <type>generic_data_inc</type>"
echo " <data>$TOTAL</data>"
echo " <unit>bytes/sec</unit>"
echo " <description>Total bytes/sec transfered in this system</description>"
echo "</module>"