]> git.uio.no Git - check_openmanage.git/commitdiff
bugfix for minimal perfdata output
authortrondham <trondham@e53b7cee-c147-0410-b3a0-ae4c1fa63963>
Mon, 14 Feb 2011 16:21:06 +0000 (16:21 +0000)
committertrondham <trondham@e53b7cee-c147-0410-b3a0-ae4c1fa63963>
Mon, 14 Feb 2011 16:21:06 +0000 (16:21 +0000)
git-svn-id: svn+ssh://vcs-usit.uio.no/svnroot/usit-unix-intern/trunk/usit-nagios-plugins/trondham/check_openmanage@19419 e53b7cee-c147-0410-b3a0-ae4c1fa63963

check_openmanage

index 65be4dfea97bd104219418a667646010e3a83735..33d1c67fc1e08f657358e30f9e7debd1c1bb813b 100755 (executable)
@@ -2530,14 +2530,11 @@ sub check_enclosure_temp {
        if (defined $opt{perfdata} && $reading ne '[N/A]') {
            $name =~ s{\A Temperature\sProbe\s(\d+) \z}{temp_$1}gxms;
            my $label = "${name}";
-           my $mini = $label;
-           $mini =~ s{temp_}{t}xms;
            push @perfdata, {
                             type  => 'E',
                             id    => $encl_id,
                             unit  => 'C',
                             label => $label,
-                            mini  => $mini,
                             value => $reading,
                             warn  => $max_warn,
                             crit  => $max_crit,
@@ -2882,7 +2879,6 @@ sub check_fans {
                             id    => $index,
                             unit  => 'rpm',
                             label => $pname,
-                            mini  => 'f',
                             value => $reading,
                             warn  => $max_warn,
                             crit  => $max_crit,
@@ -3209,7 +3205,6 @@ sub check_temperatures {
                                 id    => $index,
                                 unit  => 'C',
                                 label => $pname,
-                                mini  => 't',
                                 value => $reading,
                                 warn  => $max_warn,
                                 crit  => $max_crit,
@@ -3605,7 +3600,6 @@ sub check_volts {
                             id    => $index,
                             unit  => 'V',
                             label => $label,
-                            mini  => 'v',
                             value => $reading,
                             warn  => 0,
                             crit  => 0,
@@ -3845,7 +3839,6 @@ sub check_pwrmonitoring {
                             id    => $index,
                             unit  => $unit,
                             label => $label,
-                            mini  => lc $unit,
                             value => $reading,
                             warn  => $max_warn,
                             crit  => $max_crit,
@@ -4929,8 +4922,12 @@ if (defined $opt{perfdata} && !$opt{debug} && @perfdata) {
     }
 
     # Print performance data sorted
-    my $type = $opt{perfdata} eq 'minimal' ? 'mini' : 'label';
-    print join $lb, map { "$_->{type}$_->{id}_$_->{$type}=$_->{value}$_->{unit};$_->{warn};$_->{crit}" } sort perfsort @perfdata;
+    if ($opt{perfdata} eq 'minimal') {
+       print join $lb, map { "$_->{type}$_->{id}=$_->{value}$_->{unit};$_->{warn};$_->{crit}" } sort perfsort @perfdata;
+    }
+    else {
+       print join $lb, map { "$_->{type}$_->{id}_$_->{label}=$_->{value}$_->{unit};$_->{warn};$_->{crit}" } sort perfsort @perfdata;
+    }
 }
 
 # Print a linebreak at the end