snmpgetnext

(PHP 5, PHP 7, PHP 8)

snmpgetnextRecupera un objeto SNMP que sigue inmediatamente al objeto proporcionado

Descripción

snmpgetnext(
    string $hostname,
    string $community,
    array|string $object_id,
    int $timeout = -1,
    int $retries = -1
): mixed

La función snmpgetnext() se utiliza para leer el valor de un objeto SNMP que sigue inmediatamente al objeto cuyo identificador es especificado por el parámetro object_id.

Parámetros

hostname

El nombre del host del agente SNMP (servidor).

community

La comunidad de lectura.

object_id

El identificador del objeto SNMP que precede al deseado.

timeout

El número de microsegundos antes del primer tiempo límite.

retries

El número de intentos en caso de que ocurra un tiempo límite.

Valores devueltos

Devuelve el valor del objeto SNMP en caso de éxito o false si ocurre un error. En caso de error, se emitirá una alerta de tipo E_WARNING.

Ejemplos

Ejemplo #1 Ejemplo con snmpgetnext()

<?php
$nameOfSecondInterface
= snmpgetnext('localhost', 'public', 'IF-MIB::ifName.1');
?>

Ver también

add a note

User Contributed Notes 1 note

up
-2
achalsaraiya at yahoo dot co dot in
15 years ago
with snmpget api, the agent returns the value associated
with the OID (or OIDs) specified in the original request.
The snmpgetnext api is similar, but the agent returns the
value associated with the next (valid) OID

eg:
snmpgetnext('192.168.40.134',
'public',
'SNMPv2-MIB::sysUpTime.0');

will give the output:
STRING: user@hostname
To Top