Problems with snmp and cacti

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

Moderators: Developers, Moderators

Post Reply
tbushnel
Posts: 15
Joined: Fri Mar 21, 2003 10:52 am
Location: San Francisco

Problems with snmp and cacti

Post by tbushnel »

I've been unable to get snmp to work with cacti. If I try to pull an OID from a remote server via snmpwalk I have no problems, but via cmd.php I get no response from the server. I suspect something to do with php's snmp vs net-snmp, but I can't figure it out.

I'm using UCD-snmp version: 4.2.5 and PHP 4.3.0. Unfortunately, I don't know much about php's snmp so I don't even know where to begin. Is it configured separately from net-snmp? Any assistance would be greatly appreciated even if it's reference to another posting - I did dig around before posting this message so as not to waste anyone's time, but I've had no luck thus far. thanxx in advance....

~tmb
User avatar
bulek
Cacti Pro User
Posts: 854
Joined: Mon May 20, 2002 2:07 am
Location: Poland
Contact:

Post by bulek »

Cacti can use both built-in and external snmp support (with ucd-snmp). Here you can read how to change it:
http://www.raxnet.net/board/viewtopic.p ... ernal+snmp

Also standard cacti installation has problems with php 4.3.x. More info on fixing them here:
http://www.raxnet.net/board/viewtopic.php?t=1228

- bulek
tbushnel
Posts: 15
Joined: Fri Mar 21, 2003 10:52 am
Location: San Francisco

Post by tbushnel »

Thanks for the suggestions - Unfortunately, I made the suggested changes, but no change.

The complete failure of snmp within this app makes me wonder if I've configured something incorrectly. To get things up and running I have cacti running under the webserver user which is NOBODY. Because of this I'm unable to test how things work from that user's perspective because nobody does not have a shell. I was able to do sudo -u nobody snmpget -c community .1.3.6.1.4.1.2021.10.1.5.1 and get the cpu utilization from the server. No such luck through cacti though.

Redirecting the crontab output to a file yields:
Timeout: No Response from sfodtiapp001.demandtec.net.

This is usually indicative of an incorrect oid or community string, but I've verified everything via command line so I'm lost. Any suggestions would be appreciated.
User avatar
bulek
Cacti Pro User
Posts: 854
Joined: Mon May 20, 2002 2:07 am
Location: Poland
Contact:

Post by bulek »

You may want to check your real snmp package version. Looking at your test I can see you are using "-c community" to specify community. In your initial post you mention net-snmp package which requires this form. Cacti however defaults to use ucd-snmp form like: "snmpget IP community OID". Anyway it does not work with net-snmp without some changes.

You can also check apache error_log file for some messages coresponding to your problem.

- bulek
tbushnel
Posts: 15
Joined: Fri Mar 21, 2003 10:52 am
Location: San Francisco

Post by tbushnel »

You're definitely on to something. I tried snmpget using the same format that cacti uses (no -c for community) and it did NOT work. I specifically avoided net-snmp, opting instead for the version that still said ucd-snmp, to avoid such a problem, but I guess to no avail.

Anyway, I tried applying the net-snmp patch to resolve the problem. I followed the instructions provided (http://www.raxnet.net/board/viewtopic.p ... ht=netsnmp)

Unfortunately, I couldn't get it to work. I dug in a bit and noticed that the if/then statement in the snmp_functions that I was supposed to change checked to see if version was net-snmp 5, which mine is NOT so it continued to use the old snmpwalk syntax. I ammended it so it ran the new syntax regardless and now it's collecting data. I really appreciate you putting me in the right direction on this!!
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest