[rrd-users] Re: Help using rrdtool update

Alex van den Bogaerdt alex at slot.hollandcasino.nl
Wed Oct 20 19:15:06 MEST 1999


> I'm trying a very basic script to be run with cron to pump two values
> into a database (ifinoctets and ifoutoctets) - basically following the
> tutorial. Unfortunately, RRDTOOL is coredumping when I run this script..
> I wondered if anyone could take a look at it and suggest where I'm
> screwing up...?
> 

Core dump is not good in any case. If the input is wrong, it should
complain.

> Script :
> 
> #!/bin/ksh
> rrdarray[0]="`snmpget -v1 $1 $2 2.2.1.10.1 | awk '{print $3}'`"
> rrdarray[1]="`snmpget -v1 $1 $2 2.2.1.16.1 | awk '{print $3}'`"
> /apps/RRD/bin/rrdtool update /apps/RRD/mycsx.rrd N:`echo
> ${rrdarray[0]}`:`echo ${rrdarray[1]}`
> 

Two things:
1) make it more simple.
2) Try debugging

How?

1) Alter your scipt:
#!/bin/ksh
in="`snmpget -v1 $1 $2 2.2.1.10.1 | awk '{print $3}'`"
out="`snmpget -v1 $1 $2 2.2.1.16.1 | awk '{print $3}'`"
/apps/RRD/bin/rrdtool update /apps/RRD/mycsx.rrd N:$in:$out

2) Change "/apps/RRD/bin/rrdtool" into "echo" and inspect its output.

You may have spaces in the output of snmpget. Because of the quotes
these won't get removed. This may upset rrdtool.
-- 
   __________________________________________________________________
 / alex at slot.hollandcasino.nl                  alex at ergens.op.het.net \
| work                                                         private |
| My employer is capable of speaking therefore I speak only for myself |
+----------------------------------------------------------------------+

--
* To unsubscribe from the rrd-users mailing list, send a message with the
  subject: unsubscribe to rrd-users-request at list.ee.ethz.ch



More information about the rrd-users mailing list