I am trying to make sure that when I use either the -s or -R option with check_http I don't get a false positive return. My main concern is where I am looking for "0 CDM errors" on a page but there is the possibility that there might be "10 CDM errors", in which case it will still find the "0 CDM errors" string and return a false OK.
Can anyone tell me of a way to mitigate this situation?
Thanks
check_http string search problem
Re: check_http string search problem
Is there a space before the 0 CDM errors message? If so, try adding a space before the 0 in the testing string. See below
Code: Select all
" 0 CDM errors"
Be sure to check out our Knowledgebase for helpful articles and solutions!
-
- Posts: 125
- Joined: Tue Mar 18, 2014 3:20 pm
Re: check_http string search problem
Unfortunately I don't think that will work. This is what the page looks like:
0 CDM errors detected
Cloud Data Management Publishing Service
Cloud Data Publishing Service version: 2.1.0.176
Cloud Data Publishing Service build date: 2015-01-20 10:57:22 -0700
Cloud Data Publishing Service built by: cdmbuild
Current Time: 2015-02-06T19:03:46Z
Bamboo Status: Passed
Bamboo Timing: 0.0817s
Perforce Status: Passed
Perforce Timing: 0.0076s
Publishing Progress Check: Passed
Publishing Progress Timing: 3.6559s
0 CDM errors detected
Cloud Data Management Publishing Service
Cloud Data Publishing Service version: 2.1.0.176
Cloud Data Publishing Service build date: 2015-01-20 10:57:22 -0700
Cloud Data Publishing Service built by: cdmbuild
Current Time: 2015-02-06T19:03:46Z
Bamboo Status: Passed
Bamboo Timing: 0.0817s
Perforce Status: Passed
Perforce Timing: 0.0076s
Publishing Progress Check: Passed
Publishing Progress Timing: 3.6559s
Re: check_http string search problem
Well, is there any markup? check_http checks the entire returned html, so if there is markup, it would act like a "beginning of line" for that html element. You can see what check_http is applying the regex to with "-vvv":
In my example below, "Nagios XI" is actually wrapped in a <title> tag, so the command looks like:
Edit:
Also, can you try using the following expression in your command?
lmiltchev
Code: Select all
./check_http -H <hostname> -vvv
Code: Select all
./check_http -H localhost -r '<title>Nagios XI'
Also, can you try using the following expression in your command?
Code: Select all
-r "[^1-9]0 CDM errors"
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
-
- Posts: 125
- Joined: Tue Mar 18, 2014 3:20 pm
Re: check_http string search problem
-R "[^1-9]0 CDM errors"
looks like it will work.
Thanks a lot.
looks like it will work.
Thanks a lot.