CakeFest 2024: The Official CakePHP Conference

SNMP::setSecurity

(PHP 5 >= 5.4.0, PHP 7, PHP 8)

SNMP::setSecurityセキュリティ関連の SNMPv3 セッションパラメータを設定する

説明

public SNMP::setSecurity(
    string $securityLevel,
    string $authProtocol = "",
    string $authPassphrase = "",
    string $privacyProtocol = "",
    string $privacyPassphrase = "",
    string $contextName = "",
    string $contextEngineId = ""
): bool

setSecurity は、 SNMP プロトコルバージョン 3 で使うセキュリティ関連のセッションパラメータを設定します。

パラメータ

securityLevel

セキュリティレベル (noAuthNoPriv|authNoPriv|authPriv)。

authProtocol

認証プロトコル (MD5 あるいは SHA)。

authPassphrase

認証パスフレーズ。

privacyProtocol

プライバシープロトコル (DES あるいは AES)。

privacyPassphrase

プライバシーパスフレーズ。

contextName

コンテキスト名。

contextEngineId

コンテキスト EngineID。

戻り値

成功した場合に true を、失敗した場合に false を返します。

例1 SNMP::setSecurity() の例

<?php
$session
= new SNMP(SNMP::VERSION_3, $hostname, $rwuser, $timeout, $retries);
$session->setSecurity('authPriv', 'MD5', $auth_pass, 'AES', $priv_pass, '', 'aeeeff');
?>

参考

  • SNMP::__construct() - リモート SNMP エージェントへのセッションを表す SNMP インスタンスを作成する
add a note

User Contributed Notes

There are no user contributed notes for this page.
To Top