DevOps Monkey Goodness

How to Parse XML in Nagios:

On my OpsView/Nagios journey my next task is to grab some XML from a URL and return critical if a certain node is found.

  1. Run the following as root to install the xpath module:
    cpan XML::XPath
     
  2. Run the following:
    sudo su nagios
    cd /usr/local/nagios/libexec
    wget https://raw.github.com/ifunky/Nagios/master/check_http_xpath.pl
    chmod +x check_http_xpath.pl
     
  3. To test the plugin you can run something like:
    ./check_http_xpath.pl -H server.name -u /healthcheck -c ‘/HealthCheck/Summary==Passed’

No Comments Yet

Leave a Reply