Questions about using SNMP-related functions in PHP

Source: Internet
Author: User
Tags snmp snmpwalk
Questions about using SNMP-related functions in PHP
The SNMP service is configured

Use PHP_SNMP. DLL module

Using function Snmpwalk

The original code is as follows
$a = snmpwalkoid ("127.0.0.1", "Public", "" ");
?>


for (reset ($a); $i = key ($a); next ($a)) {
echo "$i: $a [$i]
\ n ";
}
?>
This is fine, but once you specify the relevant object, it will be a problem snmpwalk the original code provided in the Help documentation

$host = ' 127.0.0.1 ';
$community = ' public ';
$object _id = ' if-mib::interfaces.iftables.ifentry.ifadminstatus ';

$sysdesc = Snmpwalk ($host, $community, $object _id);
Print_r ($SYSDESC);
?>

Prompt Snmpwalk Error
But there's something out there.

Error message Warning:snmpwalk () [Function.snmpwalk]: Invalid object Identifier:if-mib:: Interfaces.ifTables.ifEntry.ifAdminStatus in E:\work\php\black\snmpwalk3.php on line 6

Output information
Array ([0] = "Windows www-476f9be6f90 5.1.2600 Service Pack 3 XP Professional x86 Family 6 Model 1 Stepping 10" [] = oid:enterprises.8072.3.2.13 [2] = Timeticks: (138255) 0:23:02.55 [3] = = "Me" [4] = = "Www-476f9be6f90" [5 ] = "Right here, right now." [6] = = Timeticks: (4) 0:00:00.04 [7] = oid:31 [8] = oid:49 [9] = = Oid:4 [ten] = oid:50 [one] = OID :. iso.org.dod.internet.snmpv2.snmpmodules.1 [+] = OID:. iso.org.dod.internet.snmpv2.snmpmodules.16.2.2.1 [13] = > OID:

Ask for help

------Solution--------------------
' If-mib::interfaces.iftables.ifentry.ifadminstatus '
I had this problem at the beginning.
These expressions are found on the web, as if they were dedicated to Linux.
Under Windows systems, you need an address that begins with an. iso., or 0.1.3.6 in digital form.
ISO is 1.

Invalid object identifier means that the ' if-mib::interfaces.iftables.ifentry.ifadminstatus ' does not exist.
  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.