pandorafms/pandora_agents/unix/plugins/pandora_netusage

16 lines
509 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>"
2015-07-07 12:43:34 +02:00
echo " <name><![CDATA[Network_Usage_Bytes]]></name>"
echo " <type><![CDATA[generic_data_inc]]></type>"
echo " <data><![CDATA[$TOTAL]]></data>"
echo " <unit><![CDATA[bytes/sec]]></unit>"
echo " <description><![CDATA[Total bytes/sec transfered in this system]]></description>"
echo " <module_group>Networking</module_group>"
echo "</module>"