[rrd-users] ERROR: not a simple integer:
Andreas Maus
a.maus at science-computing.de
Wed Apr 2 12:01:41 CEST 2008
On Wed, Apr 02, 2008 at 08:53:32PM +1100, secrookie at gmail.com wrote:
> Hello,
Hi.
> I would like to ask for some assistance. I am trying log bandwidth
> data from a cisco device with rrdtool.
>
> I can get data from snmpget at the command line:
>
> [root at localhost ~]# snmpget -c public -v 1 -Oqv 192.168.1.1 ifInOctets.
> 12767494300
O.K.
> The database was created as follows:
>
> root at localhost ~]# rrdtool create inside.rrd -s 300
> DS:in:COUNTER:600:U:U DS:out:COUNTER:600:U:U RRA:AVERAGE:0.5:1:576
> RRA:AVERAGE:0.5:6:672 RRA:AVERAGE:0.5:24:732 RRA:AVERAGE:0.5:144:1460
O.K.
> Updated as follows - basically 2 data source values for in and out.
>
> [root at localhost ~]# rrdupdate /var/lib/rrd/outside.rrd N:'snmpget -c
> public -v 1 -Oqv 192.168.1.1 ifInOctets.1' N:'snmpget -c public -v 1
> -Oqv 192.168.1.1 ifOutOctets.1'
>
> RRDtool 1.2.99907080300 Copyright by Tobi Oetiker, 1997-2007
>
> Usage: rrdupdate filename
> [--template|-t ds-name:ds-name:...]
> time|N:value[:value...]
>
> at-time at value[:value...]
>
> [ time:value[:value...] ..]
>
> ERROR: not a simple integer: 'snmpget -c public -v 1 -Oaqv 192.168.1.1
> ifInOctets.1'
> [root at localhost ~]#
Read the error message again!
You run rrdupdate /var/lib/rrd/outside.rrd N:'snmpget -c ...
This is not what you want! You have to fix your quoting.
You want something like rrdupdate /var/lib/rrd/outside.rrd N:`snmpget -c ...
(Notice the backtic ` instead the single quote ' !)
Anyway I recommend storing the output inside a shell variable like:
in1=`snmpget -c public -v 1 -Oqv 192.168.1.1 ifInOctets.1`
and use this in your rrdtool call:
rrdtool update ... "N:${in1} ...
This would result in a more readable code ;)
HTH,
Andreas.
--
Dipl.-Ing. Andreas Maus science+computing ag
System Administration Hagellocher Weg 73
tel.: +49 7071 9457 671 72070 Tuebingen, Germany
fax: +49 7071 9457 411 www.science-computing.de
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://lists.oetiker.ch/pipermail/rrd-users/attachments/20080402/94d6e522/attachment.bin
More information about the rrd-users
mailing list