array ( 0 => 'index.php', 1 => 'PHP Manual', ), 'head' => array ( 0 => 'UTF-8', 1 => 'fr', ), 'this' => array ( 0 => 'snmp.geterrno.php', 1 => 'SNMP::getErrno', ), 'up' => array ( 0 => 'class.snmp.php', 1 => 'SNMP', ), 'prev' => array ( 0 => 'snmp.get.php', 1 => 'SNMP::get', ), 'next' => array ( 0 => 'snmp.geterror.php', 1 => 'SNMP::getError', ), 'alternatives' => array ( ), 'source' => array ( 'lang' => 'fr', 'path' => 'reference/snmp/snmp/geterrno.xml', ), ); $setup["toc"] = $TOC; $setup["toc_deprecated"] = $TOC_DEPRECATED; $setup["parents"] = $PARENTS; manual_setup($setup); ?>
(PHP 5 >= 5.4.0, PHP 7, PHP 8)
SNMP::getErrno — Récupère le dernier code erreur
Cette fonction ne contient aucun paramètre.
Retourne un des codes erreurs SNMP décrits dans le chapitre sur les constantes.
Exemple #1 SNMP::getErrno() example
<?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->getErrno() == SNMP::ERRNO_TIMEOUT);
//var_dump($session->getError());
?>
L'exemple ci-dessus va afficher :
bool(false) bool(true) string(26) "No response from 127.0.0.1"