Skip to content
Snippets Groups Projects
Commit e6fd5dac authored by edileuton's avatar edileuton
Browse files

agent: Modify netusage xml


Signed-off-by: default avataredileuton <edileuton@gmail.com>
parent f595272c
No related branches found
No related tags found
No related merge requests found
......@@ -39,17 +39,18 @@ function xml_print()
{
local TRAFFIC_TIME=$(printf "%02d:%02d:30" $TRAFFIC_HOUR $TRAFFIC_MINUTE)
printf "<netuse id=\"$((COUNT+1))\">"
printf "<date value=\"$TRAFFIC_DATE\" type=\"string\"/>"
printf "<time value=\"$TRAFFIC_TIME\" type=\"string\"/>"
printf "<netuse>"
printf "<id>$((COUNT+1))</id>"
printf "<rx>"
printf "<packets value=\"$(awk '{ print $2 }' <<< $line)\" type=\"int\"/>"
printf "<bytes value=\"$(awk '{ print $3 }' <<< $line)\" type=\"int\"/>"
printf "<rx-packets>$(awk '{ print $2 }' <<< $line)</rx-packets>"
printf "<rx-bytes>\"$(awk '{ print $3 }' <<< $line)</rx-bytes>"
printf "</rx>"
printf "<tx>"
printf "<packets value=\"$(awk '{ print $4 }' <<< $line)\" type=\"int\"/>"
printf "<bytes value=\"$(awk '{ print $5 }' <<< $line)\" type=\"int\"/>"
printf "<tx-packets>$(awk '{ print $4 }' <<< $line)</tx-packets>"
printf "<tx-bytes>$(awk '{ print $5 }' <<< $line)</tx-bytes>"
printf "</tx>"
printf "<date>$TRAFFIC_DATE</date>"
printf "<time>$TRAFFIC_TIME</time>"
printf "</netuse>"
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment