Cacti upgrade to 0.8.7b results into "Snmp error"
Moderators: Developers, Moderators
Cacti upgrade to 0.8.7b results into "Snmp error"
Hi everybody,
I encountered a strange issue about cacti while upgrading from 0.8.6j to 0.8.7b and I'm curious if anyone else has met the same problems or, I would particulary appreciate any help!
So I had some problems after the upgrade, but i thought i made a mistake somewhere, and after a few hours got annoyed and decided to reinstall from scratch, while recompiling the latest versions for any package. I'm not going into the upgrade part process because after the reinstall from scratch, i met exactly the same problems.
Some basic information, I am using:
- Slackware 11.0 basic (no default servers etc)
- apache-1.3.41
- php-5.2.6
- mysql-5.0.51b
- net-snmp-5.4.1
- cacti-0.8.7b
- cacti-spine-0.8.7a
- rrdtool-1.2.27
- php-weathermap-0.95b
Compiled everything (i like to work with source packages), imported my old cacti database (from 0.8.6j) into the fresh mysql, checked php+apache.
Everything works like before now, the linuxbox is graphing for the existent devices, php-weathermap works just fine, and realtime.
Here comes the problem i encounter, if i want to:
- view a device - i get the "Snmp error" message where the "system" snmp information should be
- add a device - same as view, plus i cant get the interface list
- refresh the interface list for a device - nothing happens.
I would assume the problem is somewhere between cacti<>net-snmp<>php. The problem is strange because the machine works for the existent devices, and if i try to walk some info through the console, it works just fine:
root@grafice:~# snmpwalk -Os -c somecommunity -v 2c [ip_address] system
sysDescr.0 = STRING: Cisco IOS Software, C3550 Software (C3550-IPSERVICESK9-M), Version 12.2(25)SEE, RELEASE SOFTWARE (fc2)
Copyright (c) 1986-2006 by Cisco Systems, Inc.
Compiled Fri 03-Feb-06 07:24 by antonino
sysObjectID.0 = OID: enterprises.9.1.366
sysUpTimeInstance = Timeticks: (2299882691) 266 days, 4:33:46.91
sysContact.0 = STRING: tech@linuxbox
sysName.0 = STRING: some.router.com
sysLocation.0 = STRING: Somewhere in the world
sysServices.0 = INTEGER: 6
sysORLastChange.0 = Timeticks: (0) 0:00:00.00
Also, php works fine, and phpinfo() returns just fine:
Configure Command
'./configure' '--prefix=/usr/local/php-5.2.6' '--exec-prefix=/usr/local/php-5.2.6' '--mandir=/usr/man' '--with-apache=/usr/local/src/update-may-2008/apache_1.3.41' '--enable-fastcgi' '--with-config-file-path=/usr/local/php/lib' '--disable-ipv6' '--with-openssl=/usr' '--with-zlib=/usr' '--with-zlib-dir=/usr' '--enable-bcmath' '--with-bz2=/usr' '--enable-calendar' '--enable-exif' '--with-gd' '--with-mysql=/usr/local/mysql' '--with-snmp=/usr/local/net-snmp' '--enable-ucd-snmp-hack' '--enable-zip' '--with-zlib-dir=/usr' '--enable-sockets'
Server API Apache
Loaded Modules mod_php5, mod_setenvif, mod_auth, mod_access, mod_alias, mod_userdir, mod_actions, mod_imap, mod_asis, mod_cgi, mod_dir, mod_autoindex, mod_include, mod_status, mod_negotiation, mod_mime, mod_log_config, mod_env, http_core
snmp
NET-SNMP Support enabled
NET-SNMP Version 5.4.1
Still, I am encountering the evil "SNMP error" message everytime I click on a device in the "Devices" menu.
I also tried a tcpdump while accessing a device, and all i get is some usual traffic on port 80. Nothing like SNMP (walk, get...). As for the moment where the poller comes into action, I get huge snmpget & snmpgetnext traffic - so the polling process works fine.
All the paths in the cacti settings say "[OK - FOUND]".
I can see nothing unusual in cacti.log with the maximum of details enabled. Nothing in snmp.log, /var/log/messages etc.
Has anyone a good advice for this problem?
What else should I check / try / dig ?
Thank you very much, any enlightement is highly appreciated!
I encountered a strange issue about cacti while upgrading from 0.8.6j to 0.8.7b and I'm curious if anyone else has met the same problems or, I would particulary appreciate any help!
So I had some problems after the upgrade, but i thought i made a mistake somewhere, and after a few hours got annoyed and decided to reinstall from scratch, while recompiling the latest versions for any package. I'm not going into the upgrade part process because after the reinstall from scratch, i met exactly the same problems.
Some basic information, I am using:
- Slackware 11.0 basic (no default servers etc)
- apache-1.3.41
- php-5.2.6
- mysql-5.0.51b
- net-snmp-5.4.1
- cacti-0.8.7b
- cacti-spine-0.8.7a
- rrdtool-1.2.27
- php-weathermap-0.95b
Compiled everything (i like to work with source packages), imported my old cacti database (from 0.8.6j) into the fresh mysql, checked php+apache.
Everything works like before now, the linuxbox is graphing for the existent devices, php-weathermap works just fine, and realtime.
Here comes the problem i encounter, if i want to:
- view a device - i get the "Snmp error" message where the "system" snmp information should be
- add a device - same as view, plus i cant get the interface list
- refresh the interface list for a device - nothing happens.
I would assume the problem is somewhere between cacti<>net-snmp<>php. The problem is strange because the machine works for the existent devices, and if i try to walk some info through the console, it works just fine:
root@grafice:~# snmpwalk -Os -c somecommunity -v 2c [ip_address] system
sysDescr.0 = STRING: Cisco IOS Software, C3550 Software (C3550-IPSERVICESK9-M), Version 12.2(25)SEE, RELEASE SOFTWARE (fc2)
Copyright (c) 1986-2006 by Cisco Systems, Inc.
Compiled Fri 03-Feb-06 07:24 by antonino
sysObjectID.0 = OID: enterprises.9.1.366
sysUpTimeInstance = Timeticks: (2299882691) 266 days, 4:33:46.91
sysContact.0 = STRING: tech@linuxbox
sysName.0 = STRING: some.router.com
sysLocation.0 = STRING: Somewhere in the world
sysServices.0 = INTEGER: 6
sysORLastChange.0 = Timeticks: (0) 0:00:00.00
Also, php works fine, and phpinfo() returns just fine:
Configure Command
'./configure' '--prefix=/usr/local/php-5.2.6' '--exec-prefix=/usr/local/php-5.2.6' '--mandir=/usr/man' '--with-apache=/usr/local/src/update-may-2008/apache_1.3.41' '--enable-fastcgi' '--with-config-file-path=/usr/local/php/lib' '--disable-ipv6' '--with-openssl=/usr' '--with-zlib=/usr' '--with-zlib-dir=/usr' '--enable-bcmath' '--with-bz2=/usr' '--enable-calendar' '--enable-exif' '--with-gd' '--with-mysql=/usr/local/mysql' '--with-snmp=/usr/local/net-snmp' '--enable-ucd-snmp-hack' '--enable-zip' '--with-zlib-dir=/usr' '--enable-sockets'
Server API Apache
Loaded Modules mod_php5, mod_setenvif, mod_auth, mod_access, mod_alias, mod_userdir, mod_actions, mod_imap, mod_asis, mod_cgi, mod_dir, mod_autoindex, mod_include, mod_status, mod_negotiation, mod_mime, mod_log_config, mod_env, http_core
snmp
NET-SNMP Support enabled
NET-SNMP Version 5.4.1
Still, I am encountering the evil "SNMP error" message everytime I click on a device in the "Devices" menu.
I also tried a tcpdump while accessing a device, and all i get is some usual traffic on port 80. Nothing like SNMP (walk, get...). As for the moment where the poller comes into action, I get huge snmpget & snmpgetnext traffic - so the polling process works fine.
All the paths in the cacti settings say "[OK - FOUND]".
I can see nothing unusual in cacti.log with the maximum of details enabled. Nothing in snmp.log, /var/log/messages etc.
Has anyone a good advice for this problem?
What else should I check / try / dig ?
Thank you very much, any enlightement is highly appreciated!
- TheWitness
- Developer
- Posts: 17061
- Joined: Tue May 14, 2002 5:08 pm
- Location: MI, USA
- Contact:
That is correct.
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?
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?
OK, so I did some debugging, and here is the outcome:cybermind wrote:snmpTheWitness wrote:That is correct.
NET-SNMP Support enabled
NET-SNMP Version 5.4.1
I think this is what you mean, right?
phpinfo() says it has snmp....
Warning: snmp2_get() [function.snmp2-get]: Could not open snmp connection: Unknown host (x.y.z.t:port) in /var/apache/cacti-0.8.7b/lib/snmp.php on line 62
For some reason it seems that php wants to use the external net-snmp executables and not the embedded php-snmp.
Perhaps (still) a PHP bug, as it was in php-5.1.6.
The workaround is to force cacti to use SNMP_METHOD_BINARY (snmp.php, line 441):
...
function snmp_get_method($version = 1) {
return SNMP_METHOD_BINARY;
if ((function_exists("snmpget")) && ($version == 1)) {
return SNMP_METHOD_PHP;
}else if ((function_exists("snmp2_get")) && ($version == 2)) {
return SNMP_METHOD_PHP;
...
Heheh... you know, I never thought of this until I was in the situationgandalf wrote:Hmm, is it required for us to create a workaround? E.g. a select box to choose either php-snmp (if installed) or net-snmp?
Please comment
Reinhard
I think it would be interesting to see an option in cacti whether to use php-snmp or net-snmp. Normally I would use php-snmp, but because of either bugs or broken php installations, I "might" use net-snmp Maybe in some future versions of cacti...
Who is online
Users browsing this forum: No registered users and 2 guests