473,508 Members | 2,373 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

SNMPv3 functions

Hi,

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

I'm trying to use the little-documented SNMPv3 functions (see
http://us3.php.net/manual/en/ref.snmp.php, where argument lists seem to
be truncated, and
http://zugeschaut-und-mitgebaut.de/p...nmp3_get.html).

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
<?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: http://www.cisco.com/techsupport
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
<?php
$x = snmp3_getnext('x.x.x.x', 'snmpuser', 'authNoPriv', 'md5',
'password', 'des', 'password',
'ip.ipRouteTable.ipRouteEntry.ipRouteDest');
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: 5.2.1.2), so I don't
think I'm misinterpreting the SNMP side of the problem.

Thanks,

J.

Apr 10 '06 #1
2 6425
ac*****@hotmail.com wrote:
Hi,

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

I'm trying to use the little-documented SNMPv3 functions (see
http://us3.php.net/manual/en/ref.snmp.php, where argument lists seem
to be truncated, and
http://zugeschaut-und-mitgebaut.de/p...nmp3_get.html).

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
<?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: http://www.cisco.com/techsupport
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
<?php
$x = snmp3_getnext('x.x.x.x', 'snmpuser', 'authNoPriv', 'md5',
'password', 'des', 'password',
'ip.ipRouteTable.ipRouteEntry.ipRouteDest');
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: 5.2.1.2), so I don't
think I'm misinterpreting the SNMP side of the problem.

Thanks,

J.


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
(http://zugeschaut-und-mitgebaut.de/p...3_getnext.html) the
snmp3_getnext function isn't available until version 5 while the snmp3_get
function dates all the way back to 4.3.0.

HTH,

AJ Schroeder
Apr 12 '06 #2
Thanks, AJ.

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

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!

J.

Apr 12 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
3326
by: hokiegal99 | last post by:
A few questions about the following code. How would I "wrap" this in a function, and do I need to? Also, how can I make the code smart enough to realize that when a file has 2 or more bad...
99
5818
by: David MacQuigg | last post by:
I'm not getting any feedback on the most important benefit in my proposed "Ideas for Python 3" thread - the unification of methods and functions. Perhaps it was buried among too many other less...
1
741
by: Bob Rock | last post by:
Hello, in the last few days I've made my first few attempts at creating mixed C++ managed-unmanaged assemblies and looking aftwerwards with ILDASM at what is visible in those assemblies from a...
2
3759
by: Bryan Olson | last post by:
The current Python standard library provides two cryptographic hash functions: MD5 and SHA-1 . The authors of MD5 originally stated: It is conjectured that it is computationally infeasible to...
7
5877
by: Tim ffitch | last post by:
Hi I have created a VB dll file that contains common functions I use across various projects in VB, Access and Excel. Rather than have to code the functions in each I decided to use the dll...
23
3961
by: Timothy Madden | last post by:
Hello all. I program C++ since a lot of time now and I still don't know this simple thing: what's the problem with local functions so they are not part of C++ ? There surely are many people...
2
3807
by: Jacek Popławski | last post by:
Do you have any experience with Python in SNMPv3 area? I just realized that pySNMP we are using supports only v1 and v2c, development version probably supports SNMPv3 but I am unable to find any...
7
3946
by: Immortal Nephi | last post by:
My project grows large when I put too many member functions into one class. The header file and source code file will have approximately 50,000 lines when one class contains thousand member...
1
2313
by: chinnakanna | last post by:
hi all, can anyone help me, when i am connecting agent (OS vxworks) and trying to get values from agent it is giving as Unknown user (through MGSOFT mib browser and SNMPc Manager for SNMPv3). Can...
0
7223
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7115
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7321
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7377
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7036
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7489
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5624
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
4705
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3179
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.