SNMP::setSecurity
Configures security-related SNMPv3 session parameters
Description
public bool SNMP::setSecurity(
string $securityLevel,
string $authProtocol = "",
string $authPassphrase = "",
string $privacyProtocol = "",
string $privacyPassphrase = "",
string $contextName = "",
string $contextEngineId = ""
)
setSecurity configures security-related session parameters used in SNMP protocol version 3
Parameters
-
securityLevel
-
The security level:
"noAuthNoPriv",
"authNoPriv", or "authPriv".
-
authProtocol
-
The authentication protocol:
"MD5", "SHA",
"SHA256", or "SHA512".
-
authPassphrase
-
The authentication passphrase.
-
privacyProtocol
-
The privacy protocol:
"DES", or "AES",
also accepted as "AES128". "AES192", "AES192C",
"AES256", and "AES256C" are accepted when supported by the
Net-SNMP library.
-
privacyPassphrase
-
The privacy passphrase.
-
contextName
-
the context name
-
contextEngineId
-
the context EngineID
Return Values
Returns true on success or false on failure.
Examples
Example #1 SNMP::setSecurity example
<?php
$session = new SNMP(SNMP::VERSION_3, $hostname, $rwuser, $timeout, $retries);
$session->setSecurity('authPriv', 'MD5', $auth_pass, 'AES', $priv_pass, '', 'aeeeff');
?>