[rrd-users] Re: RRD Tutorial - Question -Real World Example

Todd Caine todd_caine at eli.net
Fri Mar 1 20:16:16 MET 2002


The program runs in a loop forever collecting in/out octet counts every 5
seconds for the interface that was assigned an interface index of 1.  If you
want to run a command in the background just start it up like normal but follow
it with an ampersand, e.g.:  # ./collect.sh &

You might also want to use nohup like so:

# nohup /home/foo/collect.sh &

see 'man nohup' for more information.



Alex Kourafas wrote:

> Can anyone tell me why the command below runs but returns nothing to the
> screen and I dont have a
> command prompt?
> Is this correct? If so how do I run it in the backround?
>
> Thanks
>
> #!/bin/sh
>  while (true)
>  do
>    input=`snmpwalk server public interfaces.ifTable.ifEntry.ifInOctets.1 | awk
> -- ' BEGIN { FS = " " }{print $2 } '`
>    output=`snmpwalk server public interfaces.ifTable.ifEntry.ifOutOctets.1 |
> awk -- ' BEGIN { FS = " " } print $2 } '`
>    DATE=`date +%s`
>
>    /usr/local/rrdtool-1.0.33/bin/./rrdtool update myrouter.rrd
> $DATE:$input:output
>    echo $DATE - $input - $output
>    sleep 5
>  done


--
Unsubscribe mailto:rrd-users-request at list.ee.ethz.ch?subject=unsubscribe
Help        mailto:rrd-users-request at list.ee.ethz.ch?subject=help
Archive     http://www.ee.ethz.ch/~slist/rrd-users
WebAdmin    http://www.ee.ethz.ch/~slist/lsg2.cgi



More information about the rrd-users mailing list