15 lines
461 B
Bash
Executable File
15 lines
461 B
Bash
Executable File
#!/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><![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>"
|
|
|