Debian Codegraph @

check_hp_bladechassis/src/check_hp_bladechassis.php

raw symbols SCIP
1 <?php
2 #
3 # PNP4Nagios template for check_hp_bladechassis
4 # http://folk.uio.no/trondham/software/check_hp_bladechassis.html
5 #
6 # $Id: check_hp_bladechassis.php 15736 2009-11-06 14:10:38Z trondham $
7 #
8
9 # Color for power usage in watts
10 $PWRcolor = "66FF00";
11
12 # Counters
13 $count = 0; # general counter
14
15 # Title
16 $def_title = 'HP Blade Enclosure';
17
18 # Loop through the performance data
19 foreach ($DS as $i) {
20
21 # Total Wattage
22 if(preg_match('/^total_watt/',$NAME[$i]) && $UNIT[$i] == 'W') {
23 $NAME[$i] = 'Total Power Usage';
24
25 ++$count;
26 $ds_name[$count] = "Total Power Consumption";
27 $vlabel = "Watt";
28
29 $title = $ds_name[$count];
30
31 $opt[$count] = "--slope-mode --vertical-label \"$vlabel\" --title \"$def_title: $title\" ";
32
33 $def[$count] = "DEF:var$i=$rrdfile:$DS[$i]:AVERAGE " ;
34 $def[$count] .= "AREA:var$i#$PWRcolor:\"$NAME[$i]\" " ;
35 $def[$count] .= "LINE:var$i#000000: " ;
36 $def[$count] .= "GPRINT:var$i:LAST:\"%6.0lf $UNIT[$i] last \" ";
37 $def[$count] .= "GPRINT:var$i:MAX:\"%6.0lf $UNIT[$i] max \" ";
38 $def[$count] .= "GPRINT:var$i:AVERAGE:\"%6.2lf $UNIT[$i] avg \\n\" ";
39 }
40
41 }
42 ?>