Basic HTTPS setup to monitor public web site

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
sysadmin2525
Posts: 10
Joined: Wed Dec 30, 2015 2:05 pm

Basic HTTPS setup to monitor public web site

Post 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
User avatar
Box293
Too Basu
Posts: 5126
Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia
Contact:

Re: Basic HTTPS setup to monitor public web site

Post 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.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
sysadmin2525
Posts: 10
Joined: Wed Dec 30, 2015 2:05 pm

Re: Basic HTTPS setup to monitor public web site

Post by sysadmin2525 »

Awesome trying it now
sysadmin2525
Posts: 10
Joined: Wed Dec 30, 2015 2:05 pm

Re: Basic HTTPS setup to monitor public web site

Post by sysadmin2525 »

ok it's saying (Host check timed out after 30.01 seconds) Which is what it was saying previously.
sysadmin2525
Posts: 10
Joined: Wed Dec 30, 2015 2:05 pm

Re: Basic HTTPS setup to monitor public web site

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



}
sysadmin2525
Posts: 10
Joined: Wed Dec 30, 2015 2:05 pm

Re: Basic HTTPS setup to monitor public web site

Post 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...
User avatar
Box293
Too Basu
Posts: 5126
Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia
Contact:

Re: Basic HTTPS setup to monitor public web site

Post 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.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
sysadmin2525
Posts: 10
Joined: Wed Dec 30, 2015 2:05 pm

Re: Basic HTTPS setup to monitor public web site

Post by sysadmin2525 »

I'm sorry but I don't quite follow.
sysadmin2525
Posts: 10
Joined: Wed Dec 30, 2015 2:05 pm

Re: Basic HTTPS setup to monitor public web site

Post by sysadmin2525 »

Got it. You guys rock thank you SO much. :D :D :D Problem Solved
User avatar
mcapra
Posts: 3739
Joined: Thu May 05, 2016 3:54 pm

Re: Basic HTTPS setup to monitor public web site

Post by mcapra »

Awesome! Is it alright if we lock this thread and mark the issue as resolved?
Former Nagios employee
https://www.mcapra.com/
Locked