0

EDIT

I feel pretty stupid about this. I just now noticed that on the CLI it returned the oid.1. PHP was just erroring out due to me not having the .1 at the end of the oid.



Here's what I have. I'm trying to poll a Cisco device to gather information regarding temperature, CPU usage, interface usage, etc via SNMP.

OS: CentOS 6.5 64bit PHP: 5.4.28 NET-SNMP Support: Enabled NET-SNMP Version: 5.5 PHP SNMP Version: 0.1

I'm able to perform the following and get the expected results.

snmpwalk 10.0.0.1 -c communityname -v 2c .1.3.6.1.4.1.9.9.109.1.1.1.1.5 2>/dev/null

This will return with

CISCO-PROCESS-MIB::cpmCPUTOtal5min.1 = Guage32: 1

However, if I try to run the following via PHP I don't get the same result.

$cpu = snmp2_get("10.0.0.1", "communityname", ".1.3.6.1.4.1.9.9.109.1.1.1.1.5");

Instead, that outputs this.

snmp2_get(): Error in packet at 'SNMPv2-SMI::enterprises.9.9.109.1.1.1.1.5': No Such Instance currently exists at this OID

I don't know what I'm missing and to be honest I'm probably searching for the wrong thing to get me going in the direction I need. I don't understand why PHP keeps trying to use the SNMPv2-SMI mib vs the CISCO-PROCESS-MIB.

Any help is greatly appreciated.

Thanks!

koeus
  • 23
  • 5

1 Answers1

0

I feel pretty stupid about this. I just now noticed that on the CLI it returned the oid.1. PHP was just erroring out due to me not having the .1 at the end of the oid.

koeus
  • 23
  • 5