HTTP

check_http_xpath.pl

Description:

Check an XML web page for specific content using the XML XPATH syntax.

Current Version

1.1

Last Release Date

2011-04-19

Compatible With

License

GPL


Project Files
Project Notes
The check_http_xpath.pl plugin can be used to check for the presence or absence of specific information in an XML document which is fetched via http. For example, such an XML document may be an RSS feed or the Tomcat XML status page. The text to be searched for is specified in the XML XPATH format on the command-line. Multiple XPATH checks can be done in one operation. Checks can be any of == != > < <= >= =~ !~ If no operator is specified, the XPATH must simply exist. Example: check_http_xpath.pl -H www.us-cert.gov -u /channels/techalerts.rdf -w '/rdf:RDF/item/title!~linux' -s -i
Reviews (4) Add a Review
Can use
by dnmvisser, November 30, 2018

If the webserver that hosts your XML file supports ETag, then you can speed up things by using that caching mechanism. This is most noticeable with large XML files (such as eduGAIN metadata). I was a fairly trivial patch: --- check_http_xpath.pl 2018-11-23 16:07:33.521799526 +0100 +++ test.pl 2018-11-24 00:27:34.848817509 +0100 @@ -27,6 +27,7 @@ use Getopt::Std; use XML::XPath; use Data::Dumper; +use HTTP::Cache::Transparent; my %optarg; my $getopt_result; @@ -294,6 +295,10 @@ $lwp_user_agent->default_header('Host' => "$host:$port"); } +HTTP::Cache::Transparent::init( { + BasePath => '/tmp/cache', + } ); + $url = "$http://${host_ip}:${port}$uri"; $http_request = HTTP::Request->new(GET => $url);



Very useful
by svenw, October 31, 2015

It was trivial to add a couple of lines to be able to POST requests.



Saved us costly Dev projects!
by tippy24, April 30, 2014

Thanks, George! We have a number of AcquiSuite DAS units collecting info via internal I/O (discrete inputs) which has proven difficult to get in to nagios to monitor. This plugin has saved our organization from costly Dev projects! If you have an odd-ball device that does crucial monitoring, and server up status metrics via XML, this plugin can save you much heartache! M. Tipsword, CITES DCG, Univ. of Illinois



Amazing
by achoo, October 31, 2013

Absoluting amazing! You just need to understand XPath syntax. Thanks



Add a Review

You must be logged in to submit a review.

Thank you for your review!

Your review has been submitted and is pending approval.

Recommend

To:


From:


Thank you for your recommendation!

Your recommendation has been sent.

Project Stats
Rating
4.8 (6)
Favorites
2
Views
100,632