Collecting other snmp data, some problems

Post general support questions here that do not specifically fall into the Linux or Windows categories.

Moderators: Developers, Moderators

Post Reply
ritter
Posts: 22
Joined: Tue Jan 22, 2002 7:00 pm
Location: Lake Forest, IL USA
Contact:

Post by ritter »

Greetings,

Congrats on a WONDERFULL program.

I have been trying to set up graphing of error rates from the MIBII spec, the OIDs are:

.1.3.6.1.2.1.2.2.1.14.1
.1.3.6.1.2.1.2.2.1.20.1

I am using the SNMP Data Input that came with cacti. I have created the graphs, and everything is generating fine except for one problem. There is no data being presented on the graph.

I watched the cron job output, and there is no error except for the swap collection error which is not related to this problem. I also looked at the cron job in the web interface of cacti to see what command was being used to fetch the data, and then ran that command in the shell manually to see what it returned.

The command was correct, and returned the OID and then the OID value. For example:
The OID was: .1.3.6.1.2.1.2.2.1.14.1
The Command was: snmpget -O neEXbqfsStv <router name> <community> .1.3.6.1.2.1.2.2.1.14.1
The value should be: 1295
The data returned via the command was: .1.3.6.1.2.1.2.2.1.14.1.1295

The graph has GPRINTs for max, average, and last, but they all show zeros. What am I doing wrong?

The URL for this is:

http://thor.lfc.edu/cacti/graph_view.php?action=tree

And check the "LFRouter Error Rate" entry.
Network Administrator
Lake Forest College
ritter
Posts: 22
Joined: Tue Jan 22, 2002 7:00 pm
Location: Lake Forest, IL USA
Contact:

Post by ritter »

I tried it witha different MIBII OID that saw much larger change in the OID's value, thinking that maybe it was an issue of the graph just not scaling the data, but I had the same exact problem of no data.
Network Administrator
Lake Forest College
ritter
Posts: 22
Joined: Tue Jan 22, 2002 7:00 pm
Location: Lake Forest, IL USA
Contact:

Post by ritter »

Ok, found the problem for the data missing, but the cause.

The graphs and the readouts are zero because the data in the rrd files is zero. The numbers are set to: 0.0000000000e+00 instead of NaN.

So the data input is updating into the rrd file, but the data is not getting there relative to the output I am seeing. (example, the OID contains some number like 1249, but 0.0000000000e+00 is getting into the rrd)

I wonder if the snmpget output is throwing it off, for example:

The OID was: .1.3.6.1.2.1.2.2.1.14.1
The Command was: snmpget -O neEXbqfsStv .1.3.6.1.2.1.2.2.1.14.1
The value should be: 1295
The data returned via the command was: .1.3.6.1.2.1.2.2.1.14.1.1295

rrd and the graphing understands 1295, but not .1.3.6.1.2.1.2.2.1.14.1.1295

Thoughts?
_________________
Network Administrator
Lake Forest College

<font size=-1>[ This Message was edited by: ritter on 2002-01-29 15:21 ]</font>
ritter
Posts: 22
Joined: Tue Jan 22, 2002 7:00 pm
Location: Lake Forest, IL USA
Contact:

Post by ritter »

I can't get just the OID value to print with the snmpget command. Does the SNMP Data Input, or the cmd.php doing any string parsing?

Otherwise, I can write a perl script to do the job and send it off to you to include in the distro.
Network Administrator
Lake Forest College
Guest

Post by Guest »

This page might give you some ideas on munging the output results -

http://www.midcoast.com/~jp/snmp.html


Nic
raX
Lead Developer
Posts: 2243
Joined: Sat Oct 13, 2001 7:00 pm
Location: Carlisle, PA
Contact:

Post by raX »

I will try and answer this question the best I can. The 'Get SNMP Data' script does no string parsing. It simply calls snmpget with all of the parameters and hopes to get a clean number back. I already realize that this is a problem since some versions of ucd-snmp do not return just a number; but the entire OID also.

The 'Get SNMP Network Data' does do string parsing. For *most* situations it is smart enough to strip off the leading OID that snmpget returns it. This data input source may be better off for what you are doing too since you seem to be gathering network interface info (correct me if I'm wrong).

It seems as though the solution to this problem would simply be to modify the 'Get SNMP Data' script to do a little more parsing. If you are interested in doing this; feel free. Otherwise I'll probably do it and include it in the next release.

One of the things you mentioned reminded me that I have to add support for NaN within cacti, which is very important. Whenever cacti gets bad data; it needs to detect this and feed rrdtool a NaN instead of the bad data.

Hope this helps,
-Ian
ritter
Posts: 22
Joined: Tue Jan 22, 2002 7:00 pm
Location: Lake Forest, IL USA
Contact:

Post by ritter »

The parsing is the problem I think. I could fix that, but I wonder if it would be better to add the MIB II error OIDs to the rest of the network data.

I would think that people would want to see this type of data. The problem is that it would not scale well when graphed with bandwith data because errors happen at a much smaller rate.
Network Administrator
Lake Forest College
raX
Lead Developer
Posts: 2243
Joined: Sat Oct 13, 2001 7:00 pm
Location: Carlisle, PA
Contact:

Post by raX »

Well, if anything it could at least be an option for the user to choose. Implimenting the error OID's would not be a half bad idea though. Perhaps a separate graph could be created with the error data.

-Ian
ritter
Posts: 22
Joined: Tue Jan 22, 2002 7:00 pm
Location: Lake Forest, IL USA
Contact:

Post by ritter »

It looks like one of the command options for snmpget is broken. snmpget appears to have a command option that just spits out the OID's value and not the OID itself.

I think that parsing should be added to the snmp data input regardless of how and where the error monitoring is added to cacti.

I am going to look at the snmpget issue a little further. I may not be following this right granted, but it looks like:

snmpget -O v <hostname> <community> <OID>

should print out just the value, but it doesn't. Regardless of that value is collected, parsing by Cacti would not be needed if this command option worked.

Nick
Network Administrator
Lake Forest College
DrMosh
Posts: 14
Joined: Mon Jan 28, 2002 7:00 pm
Contact:

Post by DrMosh »

It seems like what is happening is that -Ov prints also the counter/gauge size, so effectively, you get:

Counter32: = <result>

Instead of just <result>
ritter
Posts: 22
Joined: Tue Jan 22, 2002 7:00 pm
Location: Lake Forest, IL USA
Contact:

Post by ritter »

Yeah, that was my observation to, and maybe that is supposed to happen by intent of the author.

The only reason I mention it is that it seemed to be unintentional behavior, and that it could save cacti from doing parsing.
Network Administrator
Lake Forest College
jwiegley
Posts: 31
Joined: Mon Feb 04, 2002 7:00 pm

Post by jwiegley »

I second the vote for error OID collection. It is one of the best indications of network problem that administrators have a very difficult time troubleshooting if they can't or don't know how to see the error OIDs.</P>
I'ld also like the SNMP network script to fetch Counter64s instead of Counter32s for octets if Counter64 exists.</P>
As more people use cacti (and they will! this is a really, really well designed and organized application from a programming perspective.) More people will be using it to watch core router devices that have Multi-gig links such as OC12s.</P>
I have that problem right now.</P>
Anyhow. I really rely on the SNMP Interfaces page to automate my construction of data sources and graphs. Without that I was getting very tired entering in the hundreds of data sources and graphs I need in order to flesh out my whole network. So it would be nice to be able to automate the error and Counter64 OIDs as well.</P>
I've been posting a lot of problems and feature requests. So let me take the time to Congratulate you on very nice job. I taught C programming at the university level for several years. I really do mean it when I say that this is one of the best designed tools I've seen as far as the programming and organization goes.
User avatar
digger
Posts: 23
Joined: Tue Mar 05, 2002 7:00 pm
Location: Ft. Thomas, KY
Contact:

Post by digger »

First off...... Ian.... Cacti rox hell with an iron fist!

Second, this was keeping me up tonight. Here is the answer to the problem at hand.
========================
#!/usr/bin/perl

$ret = `snmpget -OneEXbqfsStv $ARGV[0] $ARGV[1] $ARGV[2]`;
chomp $ret;
$ret =~ s/$ARGV[2]//;

print $ret;
========================

It is now 5am and I must sleep. Please let me know if this helps anyone. ( digger@digger.cc )

night....
Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests