(PHP 5 >= 5.4.0, PHP 7, PHP 8)
SNMP::getError — Obtiene el último mensaje de error
Devuelve un string con el error de la última solicitud SNMP.
Esta función no contiene ningún parámetro.
String describing error from last SNMP request. String que describe el error de la última solicitud SNMP.
Ejemplo #1 Ejemplo de SNMP::getError()
<?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());
?>
El ejemplo anterior mostrará :
bool(false) string(26) "No response from 127.0.0.1"