missing status, type and h/w address from interface stats

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

Moderators: Developers, Moderators

Post Reply
User avatar
esproul
Posts: 17
Joined: Wed Sep 14, 2005 11:50 am
Location: Baltimore, MD

missing status, type and h/w address from interface stats

Post by esproul »

Hi,
I'm working with a fresh install of 0.8.6g on a Redhat 8.0 box, and I'm having a bit of trouble seeing some of the interface stats. I've been searching the forums and docs, but can't seem to pin down the cause.

This box has PHP 4.3.11 from source, and net-snmp 5.0.9 from RPM (official RH8 updates). I'm monitoring other unix hosts, using snmpv1. The graphs look fine, and all other functions seem OK, it's just that when I debug the interface data query, the normal values for these three OIDs contain only the integers, or null values:

Code: Select all

+ Executing SNMP walk for data @ '.1.3.6.1.2.1.2.2.1.8'
+ Found item [ifOperStatus='1'] index: 1 [from value]
+ Found item [ifOperStatus='1'] index: 2 [from value]
+ Found item [ifOperStatus='1'] index: 3 [from value]
...
+ Executing SNMP walk for data @ '.1.3.6.1.2.1.2.2.1.3'
+ Found item [ifType='24'] index: 1 [from value]
+ Found item [ifType='6'] index: 2 [from value]
+ Found item [ifType='6'] index: 3 [from value]
...
+ Executing SNMP walk for data @ '.1.3.6.1.2.1.2.2.1.6'
+ Found item [ifHwAddr=''] index: 1 [from value]
+ Found item [ifHwAddr=''] index: 2 [from value]
+ Found item [ifHwAddr=''] index: 3 [from value]
Whereas if I walk them from the command line:

Code: Select all

IF-MIB::ifOperStatus.1 = INTEGER: up(1)
IF-MIB::ifOperStatus.2 = INTEGER: up(1)
IF-MIB::ifOperStatus.3 = INTEGER: up(1)

IF-MIB::ifPhysAddress.1 = STRING:
IF-MIB::ifPhysAddress.2 = STRING: 0:30:48:24:c4:84
IF-MIB::ifPhysAddress.3 = STRING: 0:30:48:24:c4:85

IF-MIB::ifType.1 = INTEGER: softwareLoopback(24)
IF-MIB::ifType.2 = INTEGER: ethernetCsmacd(6)
IF-MIB::ifType.3 = INTEGER: ethernetCsmacd(6)
I cannot figure out why Cacti won't see/use these values in the data query. Can someone give me a hint?

Thanks,
Eric
[/code]
User avatar
adrianmarsh
Cacti User
Posts: 437
Joined: Wed Aug 17, 2005 8:51 am
Location: UK

Post by adrianmarsh »

What do you get if you do an snmpwalk -On for the h/w address?
User avatar
esproul
Posts: 17
Joined: Wed Sep 14, 2005 11:50 am
Location: Baltimore, MD

Post by esproul »

adrianmarsh wrote:What do you get if you do an snmpwalk -On for the h/w address?
Adrian,
I get the following:

Code: Select all

.1.3.6.1.2.1.2.2.1.6.1 = STRING:
.1.3.6.1.2.1.2.2.1.6.2 = STRING: 0:30:48:24:c4:84
.1.3.6.1.2.1.2.2.1.6.3 = STRING: 0:30:48:24:c4:85
which matches up with the "Hardware Address" oid in resource/snmp_queries/interface.xml . It should get the index numbers when it walks .1.3.6.1.2.1.2.2.1.1 , so what I don't understand is why it's not getting the strings from ifPhysAddress. It seems to pull the ifDescr strings just fine.
User avatar
adrianmarsh
Cacti User
Posts: 437
Joined: Wed Aug 17, 2005 8:51 am
Location: UK

Post by adrianmarsh »

Hmmm...

I did read somewhere that snmpwalk is supposed to stop walking a branch if it reaches a blank return (signifying end-of-branch), and I wonder of the Cacti does the same thing, and stops because the first element in the list doesn't seem to return a result...
User avatar
esproul
Posts: 17
Joined: Wed Sep 14, 2005 11:50 am
Location: Baltimore, MD

Post by esproul »

adrianmarsh wrote:Hmmm...

I did read somewhere that snmpwalk is supposed to stop walking a branch if it reaches a blank return (signifying end-of-branch), and I wonder of the Cacti does the same thing, and stops because the first element in the list doesn't seem to return a result...
Interesting theory. The indexes in this case represent lo, eth0, and eth1. On Linux machines, net-snmp seems to always list "lo" first, and it never has a hardware address. On FreeBSD it sticks "lo0" somewhere in the middle. However, I have the same problem on the FreeBSD boxes I'm monitoring, so I don't think that explains what I'm seeing.
User avatar
adrianmarsh
Cacti User
Posts: 437
Joined: Wed Aug 17, 2005 8:51 am
Location: UK

Post by adrianmarsh »

I'm afraid I'm out of ideas then.. :(
User avatar
esproul
Posts: 17
Joined: Wed Sep 14, 2005 11:50 am
Location: Baltimore, MD

Post by esproul »

Well, a little more digging revealed it's happening on everything I'm monitoring, not just Linux and FreeBSD hosts. I'm also hitting a Cisco Catalyst switch and a Foundry ServerIron. The interface list on both of these also shows no text for the status, type or hardware address. In the case of status and type, only the numeric value is shown. The hardware address column is blank.

So it would seem that something in my Cacti setup is wonky, but I believe I followed all the installation docs and did a pretty vanilla setup.

I'm attaching two screenshots, one of the Catalyst and one of a Linux UCD/Net host. Maybe someone will stumble across it and provide a "eureka!" moment.

Thanks,
Eric
Attachments
if_catalyst.png
if_catalyst.png (80.98 KiB) Viewed 3045 times
if_ucdhost.png
if_ucdhost.png (56.46 KiB) Viewed 3045 times
User avatar
TheWitness
Developer
Posts: 17007
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Post by TheWitness »

Are you using php_snmp or the net-snmp binaries? If you are using the binaries, there is a change you can make to lib/snmp.php that will address your problem. If you are using php_snmp, it was likely due to a php upgrade.

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?
User avatar
esproul
Posts: 17
Joined: Wed Sep 14, 2005 11:50 am
Location: Baltimore, MD

Post by esproul »

TheWitness wrote:Are you using php_snmp or the net-snmp binaries?
I suppose I am using PHP's builtin SNMP, because it shows up in a 'php -m'. If I want to switch to the net-snmp tools, what config change has to happen? I'm new to Cacti, please forgive me.

In your experience, what happens in a PHP upgrade to break SNMP? I installed 4.3.11 from source, over top of a 4.3.2 installation (also from source) that I could not get to recompile properly.

Thanks,
Eric
User avatar
esproul
Posts: 17
Joined: Wed Sep 14, 2005 11:50 am
Location: Baltimore, MD

Post by esproul »

Followup:

I ran into the same problem with a brand-new install of 0.8.6g on CentOS 4.1 with net-snmp 5.1.2-11.EL4.6 and php (w/snmp) 4.3.9-3.8. The only difference is that with this setup, I am seeing the hardware address. However, both link status and ifType are still just numbers.

Based on the discussion in pirx's thread, I grabbed lib/snmp.php from 0.8.6c and voila, I now see link status and ifType as their names instead of just numbers.

I don't know what this means for developers, but if I can be of assistance, please let me know.

Cheers,
Eric
User avatar
pirx
Cacti User
Posts: 199
Joined: Tue Feb 10, 2004 10:08 am
Location: Esslingen, Germany

Post by pirx »

esproul wrote:Followup:

I ran into the same problem with a brand-new install of 0.8.6g on CentOS 4.1 with net-snmp 5.1.2-11.EL4.6 and php (w/snmp) 4.3.9-3.8. The only difference is that with this setup, I am seeing the hardware address. However, both link status and ifType are still just numbers.

Based on the discussion in pirx's thread, I grabbed lib/snmp.php from 0.8.6c and voila, I now see link status and ifType as their names instead of just numbers.

I don't know what this means for developers, but if I can be of assistance, please let me know.
I still have the same problem here on 3 different cacti hosts. If I switch back to snmp.php from 0.8.6c the verbose information is back again.

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

Post by TheWitness »

Can one of you all test the following. Take the production 0.8.6g version of snmp.php and remove the following lines. Then rerun and tell me if it's fixed.

TheWitness

Code: Select all

		snmp_set_quick_print(0);

		if (function_exists("snmp_set_valueretrieval")) {
			snmp_set_valueretrieval(SNMP_VALUE_PLAIN);
		}
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?
User avatar
pirx
Cacti User
Posts: 199
Joined: Tue Feb 10, 2004 10:08 am
Location: Esslingen, Germany

Post by pirx »

TheWitness wrote:Can one of you all test the following. Take the production 0.8.6g version of snmp.php and remove the following lines. Then rerun and tell me if it's fixed.
before:
1 2 FastEthernet0/1 Fa0/1 6 100000000

...changed code and hit the reindex button:

after
1 Down FastEthernet0/1 Fa0/1 ethernetCsmacd(6) 100000000 00:00:12:D9:92:AF:41

I can reproduce this. After adding the code again, the verbose output is gone again. So, this really seems to be the problem.

Ralf
Last edited by pirx on Wed Oct 19, 2005 1:53 am, edited 1 time in total.
User avatar
esproul
Posts: 17
Joined: Wed Sep 14, 2005 11:50 am
Location: Baltimore, MD

Post by esproul »

Thanks for the help pirx. I'm busy getting this new install going for a client, so I wasn't able to test.

On a related topic, if I wanted to display the ifOperStatus somewhere on the graph (now that I am seeing meaningful results), where would make the most sense? I've already got a pretty long title in the graph template, i.e.
( |host_description| - Traffic - |query_ifName| (|query_ifAlias|))
so I don't want to put it there.

Is it possible to put this query result into the actual graph text, say below the Inbound/Outbound legend at the bottom? I've looked at the graph template but I don't see a way to insert an SNMP query result.

Thanks,
Eric
Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests