bash script 範例
snmpwalk -v 1 -c public 10.10.10.1 1.3.6.1.2.1.33.1.2.3
php範例
$host='10.10.10.1';
snmp_read_mib('./RFC1628cs121.MIB');
snmp_read_mib('./SW-USHA_MIB_v2.08.mib');
$a = snmpwalkoid($host, "public", "UPS-MIB::upsEstimatedMinutesRemaining");
//$a = snmpwalkoid($host, "public", "");
//$a = snmpwalk($host, "public", "USHA");
foreach ($a as $key=>$val) { echo "$key = $val\n"; }
UPS MIB 資訊
UPS-MIB::upsBatteryStatus.0 = INTEGER: batteryNormal(2)
UPS-MIB::upsSecondsOnBattery.0 = INTEGER: 0 seconds
UPS-MIB::upsEstimatedMinutesRemaining.0 = INTEGER: 18 minutes
UPS-MIB::upsEstimatedChargeRemaining.0 = INTEGER: 100 percent
UPS-MIB::upsBatteryVoltage.0 = INTEGER: 4330 0.1 Volt DC
UPS-MIB::upsBatteryCurrent.0 = Wrong Type (should be INTEGER): NULL
UPS-MIB::upsBatteryTemperature.0 = INTEGER: 38 degrees Centigrade