123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262 |
- <?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']);
- } elseif (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++;
- }
- ?>
|