On Wed, Apr 02, 2008 at 08:53:32PM +1100, [EMAIL PROTECTED] 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:
> 
> [EMAIL PROTECTED] ~]# snmpget -c public -v 1 -Oqv 192.168.1.1 ifInOctets.
> 12767494300
O.K.

> The database was created as follows:
> 
> [EMAIL PROTECTED] ~]# 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.
> 
> [EMAIL PROTECTED] ~]# 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...]
> 
>                       [EMAIL PROTECTED]:value...]
> 
>                       [ time:value[:value...] ..]
> 
> ERROR: not a simple integer: 'snmpget -c public -v 1 -Oaqv 192.168.1.1
> ifInOctets.1'
> [EMAIL PROTECTED] ~]#
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

Attachment: pgpKwtC2qfhcI.pgp
Description: PGP signature

_______________________________________________
rrd-users mailing list
[email protected]
https://lists.oetiker.ch/cgi-bin/listinfo/rrd-users

Reply via email to