|
@@ -0,0 +1,262 @@
|
|
|
+<?php
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+require_once("check_naf_helper.php");
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+$graphs = 0;
|
|
|
+
|
|
|
+
|
|
|
+while( count($this->DS) > 0 ) {
|
|
|
+ $VAL = array_shift($this->DS);
|
|
|
+
|
|
|
+ if ($VAL['NAME'] == 'nacache_usage') {
|
|
|
+ $opt[$graphs]['title'] = "PAM cache usage on " . $this->MACRO['DISP_HOSTNAME'];
|
|
|
+ $opt[$graphs]['labels'] = array("PAM cache usage");
|
|
|
+
|
|
|
+ $ds_name[$graphs] = "PAM cache usage";
|
|
|
+
|
|
|
+
|
|
|
+ $def[$graphs] = array($VAL['ACT'], 100.0 - $VAL['ACT']);
|
|
|
+
|
|
|
+
|
|
|
+ } elseif (substr($VAL['NAME'], 0, 8) == 'nacache_') {
|
|
|
+ $o_hits = $VAL;
|
|
|
+ $o_miss = array_shift($this->DS);
|
|
|
+ $o_evict = array_shift($this->DS);
|
|
|
+ $o_inval = array_shift($this->DS);
|
|
|
+ $o_insert = array_shift($this->DS);
|
|
|
+
|
|
|
+ $opt[$graphs]['title'] = "PAM ops/s on " . $this->MACRO['DISP_HOSTNAME'];
|
|
|
+ $opt[$graphs]['labels'] = array("hits", "miss", "evict", "inval", "insert");
|
|
|
+
|
|
|
+ $ds_name[$graphs] = "PAM ops/s";
|
|
|
+
|
|
|
+ $def[$graphs] = array($o_hits['ACT'], $o_miss['ACT'], $o_evict['ACT'], $o_inval['ACT'], $o_insert['ACT']);
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
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(substr($VAL['NAME'], 0, 6) == 'navdu_') {
|
|
|
+ $v_du = $VAL;
|
|
|
+ $v_dt = array_shift($this->DS);
|
|
|
+ $v_su = array_shift($this->DS);
|
|
|
+ $v_st = array_shift($this->DS);
|
|
|
+
|
|
|
+ $opt[$graphs]['title'] = substr($VAL['NAME'], 6) . " on " . $this->MACRO['DISP_HOSTNAME'];
|
|
|
+ $opt[$graphs]['labels'] = array("used", "free", "over resv.", "free snap", "used snap");
|
|
|
+ $opt[$graphs]['colors'] = array("#AAAAAA", "#00FF00", "#AA0000", "#00FFFF", "#0000CC");
|
|
|
+
|
|
|
+ $ds_name[$graphs] = "Volume " . substr($VAL['NAME'], 6);
|
|
|
+
|
|
|
+ $du = $v_du['ACT'];
|
|
|
+ $dt = $v_dt['ACT'];
|
|
|
+ $supo = $v_su['ACT'];
|
|
|
+ $st = $v_st['ACT'];
|
|
|
+
|
|
|
+ $sf = ($supo <= $st) ? $st - $supo : 0;
|
|
|
+ $su = ($supo > $st) ? $st : $supo;
|
|
|
+ $so = ($supo > $st) ? $supo - $st : 0;
|
|
|
+ $df = $dt - $du - $so;
|
|
|
+
|
|
|
+ $def[$graphs] = array($du, $df, $so, $sf, $su);
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ } elseif (substr($VAL['NAME'], 0, 6) == 'naviu_') {
|
|
|
+ $v_iu = $VAL;
|
|
|
+ $v_it = array_shift($this->DS);
|
|
|
+
|
|
|
+ $opt[$graphs]['title'] = "INode usage on " . $this->MACRO['DISP_HOSTNAME'];
|
|
|
+ $opt[$graphs]['labels'] = array("used", "");
|
|
|
+
|
|
|
+ $ds_name[$graphs] = "INode usage on " . substr($VAL['NAME'], 6);
|
|
|
+
|
|
|
+ $def[$graphs] = array($v_iu['ACT'], $v_it['ACT'] - $v_iu['ACT']);
|
|
|
+
|
|
|
+
|
|
|
+ } else {
|
|
|
+ $values = array();
|
|
|
+ $labels = array();
|
|
|
+ $value = -1;
|
|
|
+
|
|
|
+ if ($VAL['MIN'] != "") {
|
|
|
+ $value = $VAL['ACT'] - $VAL['MIN'];
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ $value - $VAL['ACT'];
|
|
|
+ }
|
|
|
+ array_push($values, $value);
|
|
|
+ array_push($labels, $VAL['LABEL']);
|
|
|
+
|
|
|
+ if ($VAL['MAX'] != "") {
|
|
|
+ $value = $VAL['MAX'] - $VAL['ACT'];
|
|
|
+ array_push($values, $value);
|
|
|
+ array_push($labels, "");
|
|
|
+ }
|
|
|
+ elseif ($VAL['UNIT'] == "%%") {
|
|
|
+ $value = 100.0 - $VAL['ACT'];
|
|
|
+ array_push($values, $value);
|
|
|
+ array_push($labels, "");
|
|
|
+ }
|
|
|
+
|
|
|
+ $def[$KEY] = $values;
|
|
|
+ $opt[$KEY]['title'] = $this->MACRO['DISP_HOSTNAME'] . ' / ' . $this->MACRO['DISP_SERVICEDESC'];
|
|
|
+ $opt[$KEY]['labels'] = $labels;
|
|
|
+ $ds_name[$graphs] = $VAL['LABEL'];
|
|
|
+ }
|
|
|
+
|
|
|
+ $graphs++;
|
|
|
+}
|
|
|
+?>
|