Nagios Exchange
  • Home
  • Directory
  • 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

Join our next live webinar: “Advanced Nagios Monitoring Techniques” – Register Now

Plugins4379Themes and Skins11Addons732Documentation283Graphics 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
SQLServer Check MSSql Job Status
RSS Feed
Newest Listings Updated Listings
Top Contributors
Julien DESMAREST (4)Davide Lemma (4)deskwork_itunes142 (4)Joerg Hoerter (3)TcoUpLoad (1)
See More
Newest Contributors
Community Member (51)Davide Lemma (4)Alarig Le Lay (1)Penn Rabb (1)Sean Falzon (1)
See More
Home > Tom Kerremans
TK

Tom Kerremans

@harakiri

User Stats

Favorites1

Views1

Projects1

Check for unexpected reboot
Windows
Check for unexpected reboot
check_unexpected_reboot.cmd is a Windows cmd script that checks for a reboot after a crash or power outage of a Windows machine.
0.0 (0)
60.3K
1
Tom Kerremans
GPL
check_jstat

Small bug and sidenote

The author copied code and forgot to adapt a variable. Line 143 and 147: 'cs' should become 'ws' (otherwise no warning treshhold) For all else this works fine. Jstat is also less intrusive to your JVM than jmap. Be sure to add this plugin to /etc/sudoers or run the test as the same uid as the JVM. Otherwise jstat will get access denied.

Reviewed 13 years ago

check_ganglia

Incomplete, here 's a patch

Two things are needed. First of all, you need to run "cpan DateTime::Format::Epoch::Unix" to install this module. If anyone knows an RPM on RHEL/Centos please leave a comment. Next, the biggest problem, the correct exit status when treshhold is reached doesn't work. So I fixed it. I'm not a Perl programmer, so if it looks somewhat crude, please excuse me. Copy/paste the following code and run it as a patch: --- /tmp/check_ganglia.pl 2013-03-21 12:43:48.000000000 +0100 +++ check_ganglia.pl 2013-03-22 08:38:48.574700147 +0100 @@ -14,7 +14,6 @@ # TODO: call $cluster{host} hash directly instead of seeking within it. # TODO: Fix some clusters that don't match host checks... # TODO: add retval matching (range, string, etc) -# TODO: fix warn/crit to measure returned metric # TODO: !!! NEXT !!! call $cluster{host} hash directly instead of seeking within it. # TODO: !!! NEXT !!! better, pass in cluster:host context for direct passing of XML # TODO: !!! NEXT !!! use syntax localhost:8652 TCP @@ -22,6 +21,7 @@ # TODO: !!! NEXT !!! Or, since that requires knowing the CLUSTER, make it option and check the hostname as key # TODO: !!! NEXT !!! for the hash of each cluster found. Still reduces cpu/time drastically # +# 2013-03-22: Tom Kerremans: fixed warn/crit to measure returned metric, removed some obsolete notifications ########### # core modules needed: @@ -72,6 +72,7 @@ exit $ERRORS{'CRITICAL'}; } + sub isnumeric() { my ($x) = @_; @@ -128,14 +129,14 @@ } #/ if hostcheck if (defined($warn)) { - print "WARN definedn"; + #print "WARN definedn"; #if ( ! isnumeric($warn) ) { die "NOT NUMERIC n"; } #die "NOT NUMERIC n" if ( ! isnumeric($warn) ) ; die "## $warn is NOT NUMERIC n" if $_ =~ s/[a-z]//; } if (defined($crit)) { - print "CRIT definedn"; + #print "CRIT definedn"; } } #/ sub processargs @@ -301,9 +302,9 @@ ###: ELI: WTF did I put this in here for?? ### DELETEME -### FUNC: output_match -#sub output_match { -#my $output = shift; +## FUNC: output_match +sub output_match { +my $output = shift; # perform string regex match on retval: # if ( "$output" =~ /.*$match.*/ ) { @@ -314,17 +315,20 @@ # exit 2; # } -## perform range check for warn/crit values: -# if ( "$output" >= "$crit" ) { -# exit 1; -# } elsif ( "$output" >= "$warn" ) { -# exit 2; -# } else { -# exit 0; -# } +# perform range check for warn/crit values: + if ( "$output" >= "$crit" ) { + print "CRITICAL: $metric = $output higher than treshhold of $critn"; + exit 2; + } elsif ( "$output" >= "$warn" ) { + print "WARNING: $metric = $output higher than treshhold of $warnn"; + exit 1; + } else { + print "OK: $metric = $outputn"; + exit 0; + } -#} #/sub -### /FUNC: output_match +} #/sub +## /FUNC: output_match #^^^^ ##: ELI: WTF did I put this in here for?? #^^^^ ## DELETEME @@ -386,14 +390,14 @@ print "UNKNOWN: ($metric) not found in host XML! ","n"; exit $ERRORS{'UNKNOWN'} } else { - print "OK: $metric = $host_metrics{$metric} n"; - exit $ERRORS{'OK'}; + &output_match ($host_metrics{$metric}); } } # /unless ($metric) } else {# /if ($hostname eq) } # /if hostname loop through hash. We've exhausted input data, exit now: + } # /foreach $hostkey # don't exit here, create exit at end of all arrays to be searched (after function exits searching the last hash)

Reviewed 13 years ago

No Favorites Found

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

Privacy PolicyTerms of UseTrademarks