Re: PHP and SNMP

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Thanks leonard, 
I can use the commandline snmpwalk and snmpget tools
but the problem is with the php's snmp functions. I
have updated my php rpms thinking this problem might
go away. My script , It's the www.php.net's snmpget()
example.

<?php
$syscontact = snmpget("10.1.1.1",
"public","system.SysContact.0");
print "$syscontact";

?>


Leonard Miller <Leonard_Miller@xxxxxxxx> wrote: > Do
you get any response with SNMPGET or SNMPWALK
> from the
> command line? If so, your scripts should look
> similar to these.  
> Post your script is you can't get it to work.
> 
> <?php
> $test=`snmpget -c $community $host
> system.sysName.0`;
> print($test);
> ?>
> 
> <?php
> print(`snmpwalk -c $community $host iso`);
> ?>
> 
> Leonard
> 
> >>> this_is_root@xxxxxxxxxxx 03/16/03 11:23PM >>>
> Hi,
> this is my php, snmp list
> 
> [root@xxx root]# rpm -qa | grep snmp
> php-snmp-4.2.2-8.0.7
> net-snmp-utils-5.0.1-6
> net-snmp-5.0.1-6
> 
> [root@xxx root]# rpm -qa | grep php
> php-ldap-4.2.2-8.0.7
> php-snmp-4.2.2-8.0.7
> php-pgsql-4.2.2-8.0.7
> php-4.2.2-8.0.7
> php-odbc-4.2.2-8.0.7
> php-imap-4.2.2-8.0.7
> php-mysql-4.2.2-8.0.7
> [root@xxx root]#
> 
> But i cant use the snmpget() function in php, this
> is
> the output of snmpget().
> 
> Warning: Invalid object identifier:
> system.SysContact.0 in
> /var/www/html/php/snmp/snmp.php
> on line 3
> any idea why ?
> 
> --sanjeewa.
> 
> 
> 
> -- 
> Psyche-list mailing list
> Psyche-list@xxxxxxxxxx
>
https://listman.redhat.com/mailman/listinfo/psyche-list 

__________________________________________________
Do You Yahoo!?
Everything you'll ever need on one web page
from News and Sport to Email and Music Charts
http://uk.my.yahoo.com



-- 
Psyche-list mailing list
Psyche-list@xxxxxxxxxx
https://listman.redhat.com/mailman/listinfo/psyche-list

[Index of Archives]     [Fedora General Discussion]     [Red Hat General Discussion]     [Centos]     [Kernel]     [Red Hat Install]     [Red Hat Watch]     [Red Hat Development]     [Red Hat 9]     [Gimp]     [Yosemite News]

  Powered by Linux