« Munin HP plugin » : différence entre les versions

Aller à la navigation Aller à la recherche
624 octets ajoutés ,  16 décembre 2015
 
(6 versions intermédiaires par le même utilisateur non affichées)
Ligne 1 : Ligne 1 :
* https://github.com/mhagander/munin-plugins
[[Category:serveur]]
[[Category:debian]]
[[Category:monitoring]]
 
* src : https://github.com/mhagander/munin-plugins


=hpacu HP Array Controllers=
=hpacu HP Array Controllers=
Ligne 234 : Ligne 238 :
if ( $ARGV[0] and $ARGV[0] eq "config") {
if ( $ARGV[0] and $ARGV[0] eq "config") {
   print "graph_title HP Fans\n";
   print "graph_title HP Fans\n";
   print "graph_category system\n";
   print "graph_category sensors\n";
   print "ok.label Fans OK\n";
   print "ok.label Fans OK\n";
   print "ok.type GAUGE\n";
   print "ok.type GAUGE\n";
Ligne 271 : Ligne 275 :


<pre>
<pre>
==
#!/usr/bin/env perl
#!/usr/bin/env perl
#
#
Ligne 335 : Ligne 338 :
if ( $ARGV[0] and $ARGV[0] eq "config") {
if ( $ARGV[0] and $ARGV[0] eq "config") {
   print "graph_title HP Power Supplies\n";
   print "graph_title HP Power Supplies\n";
   print "graph_category system\n";
   print "graph_category sensors\n";
   print "ok.label Power Supplies OK\n";
   print "ok.label Power Supplies OK\n";
   print "ok.type GAUGE\n";
   print "ok.type GAUGE\n";
Ligne 371 : Ligne 374 :
=hptemp=
=hptemp=


diff from https://github.com/mhagander/munin-plugins:
<pre>
<    if (/^\s*(\d+)\s*Basic Sensor\s+(CPU \(\d+\)|Ambient|Processor Zone|Memory Board|System Board|Pwr\. Supply Bay|I\/O Zone|SCSI Backplane)\s+(\S+)\s+\d+F\/\s*(\d+)C\s+\d+F\/\s*(\d+)C/) {
---
>    if (/^\s*(\d+)\s*Basic Sensor\s+(CPU \(\d+\)|Processor Zone|I\/O Zone)\s+(\S+)\s+\d+F\/\s*(\d+)C\s+\d+F\/\s*(\d+)C/) {
</pre>
Cette regexp est susceptible d'évoluer ... en fonction des sensors de HP.
working plugin:
<pre>
<pre>
#!/usr/bin/env perl
#!/usr/bin/env perl
Ligne 438 : Ligne 451 :
   next if /^\s*$/;
   next if /^\s*$/;
   next if /^ID/;
   next if /^ID/;
   if (/^\s*(\d+)\s*Basic Sensor\s+(CPU \(\d+\)|Processor Zone|I\/O Zone)\s+(\S+)\s+\d+F\/\s*(\d+)C\s+\d+F\/\s*(\d+)C/) {
   if (/^\s*(\d+)\s*Basic Sensor\s+(CPU \(\d+\)|Ambient|Processor Zone|Memory Board|System Board|Pwr\. Supply Bay|I\/O Zone|SCSI Backplane|Chassis)\s+(\S+)\s+\d+F\/\s*(\d+)C\s+\d+F\/\s*(\d+)C/) {
       push @sensors, {
       push @sensors, {
'id' => $1,
'id' => $1,
Ligne 455 : Ligne 468 :
if ( $ARGV[0] and $ARGV[0] eq "config") {
if ( $ARGV[0] and $ARGV[0] eq "config") {
   print "graph_title HP temperature\n";
   print "graph_title HP temperature\n";
   print "graph_category system\n";
   print "graph_category sensors\n";
   for my $sensor (@sensors) {
   for my $sensor (@sensors) {
       print "s" . $sensor->{'id'} . ".label " . $sensor->{'name'} . "\n";
       print "s" . $sensor->{'id'} . ".label " . $sensor->{'name'} . "\n";
4 231

modifications

Menu de navigation