rhyspaterson Posted May 27, 2008 Share Posted May 27, 2008 Hey Guys, $query = snmpget($host, $community, $oid, $timeout, $retry); Code works fine for devices that respond. However, when they don't, i get the following error: PHP Warning: snmpget() [function.snmpget]: No response from (insert device name here) The PHP manual says snmpget will return false when it fails. I have tried to catch it as below: $query = snmpget($host, $community, $oid, $timeout, $retry); if ($query == FALSE}{ echo "Device is not responding!"; exit(); } I have also tried this horrendous code: if (snmp2_get($host, $community, $oid, $timeout, $retry) == FALSE){ echo "Device is not responding!"; exit(); } But i still get the original 'no response' error that PHP throws me. I have tried using NULL and TRY/CATCH but no luck. Could anyone kick me in the right direction? Cheers! Quote Link to comment Share on other sites More sharing options...
rhyspaterson Posted May 28, 2008 Author Share Posted May 28, 2008 I'm wondering, is the 'No response from (insert device name here)' not an error, but something that snmpget is programmed to return.. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.