Website monitoring through nagios with specific requirement

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
naranant
Posts: 90
Joined: Tue Oct 24, 2017 10:50 am

Website monitoring through nagios with specific requirement

Post 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.
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

Post 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
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
naranant
Posts: 90
Joined: Tue Oct 24, 2017 10:50 am

Re: Website monitoring through nagios with specific requirem

Post 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
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

Post by scottwilkerson »

you are getting a HTTP/1.1 400 error

does this require authentication?
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
naranant
Posts: 90
Joined: Tue Oct 24, 2017 10:50 am

Re: Website monitoring through nagios with specific requirem

Post by naranant »

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

Post 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

Code: Select all

 -a 'username:password'
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
naranant
Posts: 90
Joined: Tue Oct 24, 2017 10:50 am

Re: Website monitoring through nagios with specific requirem

Post 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
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

Post 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
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
naranant
Posts: 90
Joined: Tue Oct 24, 2017 10:50 am

Re: Website monitoring through nagios with specific requirem

Post 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
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

Post by scottwilkerson »

naranant wrote:Also tried curl on loging to the nagios XI there also getting erros.
can you post these errors?
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
Locked