Undefined variable: snmp_value in /usr/src/cacti/lib/snmp.ph

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

Moderators: Developers, Moderators

Post Reply
billh
Posts: 1
Joined: Tue Dec 30, 2003 10:35 am

Undefined variable: snmp_value in /usr/src/cacti/lib/snmp.ph

Post by billh »

Hi,

Looking for some help here.

I installed this on: FreeBSD 4.7-RELEASE-p24

I have cacti running, but when I add a polling host I cant seem to get SNMP data returned.

On the top of the "Polling Hosts" page for the specific host I see

Notice: Undefined variable: snmp_value in /usr/src/cacti/lib/snmp.php on line 225
SNMP error

Also when I do a verbose query I get

+ Running data query [1].
+ Found type = '3' [snmp query].
+ Found data query XML file at '/usr/src/cacti/resource/snmp_queries/interface.xml'
+ XML file parsed ok.
+ Executing SNMP walk for list of indexes @ '.1.3.6.1.2.1.2.2.1.1'
+ No SNMP data returned

I have MRTG installed and if I do a simple "cfgmaker community@host" I get the correct data returned.

When I look at line 225 in /usr/src/cacti/lib/snmp.php I see that $snmp_value is the undefined value. Before I did some short order digging, but I thought it was prudent to ask here before I chase my tail to much :wink:

Oh, snmp versions on the FreeBSD machine are

# snmpget -V
NET-SNMP version: 5.0.9

# snmpwalk -V
NET-SNMP version: 5.0.9

Thank you in advance for any help

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

Post by raX »

If you click on the Cacti logo to bring up the about page, what does it read for "PHP SNMP Support"?

-Ian
recombinator
Posts: 22
Joined: Fri Jan 17, 2003 1:24 am

Post by recombinator »

i've got the same problem on a win2003 machine....and i've been running cacti for over a year now without ant problems on it and did a few upgrade without issues too.
now i get this and nothing works with polling :(....
Cacti Variables
Operating System: win32
PHP SNMP Support: no

snmpwalk's work fine
raX
Lead Developer
Posts: 2243
Joined: Sat Oct 13, 2001 7:00 pm
Location: Carlisle, PA
Contact:

Post by raX »

You might have better results using PHP's SNMP module under Windows then trying to call snmpwalk or snmpget directly. I am pretty sure that you can compile net-snmp for Windows, but I have yet to test this. You can enable PHP's SNMP module by uncommenting 'extension=php_snmp.dll' in your php.ini file.

-Ian
recombinator
Posts: 22
Joined: Fri Jan 17, 2003 1:24 am

Post by recombinator »

Thx Rax ;).....
polling is working now......i only disabled php snmp pollinh a while ago, because it couldn't handle the 64-bit counters. I'll just work without that option for a while then :(
raX
Lead Developer
Posts: 2243
Joined: Sat Oct 13, 2001 7:00 pm
Location: Carlisle, PA
Contact:

Post by raX »

Where can you get a hold of snmpwalk/snmpget binaries for Windows by the way? I'll test Cacti with these binaries when I get the chance. Also, you can get around the 64-bit issue for a little while by increasing the polling interval of cmd.php. You can poll a max of about 113 mbit in 5 minutes using 32-bit counters, and can almost double this by increasing the interval to 3 minutes.

-Ian
recombinator
Posts: 22
Joined: Fri Jan 17, 2003 1:24 am

Post by recombinator »

i got my binaries here a while ago......always worked perfect.
http://src.teras.net.id/?hid=snmp

used the ucd binaries ofcourse ;)

problem is that at work i need the 64-bit counters for polling stm-1,stm-4 and gigabit interfaces. That worked great always. Problem is that we don't have a free unix-machine at the moment so windows always did the trick.
I always test the new cacti at home first at my windows server and got the snmp problems there so i didn't upgrade at work yet.

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

Post by raX »

It seems that a change I made a while back (bug#102 - escaping community strings with apostrophes) is causing problems under Windows. It appears that the Windows ucd-snmp binary sees the apostrohpe as a regaular character rather than an escape character.

Can you try the following pre-patched file and see if it helps?

http://www.raxnet.net/downloads/cacti/p ... mp.php.txt

-Ian
recombinator
Posts: 22
Joined: Fri Jan 17, 2003 1:24 am

Post by recombinator »

Sure.....i'm going to try it now and let you know.
recombinator
Posts: 22
Joined: Fri Jan 17, 2003 1:24 am

Post by recombinator »

Yes man!!....It's working again now. Turned everything back to my old settings and copied your snmp.php file over the old one. Works perfect!
Thx :D
Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests