Longhorn PHP 2023 - Call for Papers


(PHP 4, PHP 5, PHP 7, PHP 8)

snmp_get_quick_print Fetches the current value of the NET-SNMP library's quick_print setting


snmp_get_quick_print(): bool

Returns the current value stored in the NET-SNMP Library for quick_print. quick_print is off by default.


Esta função não possui parâmetros.

Valor Retornado

Returns true if quick_print is on, false otherwise.


Exemplo #1 snmp_get_quick_print() example

= snmp_get_quick_print();

Veja Também

  • snmp_set_quick_print() - Set the value of enable within the NET-SNMP library for a full description of what quick_print does.

add a note

User Contributed Notes 1 note

20 years ago
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")){
       sscanf($sysUpTime, "%d:%d:%d:%d.%d",$day,$hour,$minute,$sec,$ticks);
        $sysUpTime = "$day days, $hour:$minute:$sec.$ticks";
       $sysUpTime = ereg_replace("Timeticks: \([0-9]+\) ","",$sysUpTime);
To Top