Link to home
Start Free TrialLog in
Avatar of lourite
louriteFlag for United States of America

asked on

PHP Fatal error: Call to undefined function snmpwalk()

Starting out playing with the PHPCLI and snmp functionality.  
--Running php 5.0.4, phpinfo displays '--enable-ucd-snmp-hack' '.
--Downloaded net-snmp 5.3.1 rpm and upgraded via rpm -u as older version already existed on system.
Wrote short script to just test things out...
----------------------------------------------------
#!/usr/bin/php
<?
$sysname = snmpwalk('hostname', 'community', 'system.sysName.0');
print '$sysname';
?>
----------------------------------------------
On running script I get the above error.....kinda stuck...any ideas??
ASKER CERTIFIED SOLUTION
Avatar of Rytmis
Rytmis

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of lourite

ASKER

Thanks......that got me one step closer...BTW on Fedora it's yum install php-snmp.i386

Ok now I am getting this error....
-----------------------
No log handling enabled - turning on stderr logging
Cannot find module (LM-SENSORS-MIB): At line 1 in (none)
$sysname
----------------------
What else do I need to do??

I am doubling the points sense this has turned into 2 questions...or should I post a new question??

Avatar of Rytmis
Rytmis

This issue seems to be specific to snmp, which is sadly not something I'm familiar with, sorry. :-/