SNMP not working

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

Moderators: Developers, Moderators

Post Reply
Mike-

SNMP not working

Post by Mike- »

Hi!

Installed/configured and graphing avay with most of the predefined Data Sources execpt

I have a problem with SNMP and Cacti.

Snmpwalk and snmpget works as expected in console.

Data Source/Edit Data gives:
INTERNAL: [10.0.0.1/public] Interface: [1]
/usr/local/rrdtool-1.0.39/bin/rrdtool update /home/cacti/cacti/rra/c350.rrd --template c350 N:U

SNMP interfaces shows the host with the right info, while Refresh Interfaces produces nothing (expected behavior since this should update SQL table?)

View Gathered Interfaces shows no interfaces.

There are no error txt in the web interface. But when I try to run the same commands in console i get some numbers returned before the process exits (needs me to press enter to get exit process feedback.)

root@xxxx:/home/cacti/cacti-0.6.8a# php snmp_interfaces.php?id=1&PHPSESSID=074157d66ca292b3d2146ce568229c50
[1] 32376
root@xxxx:/home/cacti/cacti-0.6.8a# <Enter>
[1]+ Exit 255 php snmp_interfaces.php?id=1

(tried this as root, nobody(webuser) and cacti)


Cron printout shows no data for SNMP devices.

I've tried on several different boxes: Cisco 4000, Cisco 3500, Cisco 677, Cisco 350, Cisco 2600, HP 4000M, HP2424, HP2524 and a couple of more.

Now I'm really stuck. I don't know where to go and what looks like the most promising performance collector can't do anything for me :cry:

Using Slackware 8.1 but with compiled components (Apache, Php s.o)

php.log show nothing interesting when itry to run typically View Gathered Interfaces or Refresh interfaces

I'll be more than willing to test and post results and other information if anything else i needed to understand this behaviour.

Are there anyone out there that has experienced the same problems or can point me in the right direction? Is it cacti configuration, snmp-configuration, php compiling/configuration. Or anything else I can look into to solve this?

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

Post by raX »

This line:
/usr/local/rrdtool-1.0.39/bin/rrdtool update /home/cacti/cacti/rra/c350.rrd --template c350 N:U
Tells me that cacti has the nessesary SNMP info (host, community, OID), but is not gathering the data.

Also, passing HTTP-like arguments to the PHP binary won't work, hence this command failing:
php snmp_interfaces.php?id=1&PHPSESSID=074157d66ca292b3d2146ce568229c50
It sounds like cacti is not calling snmpwalk/snmpget correctly.

Assuming you have installed the ucd-snmp package, make sure cacti knows the full path to both of those binaries under 'cacti Settings'.

If you want to test your ucd-snmp installation, go to the console and type:

Code: Select all

snmpwalk 10.0.0.1 public .
If everything is installed correctly, you should get back lots of stuff.

Tell me what you find.

-Ian
Mike-

Post by Mike- »

Hmmm, looks like I have Net-SNMP v5.0.1 installed - and it doesn't respond to the syntax
snmpwalk 10.0.0.1 public
For snmpwalk to work i need to specify community like this
snmpwalk 10.0.0.1 -c public
So i guess the error is there?

Mike
Blaine

Post by Blaine »

Same problem here. I think I just fixed it.

Changed line 55 of include/snmp_functions.php from

Code: Select all

$snmp_value = exec($config["path_snmpget"]["value"] . " $force_version $hostname '$community' $oid");
to

Code: Select all

$snmp_value = exec($config["path_snmpget"]["value"] . " -v 2c -c '$community' $hostname $oid");
No complaints from php cmd.php now, and the corrected syntax works on the command-line.
Matt

Post by Matt »

Im getting a problem like this too...

When i try and get info from the eth0 this happens

--

Warning: No Response from 127.0.0.1 in /home/hostmaster/public_html/pingu.xilo.net/htdocs/cacti/include/snmp_functions.php on line 68

Warning: Variable passed to reset() is not an array or object in /home/hostmaster/public_html/pingu.xilo.net/htdocs/cacti/include/snmp_functions.php on line 71

Warning: Variable passed to key() is not an array or object in /home/hostmaster/public_html/pingu.xilo.net/htdocs/cacti/include/snmp_functions.php on line 71

Warning: No Response from 127.0.0.1 in /home/hostmaster/public_html/pingu.xilo.net/htdocs/cacti/include/snmp_functions.php on line 68

Warning: Variable passed to reset() is not an array or object in /home/hostmaster/public_html/pingu.xilo.net/htdocs/cacti/include/snmp_functions.php on line 71

Warning: Variable passed to key() is not an array or object in /home/hostmaster/public_html/pingu.xilo.net/htdocs/cacti/include/snmp_functions.php on line 71

Warning: Cannot add header information - headers already sent by (output started at /home/hostmaster/public_html/pingu.xilo.net/htdocs/cacti/include/snmp_functions.php:68) in /home/hostmaster/public_html/pingu.xilo.net/htdocs/cacti/snmp.php on line 64
Mike-

Post by Mike- »

Tried the hack to snmp_interfaces.php but it still does not produce any output besides an empty list of interfaces.

No errors are produced when I choose View Interfaces or Refresh Interfaces.

Mike
Blaine

Post by Blaine »

Mike- wrote:Tried the hack to snmp_interfaces.php but it still does not produce any output besides an empty list of interfaces.

No errors are produced when I choose View Interfaces or Refresh Interfaces.

Mike
That first hack only fixed polling a manually configured interface using "SNMP Data" instead of "SNMP network data".

However, since my first post, I believe I have fixed all issues with net-snmp v5.x. I'm going to clean up my patches, and respond back.
Blaine

Post by Blaine »

I started a new thread which contains a patch that should fix all net-snmp v5.x problems.

Blaine Kahle
blaine@binary.net
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest