Page 1 of 1

check_Http:Multiple Regex Patterns

Posted: Thu Sep 23, 2021 11:43 am
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)?

Re: check_Http:Multiple Regex Patterns

Posted: Fri Sep 24, 2021 11:54 am
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

Re: check_Http:Multiple Regex Patterns

Posted: Wed Oct 06, 2021 10:15 am
by apteancloud
That worked.. Thank you!
Please archive the thread.

Re: check_Http:Multiple Regex Patterns

Posted: Wed Oct 06, 2021 4:40 pm
by benjaminsmith
That worked.. Thank you!
Excellent. We'll close this one out.

Thank you for using Nagios.