Build precise queries to find exactly what you need
Press ESC to close
Join our next live webinar: “Advanced Nagios Monitoring Techniques” – Register Now
Your review has been submitted and is pending approval.
check_http_content is a web content monitor written in perl. Checks a URL for specific text.
Current Version
Last Release Date
June 22, 2009
Owner
Nagios Exchange
Website
http://www.capside.com/
Compatible With
It retrieves an URL through http or https and looks in its output for a given text. If the text is found returns OK, if not found returns CRITICAL plus the last line of text received (and the full text as additional output data), and UNKNOWN otherwise (connection error,...) plus a brief error description. It has no other dependencies than PERL itself and some libraries (Getopt::Std and LWP::UserAgent, latter with optional SSL support).
I changed the as well. Works! Thumbs up!
I added stripping the HTML: in the use section: use HTML::FormatText; my @output_lines = split(/ /, $content); # print "CONTENT ERROR: EXPR NOT FOUND (last: $output_lines[$#output_lines]) full output was: $content"; my $text = HTML::FormatText->format_from_string($content); print "CONTENT ERROR: EXPR NOT FOUND: "; print "$text "; $status = EXIT_CRITICAL; With this change I found it more useful output for my client.
@Cloudmaster, You missed the quotes. Your check_command supposed to be check_command check_http_content -U http://64.20.36.132:82/xml -m "25388C85-A193-47DC-A7-1C-95-EB-92-EC-E9-28" -t 5 Thanks, Addy
@Cloudmaster you probably already figured it out but just in case, in service definition it should be as following: check_command check_http_content!http://64.20.36.132:82/xml!25388C85-A193-47DC-A7-1C-95-EB-92-EC-E9-28!5
Has anyone any suggestions on making this a case-insensitive check?
Need a bit of handholding - This is what I have in my commands.cfg - define command{ command_name check_http_content command_line $USER1$/check_http_content -U $ARG1$ -m $ARG2$ -t $ARG3$ } This is what's in my host.cfg - define service{ use generic-service host_name Air SeaTac service_description FSHost 2002 servicegroups front_end_services check_command check_http_content -U http://64.20.36.132:82/xml -m 25388C85-A193-47DC-A7-1C-95-EB-92-EC-E9-28 -t 5 notifications_enabled 1 } This is what happens when I run check_http_content manually - [root@prometheus libexec]# ./check_http_content -U http://64.20.36.132:82/xml -m 25388C85-A193-47DC-A7-1C-95-EB-92-EC-E9-28 -t 5 CONTENT OK: EXPR FOUND[root@prometheus libexec]# Trying to restart Nagios after config changes results in error
Hi, This script works fine ;) I've just modified a little on line 67 and add "n" The original line : print "CONTENT OK: EXPR FOUND"; The modified libne : print "CONTENT OK: EXPR FOUNDn"; With that, when I'm testing in bash it's better display. Thanks a lot bye
You must be logged in to submit a review.
To:
From: