Page 1 of 1

URL monitoring

Posted: Thu Feb 04, 2021 6:08 am
by kalyanpabolu
Hi Team,

We want to monitor a URL is opening/accessible from a remote machine. In other words, I will open URL from a remote machine and if it is not accessible from that machine, Nagios should send alert.

Is this possible in Nagios?

Re: URL monitoring

Posted: Thu Feb 04, 2021 2:44 pm
by dchurch
Yes, if you use the Website configuration wizard, it should allow you to check a URL returns a valid response.

Re: URL monitoring

Posted: Mon Feb 08, 2021 8:51 am
by kalyanpabolu
Hello,

I checked that Wizard, I do not see any field where it will ask to provide source IP.
How we will come to know that its monitoring the accessibility from a remote server?

Re: URL monitoring

Posted: Mon Feb 08, 2021 6:00 pm
by ssax
This is possible to do but would need to be done with an agent.

XI > Agent on Remote Host (where the URL check should occur from) > check URL

Is that remote machine a linux/unix or windows system?

Do you currently have an agent installed on that system? If so, which?

Re: URL monitoring

Posted: Tue Feb 09, 2021 5:35 am
by kalyanpabolu
Hello,

It is a Windows machine. We do not have any agent installed currently.
We can proceed and install ncpa agent. Could you please guide us on further steps to monitor the URL?

Re: URL monitoring

Posted: Tue Feb 09, 2021 4:01 pm
by dchurch
You can run this HTTP check remotely using the Windows machine to complete the request.

1. Download this file to C:\Program Files (x86)\Nagios\NCPA\plugins\check_http.py.
2. Run Command Prompt as administrator. Type this:

Code: Select all

pip3 install requests
3. Enter this into the Nagios XI service:
- Plugin: check_xi_ncpa
- Arg1: -t '<your NCPA community string>' -M 'plugins/check_http.py' -a '<your URL>'

Re: URL monitoring

Posted: Wed Feb 10, 2021 8:37 am
by kalyanpabolu
Hello,

Thanks for the reply!!

We will work on it and get back to you with the updates. Please keep the ticket open.

Re: URL monitoring

Posted: Wed Feb 10, 2021 1:50 pm
by dchurch
Let us know how that goes.

One final note: The script I linked is specially modified to allow a quoting workaround for NCPA, so you'll want to put quotes around the '<your URL>' string in your arg1. E.g. -a '"https://example.com"' - that's a single quote ('), then a double quote ("), then the URL, then a double quote ("), then a single quote (').

Re: URL monitoring

Posted: Thu Feb 11, 2021 11:05 am
by kalyanpabolu
Hello,

Thank you so much for your support!!
We already started working on the same and we will keep you posted with the updates.

One more thing to add here, if we are checking the URL not from Windows machine but from a router, then how that can be achieved?

Re: URL monitoring

Posted: Thu Feb 11, 2021 1:28 pm
by dchurch
kalyanpabolu wrote:if we are checking the URL not from Windows machine but from a router, then how that can be achieved?
You mean Nagios contacts the router and asks it to check the router to make an HTTP request? That's not currently possible unless the router supports an API to do that. What model router is it?