Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:mnhauke:monitoring
monitoring-plugins-snmp_brocade
check_brocade_sfptemp.php
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File check_brocade_sfptemp.php of Package monitoring-plugins-snmp_brocade
<?php # Define some colors $red = '#FF0000'; $magenta = '#FF00FF'; $navy = '#000080'; $green = '#008000'; $yellow = '#FFFF00'; $orangered = '#FF4500'; $darkred = '#8B0000'; $blue = '#0000FF'; $darkblue = '#000099'; $darkorange = '#FF8C00'; $line[1] = $darkblue; $line[2] = $magenta; $line[3] = $darkorange; $line[4] = $green; # Define some initial variables $counter1 = 1; $counter2 = 1; $port_number = 0; $line_no = 1; $graph_complete = 0; # Replace underscores in services descriptions $servicedesc = str_replace("_", " ", $servicedesc); # Main logic foreach ($DS as $i) { if ($counter2 == 5) { $counter1++; $counter2 = 1; $line_no = 1; } if ($counter2 == 1) { $graph_complete = 1; $old_port_number = $port_number; $opt[$counter1] = '--vertical-label " Degrees Celsius" --height 250 --lower-limit 40 --upper-limit 75 --title "' . $hostname . ' / ' . $servicedesc . '"'; $def[$counter1] = "DEF:port_$port_number=$RRDFILE[$i]:$DS[$i]:AVERAGE "; } else { $ds_name[$counter1] = "Port-$old_port_number - Port-$port_number"; $def[$counter1] .= "DEF:port_$port_number=$RRDFILE[$i]:$DS[$i]:AVERAGE "; } $def[$counter1] .= "LINE1:port_$port_number$line[$line_no]:\"$NAME[$i]\" "; $def[$counter1] .= "GPRINT:port_$port_number:LAST:\"%3.2lf $UNIT[$i] LAST \" "; $def[$counter1] .= "GPRINT:port_$port_number:MAX:\"%3.2lf $UNIT[$i] MAX \" "; $def[$counter1] .= "GPRINT:port_$port_number:AVERAGE:\"%3.2lf $UNIT[$i] AVERAGE \\n\" "; if ($counter2 == 4) { $def[$counter1] .= "HRULE:$WARN[1]$yellow:\"Warning \: $WARN[1] Degrees Celsius \\n\" " ; $def[$counter1] .= "HRULE:$CRIT[1]$red:\"Critical\: $CRIT[1] Degrees Celsius \" " ; $graph_complete = 0; } $port_number++; $counter2++; $line_no++; } if ($graph_complete == 1) { if ($port_number == 1) { # In case you have only one(!) CPU the loop will not work and therefore # $ds_name has to be added here. $ds_name[$counter1] = "CPU-0"; } $def[$counter1] .= "HRULE:$WARN[1]$yellow:\"Warning \: $WARN[1] Degrees Celsius \\n\" " ; $def[$counter1] .= "HRULE:$CRIT[1]$red:\"Critical\: $CRIT[1] Degrees Celsius \" " ; } ?>
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor