Re: [nashvillephp] snmp_ error question

19 views
Skip to first unread message

Jacques Woodcock

unread,
Jan 23, 2013, 8:59:26 PM1/23/13
to nashvi...@googlegroups.com
If you don't get the help you need here, try the irc channel #nashvillephp or the #phpc or #phpmentoring channels.

- Jacques

On Wed, Jan 23, 2013 at 3:10 PM, <cdu...@ccclark.com> wrote:
I am running some code in a for loop to read temperature sensors inside our network at various locations in KY.
I am using snmpget to read the sensor. It reads fine most of the time.
I send an email if there was a problem reading the sensors, otherwise I build a string I am writing to a table using an sql statement.
My problem is that I do not know how to "trap" the error code if the read fails. I would like to log all failures and why in a log file for analysis.
My thought was that I should have a line inside the if using getErrno that would return the last snmp error but this did not work. I have not had much luck finding a working example.
All I want is the error number returned if I am sending an error message so I know what the problem may be.
Any suggestions would be appreciated.

--
You received this message because you are subscribed to the Google Groups "Nashville PHP User Group" group.
To post to this group, send email to nashvi...@googlegroups.com.
To unsubscribe from this group, send email to nashvillephp...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msg/nashvillephp/-/ko1-HCb3qk4J.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Henry Retter

unread,
Jan 27, 2013, 3:22:13 PM1/27/13
to nashvi...@googlegroups.com
could you post the loop code?
Reply all
Reply to author
Forward
0 new messages