CakeFest 2024: The Official CakePHP Conference

SNMP::getError

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

SNMP::getError直近のエラーメッセージを取得する

説明

public SNMP::getError(): string

直近の SNMP リクエストのエラー文字列を返します。

パラメータ

この関数にはパラメータはありません。

戻り値

直近の SNMP リクエストからのエラーを表す文字列を返します。

例1 SNMP::getError() の例

<?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->getError());
?>

上の例の出力は以下となります。

bool(false)
string(26) "No response from 127.0.0.1"

参考

add a note

User Contributed Notes

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