[PHP] PHP SNMP

2006-05-23 Thread Pavleck, Jeremy D.
Greetings,
 Seem to have a bit of a problem I can't figure out. I'm trying to query
servers via SNMP with PHP's snmpget function. Everything seems to work
fine, no problems at all - except I'd like the web page to print the
string value instead of the numeric value (I.E. OK for the Compaq Drive
Array vs 1).

 Now I've configured everything as best I can tell, and I have the page
loading the appropriate MIB file (
snmp_read_mib(/usr/local/share/snmp/mibs/CPQIDA.MIB)). 

 Running it from the terminal via 'php mypage.php' returns all the
correct values, I see Ok, instead of 1. But accessing it via the web
produces nothing - no output. It doesn't matter how I set the get, I've
tried varying it with CPQIDA-MIB::cpqDaCntlrBoardStatus.0,
cpqDaCntlrBoardStatus.0,
.iso.org.dod.internet.private.enterprises.compaq.cpqDriveArray.cpqDaCom
ponent.cpqDaCntlr.cpqDaCntlrTable.cpqDaCntlrEntry.cpqDaCntlrBoardStatus.
0 - all work fine running it via the terminal, but not via the web
page.

Does anyone have any ideas at all about this? Anything else I can check?
If I snmpget the numeric OID (.1.3.6.1.4.1.232.3.2.2.1.1.10.0) it does
work, but only returns the numeric value.

System Info:
PHP 5.0.5
Net-SNMP 5.1.1

Php compiled with --with-snmp and --enable-ucd-snmp-hack

Thanks.
 

Jeremy Pavleck 
Network Engineer  - Systems Management 
IT Networks and Infrastructure 

Direct Line: 612-977-5881 
Toll Free: 1-888-CAPELLA ext. 5881 
Fax: 612-977-5053 
E-mail: [EMAIL PROTECTED] mailto:[EMAIL PROTECTED]  

Capella University 
225 South 6th Street, 9th Floor 
Minneapolis, MN 55402 

www.capella.edu http://www.capella.edu/  

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] PHP SNMP

2006-05-23 Thread Chris

Pavleck, Jeremy D. wrote:

Greetings,
 Seem to have a bit of a problem I can't figure out. I'm trying to query
servers via SNMP with PHP's snmpget function. Everything seems to work
fine, no problems at all - except I'd like the web page to print the
string value instead of the numeric value (I.E. OK for the Compaq Drive
Array vs 1).

 Now I've configured everything as best I can tell, and I have the page
loading the appropriate MIB file (
snmp_read_mib(/usr/local/share/snmp/mibs/CPQIDA.MIB)). 


 Running it from the terminal via 'php mypage.php' returns all the
correct values, I see Ok, instead of 1. But accessing it via the web
produces nothing - no output. It doesn't matter how I set the get, I've
tried varying it with CPQIDA-MIB::cpqDaCntlrBoardStatus.0,
cpqDaCntlrBoardStatus.0,
.iso.org.dod.internet.private.enterprises.compaq.cpqDriveArray.cpqDaCom
ponent.cpqDaCntlr.cpqDaCntlrTable.cpqDaCntlrEntry.cpqDaCntlrBoardStatus.
0 - all work fine running it via the terminal, but not via the web
page.


Does the webpage show anything at all? Sounds like you have a fatal error..

Does the web php version have snmp support? Check with a phpinfo page.

--
Postgresql  php tutorials
http://www.designmagick.com/

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] php-snmp-4.3.11-2.5 for RH8?

2005-05-06 Thread Rob Kudyba
We are experiencing the 'usmAES192PrivProtocol in Unknown' error in the 
Apache error log due to a conflict between Net-SNMP 5.2.1 and the 
php-snmp package. Well of course, Fedora 3 has an update available at 
(and detailed) here:
https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=155975

Check out this thread on the Cacti forum:
http://forums.cacti.net/viewtopic.php?p=30981#30981
Any chance that a package for RH8 will become available?
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] PHP SNMP

2004-01-06 Thread Luke Bailey
I'm trying to access some SNMP agents.  I have to have use 
SNMP v2, otherwise the snmp requests time out.  PHP seems 
to use SNMP v1 by default.  How can I change this?

EX:
I need it to replicate the following command
snmpget -v2c ...
Luke Bailey

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Php snmp Version

2003-09-30 Thread Lucas Lain
Hi everybody, 
i was googled a long time looking how to pass the snmp version to the snmpget 
or snmpwalk functions. The only response was from a guy who proposed to 
change the source code. I don't fully understand, the code is ready to do 
snmp v2c querys but it doesn't exists the parameters... i am not scared about 
modifying the code... but i just dont get it !!!

TIA,

Lucas Lain

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] php snmp

2002-04-18 Thread Scott Baer

Hello...

Could some one please direct me in the right direction.

I am trying to get an snmpwalk on an snmp device.. I have set up the
community and IP correctly..

I can do a manually by doing the fallowing:

snmpwalk 126.4.202.157 public

from a terminal,,, and I do get some responses

if I use the fallowing code threw apache..

 ?php
 $a = snmpwalk(126.4.202.157, public, );
for ($i=0; $i  count($a); $i++) {
echo $a[$i];
}
 ?

and call this threw a browser

I get the fallowing:

and it seem as the page times out... but its very quick...almost as soon as
I call the page.

Other PHP pages work fine...
I'm running on a Dell PIII Duel 500 w/512Meg Ram running SuSE 7.3 SMP

I have compiled net-snmp
using ethereal.. I can see the snmp gets  get-next ... as well as the
responses...


Anyone have any idea... ??

Scott



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] php snmp compile error

2001-12-16 Thread kancha

I've downloaded php 4.1.0 and ucd-snmp 4.2.3. I was able to compile snmp 
successfully. Then i tried to compile php with snmp support. Followign is my 
configure parameters

./configure  --with-apxs=/usr/sbin/apxs --enable-calendar --with-pgsql 
--with-snmp --enable-ucd-snmp-hack --enable-wddx --enable-sysvsem 
--with-sysvshm --enable-inline-optimization --enable-ftp --with-gd 
--enable-gd-native-ttf --with-openssl

configure works fine but when i do a make i get following error:

Zend/.libs/libZend.al(default_store.o):/usr/local/ucd-snmp-4.2.3/snmplib/default_store.c:308:
 
first defined here
/usr/local/lib/libsnmp.a(snmp_alarm.o): In function `init_alarm_post_config':
/usr/local/ucd-snmp-4.2.3/snmplib/snmp_alarm.c:53: multiple definition of 
`init_alarm_post_config'
Zend/.libs/libZend.al(snmp_alarm.o):/usr/local/ucd-snmp-4.2.3/snmplib/snmp_alarm.c:53: 
first defined here
/usr/local/lib/libsnmp.a(snmp_alarm.o): In function `set_an_alarm':
/usr/local/ucd-snmp-4.2.3/snmplib/snmp_alarm.c:185: multiple definition of 
`set_an_alarm'
Zend/.libs/libZend.al(snmp_alarm.o):/usr/local/ucd-snmp-4.2.3/snmplib/snmp_alarm.c:185:
 
first defined here
/usr/local/lib/libsnmp.a(snmp_alarm.o): In function `init_snmp_alarm':
/usr/local/ucd-snmp-4.2.3/snmplib/snmp_alarm.c:60: multiple definition of 
`init_snmp_alarm'
Zend/.libs/libZend.al(snmp_alarm.o):/usr/local/ucd-snmp-4.2.3/snmplib/snmp_alarm.c:60: 
first defined here
/usr/local/lib/libsnmp.a(snmp_alarm.o): In function `sa_update_entry':
/usr/local/ucd-snmp-4.2.3/snmplib/snmp_alarm.c:67: multiple definition of 
`sa_update_entry'
Zend/.libs/libZend.al(snmp_alarm.o):/usr/local/ucd-snmp-4.2.3/snmplib/snmp_alarm.c:67: 
first defined here
/usr/local/lib/libsnmp.a(snmp_alarm.o): In function `snmp_alarm_unregister':
/usr/local/ucd-snmp-4.2.3/snmplib/snmp_alarm.c:88: multiple definition of 
`snmp_alarm_unregister'
Zend/.libs/libZend.al(snmp_alarm.o):/usr/local/ucd-snmp-4.2.3/snmplib/snmp_alarm.c:88: 
first defined here
/usr/local/lib/libsnmp.a(snmp_alarm.o): In function `sa_find_next':
/usr/local/ucd-snmp-4.2.3/snmplib/snmp_alarm.c:111: multiple definition of 
`sa_find_next'
Zend/.libs/libZend.al(snmp_alarm.o):/usr/local/ucd-snmp-4.2.3/snmplib/snmp_alarm.c:111:
 
first defined here
/usr/local/lib/libsnmp.a(snmp_alarm.o): In function `sa_find_specific':
/usr/local/ucd-snmp-4.2.3/snmplib/snmp_alarm.c:120: multiple definition of 
`sa_find_specific'
Zend/.libs/libZend.al(snmp_alarm.o):/usr/local/ucd-snmp-4.2.3/snmplib/snmp_alarm.c:120:
 
first defined here
/usr/local/lib/libsnmp.a(snmp_alarm.o): In function `run_alarms':
/usr/local/ucd-snmp-4.2.3/snmplib/snmp_alarm.c:131: multiple definition of 
`run_alarms'
Zend/.libs/libZend.al(snmp_alarm.o):/usr/local/ucd-snmp-4.2.3/snmplib/snmp_alarm.c:131:
 
first defined here
/usr/local/lib/libsnmp.a(snmp_alarm.o): In function `alarm_handler':
/usr/local/ucd-snmp-4.2.3/snmplib/snmp_alarm.c:164: multiple definition of 
`alarm_handler'
Zend/.libs/libZend.al(snmp_alarm.o):/usr/local/ucd-snmp-4.2.3/snmplib/snmp_alarm.c:164:
 
first defined here
/usr/local/lib/libsnmp.a(snmp_alarm.o): In function 
`get_next_alarm_delay_time':/usr/local/ucd-snmp-4.2.3/snmplib/snmp_alarm.c:170: 
multiple definition of `get_next_alarm_delay_time'
Zend/.libs/libZend.al(snmp_alarm.o):/usr/local/ucd-snmp-4.2.3/snmplib/snmp_alarm.c:170:
 
first defined here
/usr/local/lib/libsnmp.a(snmp_alarm.o): In function `snmp_alarm_register':
/usr/local/ucd-snmp-4.2.3/snmplib/snmp_alarm.c:204: multiple definition of 
`snmp_alarm_register'
Zend/.libs/libZend.al(snmp_alarm.o):/usr/local/ucd-snmp-4.2.3/snmplib/snmp_alarm.c:204:
 
first defined here


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] php, snmp, and mibs

2001-05-08 Thread Mike Backes

Hi,
Sorry if this is a repeat question, I just can't seem to find an answer to
this question.

I am running php4 on NT. I've been able to connect to some network equipment
with the snmp commands, and retrieve the results. But it's the list of
values, which can be tough to correspond to the MIB. Is there a way to get
at least the x.x.x.x.x.x from a MIB file into an array of some kind, or even
better, to get the object names and such into an array?

Thanks for any information,
Mike


_
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] php, snmp, and mibs

2001-05-08 Thread Jack Dempsey

Mike,

I haven't worked with MIB files myself, but what you're describing sounds
like it could be solved with regex's...can you post a snippet of what file
looks like that you're trying to extract from?

-jack

-Original Message-
From: Mike Backes [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, May 08, 2001 2:28 PM
To: [EMAIL PROTECTED]
Subject: [PHP] php, snmp, and mibs


Hi,
Sorry if this is a repeat question, I just can't seem to find an answer to
this question.

I am running php4 on NT. I've been able to connect to some network equipment
with the snmp commands, and retrieve the results. But it's the list of
values, which can be tough to correspond to the MIB. Is there a way to get
at least the x.x.x.x.x.x from a MIB file into an array of some kind, or even
better, to get the object names and such into an array?

Thanks for any information,
Mike


_
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] php, snmp, and mibs

2001-05-08 Thread ..s.c.o.t.t.. [gts]

as someone else suggested... a regexp is probably the
thing you want.

since i have no idea what the format of a MIB is,
i cannot give you any example.


but to find dotted num's, use something akin to this:

preg_match_all('/(\d+)(?=\.?)/', $MIB, $matches);


 -Original Message-
 From: Mike Backes [mailto:[EMAIL PROTECTED]]
 Sent: Tuesday, May 08, 2001 2:28 PM
 To: [EMAIL PROTECTED]
 Subject: [PHP] php, snmp, and mibs
 
 
 Hi,
 Sorry if this is a repeat question, I just can't seem to find an answer to
 this question.
 
 I am running php4 on NT. I've been able to connect to some network equipment
 with the snmp commands, and retrieve the results. But it's the list of
 values, which can be tough to correspond to the MIB. Is there a way to get
 at least the x.x.x.x.x.x from a MIB file into an array of some kind, or even
 better, to get the object names and such into an array?
 
 Thanks for any information,
 Mike
 
 
 _
 Do You Yahoo!?
 Get your free @yahoo.com address at http://mail.yahoo.com
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]
 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]