This can be used to parse the returned values depending on the quick print setting. For example sysUpTime might look something like this: "Timeticks: (34575334) 4 days, 0:02:33.34", but if quick print is enabled it will be on the form: "4:0:2:33.34". To get the same output you can parse it differently, something like:
if(@ $sysUpTime = snmpget($switch,$community,"system.sysUpTime.0")){
if(snmp_get_quick_print()){
sscanf($sysUpTime, "%d:%d:%d:%d.%d",$day,$hour,$minute,$sec,$ticks);
$sysUpTime = "$day days, $hour:$minute:$sec.$ticks";
}else{
$sysUpTime = ereg_replace("Timeticks: \([0-9]+\) ","",$sysUpTime);
}
}
snmp_get_quick_print
(PHP 4, PHP 5)
snmp_get_quick_print — UCD ライブラリの quick_print の現在の設定値を取得する
説明
bool snmp_get_quick_print
( void
)
UCD ライブラリに保持された quick_print の現在の値を返します。 デフォルトでは、quick_print はオフです。
返り値
quick_print がオンの場合に TRUE、それ以外の場合に FALSE を返します。
例
例1 snmp_get_quick_print() の例
<?php
$quickprint = snmp_get_quick_print();
?>
snmp_get_quick_print
antic
23-Feb-2003 10:13
23-Feb-2003 10:13
