Page 1 of 1

Basic HTTPS setup to monitor public web site

Posted: Wed Aug 10, 2016 6:20 pm
by sysadmin2525
Hello all and thanks for taking the time to post regarding this.

I am running Nagios Core 4 on Ubuntu 14. I am trying to monitor our company website at https://blahblah.com
So far I have not found/missed any examples on how to do this. I know the built in http command SHOULD be able to do this. Or maybe I need to create an https one?

If this looks terrible its because I've been trying so many variations... dont laugh... :D

My define service is
use generic-service
host_name website
service_description HTTP
check_command check_http!-H https://www.blah.com -S

command_name check_http
command_line $USER1$/check_https -H $HOSTADDRESS$ -u $ARG1$

Please help! I just want to make sure the website is up and thats all. Thank you!!

-Adrian

Re: Basic HTTPS setup to monitor public web site

Posted: Wed Aug 10, 2016 6:27 pm
by Box293
sysadmin2525 wrote:If this looks terrible its because I've been trying so many variations... dont laugh... :D
We've all been in your situation :D

Here's the command at the command line:

Code: Select all

check_http -H www.blah.com -S

HTTP OK: HTTP/1.1 200 OK - 376 bytes in 1.561 second response time |time=1.560899s;;;0.000000 size=376B;;;0
sysadmin2525 wrote:command_name check_http
command_line $USER1$/check_https -H $HOSTADDRESS$ -u $ARG1$
Change this to:

Code: Select all

command_line $USER1$/check_http -H $ARG1$ $ARG2$
sysadmin2525 wrote:My define service is
use generic-service
host_name website
service_description HTTP
check_command check_http!-H https://www.blah.com -S
Change this to:

Code: Select all

check_command check_http!www.blah.com!-S
Let us know how this goes.

Re: Basic HTTPS setup to monitor public web site

Posted: Wed Aug 10, 2016 6:39 pm
by sysadmin2525
Awesome trying it now

Re: Basic HTTPS setup to monitor public web site

Posted: Wed Aug 10, 2016 6:42 pm
by sysadmin2525
ok it's saying (Host check timed out after 30.01 seconds) Which is what it was saying previously.

Re: Basic HTTPS setup to monitor public web site

Posted: Wed Aug 10, 2016 6:50 pm
by sysadmin2525
ok Settings are


define host{
use windows-server
host_name Website
alias Web
address www.blah.com


define service{

use generic-service
host_name Website
service_description HTTP
check_command check_http!www.blah.com!-S
contact_groups admins

# 'check_http' command definition
define command{
command_name check_http
command_line $USER1$/check_http -H $ARG1$ $ARG2$
}



Whats wrong here? Im thinking the host-use? Would that affect this? thanks so much!



}

Re: Basic HTTPS setup to monitor public web site

Posted: Wed Aug 10, 2016 7:01 pm
by sysadmin2525
Alright so after some time it now shows that HTTP is OK but still shows up red due to failed pings to the web site. So we are half way there at least...

Re: Basic HTTPS setup to monitor public web site

Posted: Wed Aug 10, 2016 9:57 pm
by Box293
You can make the host object use the same check command instead of a ping check. This is common where the host object cannot be pinged.

Re: Basic HTTPS setup to monitor public web site

Posted: Thu Aug 11, 2016 12:11 pm
by sysadmin2525
I'm sorry but I don't quite follow.

Re: Basic HTTPS setup to monitor public web site

Posted: Thu Aug 11, 2016 1:18 pm
by sysadmin2525
Got it. You guys rock thank you SO much. :D :D :D Problem Solved

Re: Basic HTTPS setup to monitor public web site

Posted: Thu Aug 11, 2016 4:17 pm
by mcapra
Awesome! Is it alright if we lock this thread and mark the issue as resolved?