SNMPv3 functions

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View

I need to poll SNMP variables from Cisco routers using SNMPv3 (security

I'm trying to use the little-documented SNMPv3 functions (see , where argument lists seem to
be truncated, and ).

I can get snmp3_get function to work fine, but when I try snmp3_getnext
I get a "Fatal error: Call to undefined function" error... does this
mean that function is not compiled into the system? Seems strange that
snmp3_get is and snmp3_getnext isn't... How can I go about confirming
this? And fixing it? Any pointers will be much appreciated!!!

More details follow:

jschnack@maxwell ~/develop/srt $ cat snmpv3-test.php
$desc = snmp3_get('x.x.x.x', 'snmpuser', 'authPriv', 'md5', 'password',
'des', 'password', 'sysDescr.0');
print "$desc\n";
jschnack@maxwell ~/develop/srt $ php snmpv3-test.php
STRING: Cisco IOS Software, C2600 Software (C2600-ADVIPSERVICESK9-M),
Version 12.3(11)T7, RELEASE SOFTWARE (fc3)
Technical Support:
Copyright (c) 1986-2005 by Cisco Systems, Inc.
Compiled Fri 29-Jul-05 22:38 by dchih
jschnack@maxwell ~/develop/srt $
jschnack@maxwell ~/develop/srt $
jschnack@maxwell ~/develop/srt $ cat snmpv3-test2.php
$x = snmp3_getnext('x.x.x.x', 'snmpuser', 'authNoPriv', 'md5',
'password', 'des', 'password',
print "$x\n";
jschnack@maxwell ~/develop/srt $
jschnack@maxwell ~/develop/srt $ php snmpv3-test2.php

Fatal error: Call to undefined function:  snmp3_getnext() in
/home/jschnack/develop/srt/snmpv3-test2.php on line 2
jschnack@maxwell ~/develop/srt $

BTW, I *am* able to poll the ipRouteDest variable using snmp getnext
function from the command line (NET-SNMP version:, so I don't
think I'm misinterpreting the SNMP side of the problem.



Re: SNMPv3 functions wrote:
Quoted text here. Click to load it

What version of PHP are you running. I am on Redhat Enterprise 4 and they  
are way behind in versions. I have tried to get SNMPv2 to work in my current  
version (4.3.9) and those functions didn't make it in until 4.4.x.

According to this website  
( ) the  
snmp3_getnext function isn't available until version 5 while the snmp3_get  
function dates all the way back to 4.3.0.


AJ Schroeder  

Re: SNMPv3 functions

Thanks, AJ.

I totally missed that... I had not spotted the check marks indicating

You hit the nail on the head. I'm using PHP 4.4.0. That certainly
explains why I can use snmp3_get but not snmp3_getnext.  :-(

Thanks for clearing this up for me!


Site Timeline