Nagios Exchange Nagios Exchange
  • Home
  • Directory
  • Library
  • Support
  • About

Advanced Search

Build precise queries to find exactly what you need

Search Logic

Select compatible versions

Press ESC to close

Sign In Sign Up

Nagios World Conference 2026: Sept. 14-17 in St. Paul, MN | Learn More

  • Home
  • Directory
  • Library
  • Support
  • About
Plugins4405Themes and Skins13Add-ons757Graphics and Logos36View All Categories
LinuxSecuritySNMPFile SystemCloud
New Listings Recently Updated Listings Most Favored Listings Most Popular Listings Most Rated Listings Most Reviewed Listings
Random Project
Clustering and High-Availability check_hadoop_metrics.pl (Advanced Nagios Plugins Collection)
0.0 (0)
29.3K
RSS Feed
Newest Listings Updated Listings
Top Contributors
Yoann LAMY (7)deskwork_itunes142 (4)Julien DESMAREST (3)Davide Lemma (3)Chad Columbus (3)
See More
Newest Contributors
signalgrid (1)Sanna Glue (2)fisherrs (1)smolinux (1)juanfertor (1)
See More

Copyright © 2009-2026 Nagios Enterprises, LLC. All rights reserved.

Privacy PolicyTerms of UseTrademarks
Home > Mike Cook
MC

Mike Cook

@mikecook

User Stats

Member Since: August 7, 2013

Favorites0

Views

Projects0

No Projects Found
check_sentry3

Great after a few fixes, listed below

@@ -12,9 +12,10 @@ # Prerequisite Perl modules: # # Net::SNMP -# Nagios::Plugin +# Nagios::Plugin (version 0.36 or later) # # Though Net::SNMP may be installable using package systems such as yum or apt, +# if you don't have Nagios::Plugin packaged at version 0.36 or later, # Nagios::Plugin may have to be done by hand like this: # # $ perl -MCPAN -e 'install Nagios::Plugin' @@ -193,7 +194,19 @@ sub nagios_report { $count +=1; # Define the values we are going to test against - $nagios_value[$count] = sprintf("%.2f",$poll_results{$key}); + # Do this after "$count +=1" so we can correctly index results to exact sensors. + # If only humidity sensor "1" and "3" are plugged in don't show result for "2". + # e.g "SERVERTECH_HUMIDITY WARNING - Humidity1 @ 39.00%, Humidity3 @ 41.00% + # | Humidity1=39.00%;30;85 Humidity3=41.00%;30;85". + # This also prevents perf data shifting to a new key if you add a sensor. + if ($poll_results{$key} >= 0){ + $nagios_value[$count] = sprintf("%.2f",$poll_results{$key}); + } else { + # Don't add negative numbers to @nagios_value that cause Nagios::Plugin::Range + # (via check_threshold) test to fail. + # Also don't add empty sensor data to the perf hashes. + next; + } # Process the value if ($cmd_flags{do_temp}){ @@ -255,6 +268,9 @@ sub nagios_report { } } + # remove undefs now that $message has sensor postions set by $nagios_value[$count] + @nagios_value = grep defined, @nagios_value; + # Remove trailing comma from $message $message =~ s/,+s+$//g; @@ -554,9 +570,10 @@ print STDERR << "EOF"; Prerequisite Perl modules: Net::SNMP - Nagios::Plugin + Nagios::Plugin (version 0.36 or later) Though Net::SNMP may be installable using package systems such as yum or apt, + if you don't have Nagios::Plugin packaged at version 0.36 or later, Nagios::Plugin may have to be done by hand like this: # perl -MCPAN -e 'install Nagios::Plugin'

Reviewed 13 years ago

No Favorites Found

Copyright © 2009-2026 Nagios Enterprises, LLC. All rights reserved.

Privacy PolicyTerms of UseTrademarks
Home Browse Submit Profile