473,666 Members | 2,114 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@maxwel l ~/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@maxwel l ~/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@maxwel l ~/develop/srt $
jschnack@maxwel l ~/develop/srt $
jschnack@maxwel l ~/develop/srt $ cat snmpv3-test2.php
<?php
$x = snmp3_getnext(' x.x.x.x', 'snmpuser', 'authNoPriv', 'md5',
'password', 'des', 'password',
'ip.ipRouteTabl e.ipRouteEntry. ipRouteDest');
print "$x\n";
?>
jschnack@maxwel l ~/develop/srt $
jschnack@maxwel l ~/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@maxwel l ~/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 6438
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@maxwel l ~/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@maxwel l ~/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@maxwel l ~/develop/srt $
jschnack@maxwel l ~/develop/srt $
jschnack@maxwel l ~/develop/srt $ cat snmpv3-test2.php
<?php
$x = snmp3_getnext(' x.x.x.x', 'snmpuser', 'authNoPriv', 'md5',
'password', 'des', 'password',
'ip.ipRouteTabl e.ipRouteEntry. ipRouteDest');
print "$x\n";

jschnack@maxwel l ~/develop/srt $
jschnack@maxwel l ~/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@maxwel l ~/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
3333
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 charcters in it, that the code needs to run until all bad characters are gone? For example, if a file has the name "<bad*mac\file" the program has to run 3 times to get all three bad chars out of the file name. The passes look like this:
99
5881
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 important changes, so in this thread I would like to focus on that issue alone. I have edited the Proposed Syntax example below to take out the changes unecessary to this discussion. I left in the change of "instance variable" syntax (...
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 managed point-of-view I've noticed that: 1) for each managed and unmanaged C function (not C++ classes) I get a public managed static method (defined on a 'Global Functions' class) in the generated assembly with an export name of the form...
2
3778
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 produce two messages having the same message digest. That conjecture is false, as demonstrated by Wang, Feng, Lai and Yu in 2004 . Just recently, Wang, Yu, and Lin showed a short- cut solution for finding collisions in SHA-1 . Their result
7
5891
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 route. The problem being that I can't call these functions from the query designer in Access. I decided that I would try the route of declaring the functions from the dll file the same way you would for the Windows API. Access then complains that...
23
3992
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 who will find them very helpfull. gcc has them as a non-standard option, but only when compiling C language code, so I'm afraid there might be some obscure reason why local functions are not so easy to be dealt with in C++, which I do not yet know.
2
3813
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 v3-specific documentation, could you help me? Is there any other solution than pySNMP?
7
3957
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 functions. Is it normal how C++ Compiler can compile large class without any problem? Didn't C++ Compiler have rules to limit the number of member functions? One big object has complex operations how member variables and member functions can be...
1
2332
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 anyone suggest me? Why i am gettig this problem.
0
8443
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8866
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8639
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7385
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5663
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4198
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4366
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2769
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1772
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.