check_Http:Multiple Regex Patterns

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
apteancloud
Posts: 47
Joined: Wed Sep 09, 2020 4:05 am

check_Http:Multiple Regex Patterns

Post by apteancloud »

Hi,

We currently use check_http to do a invert regex pattern:
Current check is:

Code: Select all

-u "/mypath/serverstatus" -S --sni -w 30 -c 60 -r Cannot --invert-regex
However, recently I have been informed by our dev team that sometimes, when the connection drops, the page gets redirected and there is a different message that pops up with information as 'Configuration Error'.

Is it possible to add an OR field in the regex search, where it searches for 'Cannot' OR 'Configuration Error' and if it finds either record, raises a CRITICAL alarm (considering it is a invert regex search)?
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: check_Http:Multiple Regex Patterns

Post by ssax »

You can do this:

Code: Select all

-f follow -u "/mypath/serverstatus" -S --sni -w 30 -c 60 -r "(Cannot|Configuration Error)" --invert-regex
apteancloud
Posts: 47
Joined: Wed Sep 09, 2020 4:05 am

Re: check_Http:Multiple Regex Patterns

Post by apteancloud »

That worked.. Thank you!
Please archive the thread.
benjaminsmith
Posts: 5324
Joined: Wed Aug 22, 2018 4:39 pm
Location: saint paul

Re: check_Http:Multiple Regex Patterns

Post by benjaminsmith »

That worked.. Thank you!
Excellent. We'll close this one out.

Thank you for using Nagios.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked