[rrd-users] Newbie rrdupdate question

Alex van den Bogaerdt alex at ergens.op.het.net
Sun Jan 27 05:42:39 CET 2008

On Sat, Jan 26, 2008 at 06:54:59PM -0800, Husky wrote:

> The following command works:
> $ sudo rrdupdate /usr/local/rrd/temp.rrd N:7280

This means RRDtool is not the problem.

You may now understand that this list may not be the preferred
source for help. I suggest you look for a darwin-specific forum.

However... with virtually no knowledge on this, I still think I
can give you some pointers.
(I assume here that your OS is very unix-like).

> The command I want to use fails in the following way:
> $ sudo rrdupdate /usr/local/rrd/temp.rrd N:'snmpget -v 1 -c public -0qv
> SNMPv2-SMI::enterprises.20916.'
> ERROR: expected 1 data source readings (got 3) from snmpget ...

It seems RRDtool sees "snmpget". That probably means you shouldn't use
"forward tick" (next to the enter key on my keyboard) but rather the
"backward tick" (just above tab on my keyboard).

Thus:  ` and not '  ,  ascii code 96 instead of 39

> Temp.rrd is defined with 1 data source.  The snmpget seems to return 1
> value.  When I use it in the rrdupdate it seems to find 3 values returned
> from the snmpget.  I am new to rrdtool, new to snmp, and fairly new to Mac
> OS X, which is where I am trying this, so there is much room for me doing
> something wrong.  Any help would be appreciated.
> Thanks

Break down your problem into smaller pieces.  You can probably display
"Hello, world".  Now write a script that does this, and try insert
the output of your snmpget command: "Hello, 7280 world"

When that works, try replacing "echo" or "print" or whatever you use,
by rrdupdate (and, obviously, remove hello world).

If that doesn't work, change "rrdupdate"... in "echo rrdupdate"...
(or similar). Then use "od -tx1" (or similar, perhaps "hexdump")
to spot problems and work from there.

For instance:

echo rrdupdate /usr/local/rrd/temp.rrd N:`snmpget -v 1 -c public -0qv
> SNMPv2-SMI::enterprises.20916.` | od -tx1

is expected to produce something ending in 4E 3A 37 32 38 30 0A

Alex van den Bogaerdt

More information about the rrd-users mailing list