2014-09-22 11:27:35 +02:00
|
|
|
#!/bin/bash
|
2014-05-30 17:55:42 +02:00
|
|
|
|
|
|
|
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>"
|
2017-02-22 12:25:05 +01:00
|
|
|
echo " <module_group>Networking</module_group>"
|
2014-05-30 17:55:42 +02:00
|
|
|
echo "</module>"
|
|
|
|
|