SNMP::getError

(PHP 5 >= 5.4.0, PHP 7)
Get last error message
public string SNMP::getError ( void )

Returns string with error from last SNMP request.

Returns:

String describing error from last SNMP request.

Examples:
SNMP::getError() example
1
2
3
4
5
<?php
$session new SNMP(SNMP::VERSION_2c, '127.0.0.1''boguscommunity');
var_dump(@$session->get('.1.3.6.1.2.1.1.1.0'));
var_dump($session->getError());
?>

The above example will output:

bool(false)
string(26) "No response from 127.0.0.1"
See also:

SNMP::getErrno() -

doc_php
2025-01-10 15:47:30
Comments
Leave a Comment

Please login to continue.