Page 1 of 2
Website monitoring through nagios with specific requirement
Posted: Tue Jan 15, 2019 1:09 pm
by naranant
Team,
Need to monitor a website with the response to look for specific keywords in the webpage. Below is the requirement.
The response need to be parsed and look for "firstName" and "lastName". If these entries are not found then it should fail.
I tried to use the default URL monitoring and try to use the webpage content matching using the but its not working.
I am attaching both the screenshot of the command check as well as the webpage contect where we are looks for these strings.
Please guide on how we can use the existing plugin to monitor this.
Re: Website monitoring through nagios with specific requirem
Posted: Tue Jan 15, 2019 2:09 pm
by scottwilkerson
You would likely want to use the regex filter which would make your $ARG1$ look something like
Code: Select all
-r "(firstName).*(lastName)" -f ok -I xxx.xxx.xxx.x-u
Re: Website monitoring through nagios with specific requirem
Posted: Tue Jan 15, 2019 2:29 pm
by naranant
I tried with that but still getting the error.
[nagios@lx##.**.com ~]$ /usr/local/nagios/libexec/check_http -H lx*** -r "(firstName).*(lastName)" -f ok -I xx.x.x00.xx -u "/api/v1/user" -S -p 8085
HTTP CRITICAL: HTTP/1.1 400 - pattern not found - 138 bytes in 0.277 second response time |time=0.277116s;;;0.000000 size=138B;;;0
Re: Website monitoring through nagios with specific requirem
Posted: Tue Jan 15, 2019 2:31 pm
by scottwilkerson
you are getting a HTTP/1.1 400 error
does this require authentication?
Re: Website monitoring through nagios with specific requirem
Posted: Tue Jan 15, 2019 2:59 pm
by naranant
The authentication is not required it is using basic authentication.
Re: Website monitoring through nagios with specific requirem
Posted: Tue Jan 15, 2019 3:36 pm
by scottwilkerson
naranant wrote:The authentication is not required it is using basic authentication.
If it uses basic authentication you would need to add the credentials to the command
Re: Website monitoring through nagios with specific requirem
Posted: Tue Jan 15, 2019 4:31 pm
by naranant
Sorry for the miscommunication. The URL doesnt used any authentication.
As you could see from my second attachment. The URL loads up with text in the body and we have a requirement to verify if the text contains first name and last name.
Regards,
naranant
Re: Website monitoring through nagios with specific requirem
Posted: Tue Jan 15, 2019 4:42 pm
by scottwilkerson
This is a bit difficult with the obfuscation, but can you run the following from the XI server
Code: Select all
curl -vvv https://lx***:8085/api/v1/user
and get the desired results?
You may also have to add the --sni directive to your command
Code: Select all
/usr/local/nagios/libexec/check_http -H lx*** -r "(firstName).*(lastName)" -f ok -I xx.x.x00.xx -u "/api/v1/user" -S -p 8085 --sni
Re: Website monitoring through nagios with specific requirem
Posted: Wed Jan 16, 2019 11:32 am
by naranant
Hello Scott,
Tried with adding --sni on the command getting the same error of patten not found.
Also tried curl on loging to the nagios XI there also getting erros.
Regards,
naranant
Re: Website monitoring through nagios with specific requirem
Posted: Wed Jan 16, 2019 11:41 am
by scottwilkerson
naranant wrote:Also tried curl on loging to the nagios XI there also getting erros.
can you post these errors?