Skip to content

Commit

Permalink
Simplify netgraph.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
MasseR committed May 4, 2012
1 parent 56f1d2b commit 3b77f65
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions bin/netgraph.sh
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ datafile=$datadir/net.rrd


graph() graph()
{ {
local imagefile=$1 local imagefile=$datadir/"net_${interface}_$1.png"
local starttime=$2 local starttime=$2
local incolor='#00FF00' local incolor='#00FF00'
local outcolor='#FF0000' local outcolor='#FF0000'
Expand All @@ -26,27 +26,22 @@ graph()
GPRINT:bytes_out_kilo:MAX:"Max out\: %5.2lfkbps" \ GPRINT:bytes_out_kilo:MAX:"Max out\: %5.2lfkbps" \
LINE1:bytes_in$incolor:"Bytes in" \ LINE1:bytes_in$incolor:"Bytes in" \
LINE1:bytes_out$outcolor:"Bytes out" LINE1:bytes_out$outcolor:"Bytes out"
echo "Wrote $imagefile"
} }


graph_hourly() graph_hourly()
{ {
local imagefile=$datadir/net_hour.png graph "hour" "-3600"
graph $imagefile "-3600"
echo "Wrote $imagefile"
} }


graph_daily() graph_daily()
{ {
local imagefile=$datadir/net_day.png graph "day" "-86400"
graph $imagefile "-86400"
echo "Wrote $imagefile"
} }


graph_weekly() graph_weekly()
{ {
local imagefile=$datadir/net_week.png graph "week" "-604800"
graph $imagefile "-604800"
echo "Wrote $imagefile"
} }


graph_hourly graph_hourly
Expand Down

0 comments on commit 3b77f65

Please sign in to comment.