SHARE
TWEET

Untitled

a guest Aug 23rd, 2019 86 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Polling OS File
  2. =========================================================================================
  3. <?php
  4.  
  5. use LibreNMS\RRD\RrdDefinition;
  6.  
  7. $signal = snmp_get($device, '.1.3.6.1.4.1.14988.1.1.1.1.1.4.7', '-OQv', 'MIKROTIK-MIB');
  8.  
  9. if (is_numeric($signal)) {
  10.     $rrd_def = RrdDefinition::make()->addDataset('quality', 'GAUGE', 0);
  11.  
  12.     $fields = array(
  13.         'quality' => $signal,
  14.     );
  15.  
  16.     $tags = compact('rrd_def');
  17.     data_update($device, 'signal_quality', $tags, $fields);
  18.     $graphs['signal_quality'] = true;
  19. }
  20.  
  21.  
  22. Device Graph File
  23. ======================================================================================
  24. <?php
  25.  
  26. $rrd_filename = rrd_name($device['hostname'], 'signal_quality');
  27.  
  28. require 'includes/graphs/common.inc.php';
  29.  
  30. $ds = 'quality';
  31.  
  32. $colour_area = '9999cc';
  33. $colour_line = '0000cc';
  34.  
  35. $colour_area_max = '9999cc';
  36.  
  37. $graph_max = 1;
  38. $graph_min = 0;
  39.  
  40. $unit_text = 'Signal_Quality';
  41.  
  42. require 'includes/graphs/generic_simplex.inc.php';
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top