check_http regex question
Posted: Fri Jul 15, 2016 7:45 am
I'm looking for a method to return a value with check_http from a unique tag that is found on a short XML page. An added bonus would be if the returned value is greater than 4000000 to have NAGIOS treat it as a critical, however just getting the value returned and displayed on the NAGIOS console would be fine.
Scenario : An application (I have hundreds of these) accepts a URL and returns a short XML page with about 20-25 lines of unique XML tags with dynamic values that are always growing. I'm looking for the number between the documents tags. The number grows over time and I would like to know when it exceeds 4,000,000 so that I can perform some maintenance.
I've tried check_http -H serverIP -p port# -u URLtoXML -r <documents>[\s\S]*?<\/documents> but I get a critical pattern not found response. I must admit I am terribly new to regular expressions. I am also aware that NAGIOS can be a headache with escape characters too and not sure if this might be part of my problem.
Scenario : An application (I have hundreds of these) accepts a URL and returns a short XML page with about 20-25 lines of unique XML tags with dynamic values that are always growing. I'm looking for the number between the documents tags. The number grows over time and I would like to know when it exceeds 4,000,000 so that I can perform some maintenance.
Code: Select all
<documents>4765129</documents>