Website monitoring through nagios with specific requirement
Website monitoring through nagios with specific requirement
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.
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.
You do not have the required permissions to view the files attached to this post.
-
scottwilkerson
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: Website monitoring through nagios with specific requirem
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-uRe: Website monitoring through nagios with specific requirem
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
[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
-
scottwilkerson
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: Website monitoring through nagios with specific requirem
you are getting a HTTP/1.1 400 error
does this require authentication?
does this require authentication?
Re: Website monitoring through nagios with specific requirem
The authentication is not required it is using basic authentication.
-
scottwilkerson
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: Website monitoring through nagios with specific requirem
If it uses basic authentication you would need to add the credentials to the commandnaranant wrote:The authentication is not required it is using basic authentication.
Code: Select all
-a 'username:password'Re: Website monitoring through nagios with specific requirem
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
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
-
scottwilkerson
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: Website monitoring through nagios with specific requirem
This is a bit difficult with the obfuscation, but can you run the following from the XI server
and get the desired results?
You may also have to add the --sni directive to your command
Code: Select all
curl -vvv https://lx***:8085/api/v1/userYou 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 --sniRe: Website monitoring through nagios with specific requirem
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
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
-
scottwilkerson
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: Website monitoring through nagios with specific requirem
can you post these errors?naranant wrote:Also tried curl on loging to the nagios XI there also getting erros.