Page 1 of 2
URL Monitoring.
Posted: Mon Dec 18, 2017 9:21 am
by lpereira
Hello All:
i'm facing a few issues trying to configure a website monitoring
attached is a screenshot.
I was able to get PING and SSL certificate working, but DNS IP Match, DNS resolution and the webcontent is not working.
Can someone please assist in how to configure it?
Re: URL Monitoring.
Posted: Mon Dec 18, 2017 11:22 am
by npolovenko
Hello,
@lpereira. I would like to see your host and service definitions for this plugin. You can find them in CCM or in:
Code: Select all
cd /usr/local/nagios/etc/services/
and look for the file that says: AGENDA***.cfg
and also i'd need:
and look for the file that says: AGENDA***.cfg
Please upload the contents of these files. You may remove all the sensitive information. Or you may send the files to me in a PM, that way i'll be able to actually test the config on my XI as well.
Re: URL Monitoring.
Posted: Mon Dec 18, 2017 1:28 pm
by lpereira
npolovenko wrote:Hello,
@lpereira. I would like to see your host and service definitions for this plugin. You can find them in CCM or in:
Code: Select all
cd /usr/local/nagios/etc/services/
and look for the file that says: AGENDA***.cfg
and also i'd need:
and look for the file that says: AGENDA***.cfg
Please upload the contents of these files. You may remove all the sensitive information. Or you may send the files to me in a PM, that way i'll be able to actually test the config on my XI as well.
i have send you the PM with the info requested.
regards
Re: URL Monitoring.
Posted: Mon Dec 18, 2017 3:43 pm
by lpereira
npolovenko wrote:Hello,
@lpereira. I would like to see your host and service definitions for this plugin. You can find them in CCM or in:
Code: Select all
cd /usr/local/nagios/etc/services/
and look for the file that says: AGENDA***.cfg
and also i'd need:
and look for the file that says: AGENDA***.cfg
Please upload the contents of these files. You may remove all the sensitive information. Or you may send the files to me in a PM, that way i'll be able to actually test the config on my XI as well.
I have sent you the file and the file content via PM. have you received it?
Re: URL Monitoring.
Posted: Mon Dec 18, 2017 3:44 pm
by npolovenko
@lpereira, I received your config files. Looks like you're using an internal IP address for your checks, and it also appears that ICMP is turned off on the web server.
DNS checks will not work when you supply a local IP address in the arguments.
Now as far as the failing web page content check, try to get rid of -u "/ag****/" part. And rerun the command. You may copy the arguments from the XI and just run them from the command line, for now:
Code: Select all
cd /usr/local/nagios/libexec/
./check_http -H local_ip -s "string"
I'm not able to test the string match part by myself because the ICMP is unavailable for the web address that you provided.
Re: URL Monitoring.
Posted: Mon Dec 18, 2017 4:11 pm
by lpereira
npolovenko wrote:@lpereira, I received your config files. Looks like you're using an internal IP address for your checks, and it also appears that ICMP is turned off on the web server.
DNS checks will not work when you supply a local IP address in the arguments.
Now as far as the failing web page content check, try to get rid of -u "/ag****/" part. And rerun the command. You may copy the arguments from the XI and just run them from the command line, for now:
Code: Select all
cd /usr/local/nagios/libexec/
./check_http -H local_ip -s "string"
I'm not able to test the string match part by myself because the ICMP is unavailable for the web address that you provided.
Ok so should i use the public IP instead the private one?. If ICMP is blocked should i enable it?.
also check http still failing
Code: Select all
[root@nagios libexec]# ./check_http -H 17X.XXX.XXX -s "APLICACIÓN" -S -p 443
HTTP CRITICAL: HTTP/1.1 302 Object moved - string 'APLICACIÓN' not found on 'https://17X.XXX.XXX/' - 479 bytes in 0.011 second response time |time=0.010790s;;;0.000000 size=479B;;;0
Re: URL Monitoring.
Posted: Mon Dec 18, 2017 5:09 pm
by npolovenko
@lpereira, You can enable ICMP and you'll be able to run a ping check against the website URL or external IP, as well as run DNS lookup services. Or you could just delete these services in the CCM for now...Depends on how important are the DNS service checks for you.
Now as far as your failing "string search" check. If you take a look at the source code for that login page you provided all the content is hidden behind the javascript. So your only option would be to chnage the command to run the check against some HTML tag value.
Code: Select all
./check_http -H internal_ip -f follow -s "theme" -S -u "/agd..../login?returnUrl=%2F"
Code: Select all
./check_http -H internal_ip -f follow -s "vendor.bundle" -S -u "/agd..../login?returnUrl=%2F"
PS: replace agd... with the correct word.
Re: URL Monitoring.
Posted: Tue Dec 19, 2017 6:10 am
by lpereira
I think that is working but i'm not completely sure
if i Add the String "agenda", i have no "string not found message", also i have the same output if i leave the string option in blank
Code: Select all
[root@nagios libexec]# ./check_http -H 1XX.XXX.XXX -f follow -s "Agenda" -S -u "/XXX/login?returnUrl=%2F" -p 443
HTTP OK: HTTP/1.1 200 OK - 1207 bytes in 0.011 second response time |time=0.010741s;;;0.000000 size=1207B;;;0
[root@nagios libexec]# ./check_http -H 1XX.XXX.XXX -f follow -s " " -S -u "/XXX/login?returnUrl=%2F" -p 443
HTTP OK: HTTP/1.1 200 OK - 1207 bytes in 0.010 second response time |time=0.010274s;;;0.000000 size=1207B;;;0
But if i introduce an invalid String, it does say "string not found"
Code: Select all
[root@nagios libexec]# ./check_http -H 11XX.XXX.XXX -f follow -s "AgendaS" -S -u "/XXX/login?returnUrl=%2F" -p 443
HTTP CRITICAL: HTTP/1.1 200 OK - string 'Agendas' not found on 'https://1XX.XXX.XXX:443/XXX/login?returnUrl=%2F' - 1207 bytes in 0.010 second response time |time=0.010416s;;;0.000000 size=1207B;;;0
is does indicate that everything is ok with the "agenda" word??
Re: URL Monitoring.
Posted: Tue Dec 19, 2017 9:55 am
by npolovenko
@lpereira, Exactly, it means everything is "ok".
**I will explain in more detail to avoid confusion.
Code: Select all
[root@nagios libexec]# ./check_http -H 1XX.XXX.XXX -f follow -s "Agenda" -S -u "/XXX/login?returnUrl=%2F" -p 443
The word "Agenda" is in the title so the check returns HTTP OK: HTTP/1.1 200 OK
Code: Select all
[root@nagios libexec]# ./check_http -H 1XX.XXX.XXX -f follow -s " " -S -u "/XXX/login?returnUrl=%2F" -p 443
You're searching for an empty string and it finds it, of course, the result is HTTP OK: HTTP/1.1 200 OK
Code: Select all
[root@nagios libexec]# ./check_http -H 11XX.XXX.XXX -f follow -s "AgendaS" -S -u "/XXX/login?returnUrl=%2F" -p 443
You're searching for non existing string, so the check returns HTTP CRITICAL: HTTP/1.1 200 OK. Critical because the string was not found and HTTP 200 OK because the webpage exists.
Re: URL Monitoring.
Posted: Tue Dec 19, 2017 10:42 am
by mcapra
lpereira wrote:
is does indicate that everything is ok with the "agenda" word??
The
200 OK is just the HTTP response code. The actual plugin's status is
HTTP CRITICAL.