The SNMP class
(PHP 5 >= 5.4.0, PHP 7)
Einführung
Represents SNMP session.
Klassenbeschreibung
$version
, string $hostname
, string $community
[, int $timeout
= 1000000
[, int $retries
= 5
]] )$sec_level
[, string $auth_protocol
=
[, string $auth_passphrase
=
[, string $priv_protocol
=
[, string $priv_passphrase
=
[, string $contextName
=
[, string $contextEngineID
=
]]]]]] ) : bool$object_id
[, bool $suffix_as_key
= FALSE
[, int $max_repetitions
[, int $non_repeaters
]]] ) : arrayEigenschaften
- max_oids
-
Maximum OID per GET/SET/GETBULK request
- valueretrieval
-
Controls the method how the SNMP values will be returned
SNMP_VALUE_LIBRARY
The return values will be as returned by the Net-SNMP library. SNMP_VALUE_PLAIN
The return values will be the plain value without the SNMP type hint. SNMP_VALUE_OBJECT
The return values will be objects with the properties "value" and "type", where the latter is one of the SNMP_OCTET_STR, SNMP_COUNTER etc. constants. The way "value" is returned is based on which one of SNMP_VALUE_LIBRARY
,SNMP_VALUE_PLAIN
is set - quick_print
-
Value of
quick_print
within the NET-SNMP librarySets the value of
quick_print
within the NET-SNMP library. When this is set (1), the SNMP library will return 'quick printed' values. This means that just the value will be printed. Whenquick_print
is not enabled (default) the UCD SNMP library prints extra information including the type of the value (i.e. IpAddress or OID). Additionally, if quick_print is not enabled, the library prints additional hex values for all strings of three characters or less. - enum_print
-
Controls the way enum values are printed
Parameter toggles if walk/get etc. should automatically lookup enum values in the MIB and return them together with their human readable string.
- oid_output_format
-
Controls OID output format
OID .1.3.6.1.2.1.1.3.0 representation for various oid_output_format values SNMP_OID_OUTPUT_FULL
.iso.org.dod.internet.mgmt.mib-2.system.sysUpTime.sysUpTimeInstance SNMP_OID_OUTPUT_NUMERIC
.1.3.6.1.2.1.1.3.0 SNMP_OID_OUTPUT_MODULE
DISMAN-EVENT-MIB::sysUpTimeInstance SNMP_OID_OUTPUT_SUFFIX
sysUpTimeInstance SNMP_OID_OUTPUT_UCD
system.sysUpTime.sysUpTimeInstance SNMP_OID_OUTPUT_NONE
Undefined - oid_increasing_check
-
Controls disabling check for increasing OID while walking OID tree
Some SNMP agents are known for returning OIDs out of order but can complete the walk anyway. Other agents return OIDs that are out of order and can cause SNMP::walk() to loop indefinitely until memory limit will be reached. PHP SNMP library by default performs OID increasing check and stops walking on OID tree when it detects possible loop with issuing warning about non-increasing OID faced. Set oid_increasing_check to
FALSE
to disable this check. - exceptions_enabled
-
Controls which failures will raise SNMPException instead of warning. Use bitwise OR'ed
SNMP::ERRNO_*
constants. By default all SNMP exceptions are disabled. - info
-
Read-only property with remote agent configuration: hostname, port, default timeout, default retries count
Vordefinierte Konstanten
SNMP Error Types
SNMP::ERRNO_NOERROR
-
No SNMP-specific error occurred.
SNMP::ERRNO_GENERIC
-
A generic SNMP error occurred.
SNMP::ERRNO_TIMEOUT
-
Request to SNMP agent timed out.
SNMP::ERRNO_ERROR_IN_REPLY
-
SNMP agent returned an error in reply.
SNMP::ERRNO_OID_NOT_INCREASING
-
SNMP agent faced OID cycling reporning non-increasing OID while executing (BULK)WALK command. This indicates bogus remote SNMP agent.
SNMP::ERRNO_OID_PARSING_ERROR
-
Library failed while parsing OID (and/or type for SET command). No queries has been made.
SNMP::ERRNO_MULTIPLE_SET_QUERIES
-
Library will use multiple queries for SET operation requested. That means that operation will be performed in a non-transaction manner and second or subsequent chunks may fail if a type or value failure will be faced.
SNMP::ERRNO_ANY
-
All SNMP::ERRNO_* codes bitwise OR'ed.
SNMP Protocol Versions
SNMP::VERSION_1
SNMP::VERSION_2C
,SNMP::VERSION_2c
SNMP::VERSION_3
Inhaltsverzeichnis
- SNMP::close — Close SNMP session
- SNMP::__construct — Creates SNMP instance representing session to remote SNMP agent
- SNMP::get — Fetch an SNMP object
- SNMP::getErrno — Get last error code
- SNMP::getError — Get last error message
- SNMP::getnext — Fetch an SNMP object which follows the given object id
- SNMP::set — Set the value of an SNMP object
- SNMP::setSecurity — Configures security-related SNMPv3 session parameters
- SNMP::walk — Fetch SNMP object subtree
Deutsche Übersetzung
Sie haben gebeten, diese Seite auf Deutsch zu besuchen. Momentan ist nur die Oberfläche übersetzt, aber noch nicht der gesamte Inhalt.Wenn Sie mir bei Übersetzungen helfen wollen, ist Ihr Beitrag willkommen. Alles, was Sie tun müssen, ist, sich auf der Website zu registrieren und mir eine Nachricht zu schicken, in der Sie gebeten werden, Sie der Gruppe der Übersetzer hinzuzufügen, die Ihnen die Möglichkeit gibt, die gewünschten Seiten zu übersetzen. Ein Link am Ende jeder übersetzten Seite zeigt an, dass Sie der Übersetzer sind und einen Link zu Ihrem Profil haben.
Vielen Dank im Voraus.
Dokument erstellt 30/01/2003, zuletzt geändert 26/10/2018
Quelle des gedruckten Dokuments:https://www.gaudry.be/de//php-rf-class.snmp.html
Die Infobro ist eine persönliche Seite, deren Inhalt in meiner alleinigen Verantwortung liegt. Der Text ist unter der CreativeCommons-Lizenz (BY-NC-SA) verfügbar. Weitere Informationen auf die Nutzungsbedingungen und dem Autor.
Referenzen
Diese Verweise und Links verweisen auf Dokumente, die während des Schreibens dieser Seite konsultiert wurden, oder die zusätzliche Informationen liefern können, aber die Autoren dieser Quellen können nicht für den Inhalt dieser Seite verantwortlich gemacht werden.
Der Autor Diese Website ist allein dafür verantwortlich, wie die verschiedenen Konzepte und Freiheiten, die mit den Nachschlagewerken gemacht werden, hier dargestellt werden. Denken Sie daran, dass Sie mehrere Quellinformationen austauschen müssen, um das Risiko von Fehlern zu reduzieren.