Delicious Bookmark this on Delicious Share on Facebook SlashdotSlashdot It! Digg! Digg



PHP : Function Reference : SNMP Functions : snmp_get_quick_print

snmp_get_quick_print

Fetches the current value of the UCD library's quick_print setting (PHP 4, PHP 5)
bool snmp_get_quick_print ( )

Example 2264. snmp_get_quick_print() example

<?php
$quickprint
= snmp_get_quick_print();
?>

Code Examples / Notes » snmp_get_quick_print

antic

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);
  }
}


Change Language


Follow Navioo On Twitter
snmp_get_quick_print
snmp_get_valueretrieval
snmp_read_mib
snmp_set_enum_print
snmp_set_oid_numeric_print
snmp_set_oid_output_format
snmp_set_quick_print
snmp_set_valueretrieval
snmpget
snmpgetnext
snmprealwalk
snmpset
snmpwalk
snmpwalkoid
eXTReMe Tracker