snmp result not valid (-U) when fetching integer value

Post support questions that directly relate to Linux/Unix operating systems.

Moderators: Developers, Moderators

Post Reply
henrik
Posts: 5
Joined: Thu Feb 24, 2005 5:03 am

snmp result not valid (-U) when fetching integer value

Post by henrik »

Hello,

I have a hopefully easy question. I am trying to graph cpu workload with current cacti version and ucd-snmp.

Whenever I try to fetch an INTEGER snmp value I get the error message:

Result from SNMP not valid. Partial Result:
02/27/2005 02:05:02 PM - CMDPHP: Poller[0] Host[1] SNMP: v1: 127.0.0.1, dsname: cpuidle, oid: .1.3.6.1.4.1.2021.11.11, out
put: U

If I do an snmpwalk I can fetch the corresponding value:

snmpwalk -v 1 -c public 127.0.0.1 .1.3.6.1.4.1.2021.11.11
UCD-SNMP-MIB::ssCpuIdle.0 = INTEGER: 97

What I recognized is that the problem always occured when I tried to fetch an INTEGER snmp value. For all others (e.g. STRING, GAUGE) it works fine.

What am I doing wrong ? I´m using the default GET SNMP template to fetch the data. Is it not possible to fetch INTEGER values ?

Any hint would be highly appreciated :-)

Thanks !!
User avatar
TheWitness
Developer
Posts: 17007
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Post by TheWitness »

Please provide you versions, Cacti, net/ucd-snmp, MySQL, Cactid, etc. Also, please provide the Graph Template you are using to graph.

Thanks,

TheWitness
True understanding begins only when we realize how little we truly understand...

Life is an adventure, let yours begin with Cacti!

Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages


For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
henrik
Posts: 5
Joined: Thu Feb 24, 2005 5:03 am

Post by henrik »

Hello,

I´m using Cacti cacti-0.8.6c-1 together with net-snmp-5.0.6-17 (rh 9) and mysql mysql-3.23.54a-11. Attached you will find the graph and one example data template.
I don´t use cactid. I´m gathering the data direct from the oid.

Thank you very much !!

Henrik
Attachments
cacti_graph_template_performance_monitor.xml
(14.07 KiB) Downloaded 146 times
cacti_data_template_performance_cpu_idle.xml
(5.52 KiB) Downloaded 164 times
henrik
Posts: 5
Joined: Thu Feb 24, 2005 5:03 am

Post by henrik »

I just tried the same configuration under fedora core 3 - exactly the same problem. So I don´t think it´s a problem with the versions (cacti 0.8.6c, mysql 3.23.58-14, php 4.3.10-3.2, net-snmp 5.1.2-11)
It seems to be a basic problem with my template design.

Henrik
henrik
Posts: 5
Joined: Thu Feb 24, 2005 5:03 am

Solved

Post by henrik »

Ok, I solved it by myself. Very simple ;-)
.....
A common mistake when using the snmpget command is to leave off the index into the data you're looking for. In the above commands, the variable requested by the OID is a scalar and the index to scalars is always a simple '0' (zero), hence the trailing '.0' in all the oids above. If you had left it off, you would have gotten an error. Note that the errrors differ slightly between SNMPv1 and SNMPv2c:

snmpget -v 2c -c public 127.0.0.1 UCD-SNMP-MIB::ssCpuIdle
Error in packet Reason: (noSuchName) There is no such variable name in this MIB.
This name doesn't exist: system.sysUpTime

Or, depends on the snmp version: No Such Instance currently exists
....

So just put the .0 behind the OID and everthing works fine:
snmpget -v 2c -c public 127.0.0.1 UCD-SNMP-MIB::ssCpuIdle.0

Hope that helps others !

Henrik
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest