Hey Everyone,
I am trying to monitor the HTTPS site on my Barracuda spam/virus firewall. I am getting this error:
(Return code of 127 is out of bounds - plugin may be missing)
The device is on the internal network same as the Nagios server. My ping check for this hosts has no problems working. Once I created the check_https plugin in /usr/local/nagios/libexec/ I then recompiled the plugins. I have verified permissions and ownership of the check_https plugin I installed. It is the same as the check_http plugin.
-rwxr-xr-x 1 nagios nagios 417 Jun 14 10:59 check_https
The check_https file looks like:
#!/bin/bash
wget='/usr/bin/wget --no-check-certificate --output-document=/tmp/tmp_html -S'
add_uri='https://'
end_uri='/'
PORT=''
if [ $# -gt 1 ]
then
PORT=:$2
fi
if ($wget $add_uri$1$PORT$end_uri$3 2> /tmp/tmp_rep) then
cat /tmp/tmp_rep | grep "HTTP/1"
rm /tmp/tmp_rep
rm /tmp/tmp_html
exit 0
else
cat /tmp/tmp_rep | grep "HTTP/1" || echo 'Connection refused by host'
rm /tmp/tmp_rep
rm /tmp/tmp_html
exit 2
fi;
The commands.cfg file looks like this when referring to the plugin:
# 'check_https' command definition
define command{
command_name check_https
command_line $USER1$/check_https $ARG1$
}
The localhost.cfg file looks like this:
define host{
use linux-server ; Name of host template to use
; This host definition will inherit all variables that are defined
; in (or inherited by) the linux-server host template definition.
host_name Cuda2
alias Outbound Cuda
address 192.168.x.x (obviously the real file doesn't have 'X's in the IP address field.)
}
define service{
use local-service ; Name of service template to use
host_name Cuda2
service_description HTTPS
check_command check_https
notifications_enabled 1
}
Any clues out there what I am missing. I am fairly new to really getting to put forth the effort to use Nagios. So far everything I have done has worked no problem and I love it. Just have to figure this out.
Thanks in advance for any and all help!
check_https not working...
Re: check_https not working...
Return code 127 means one of two things:
1. You have specified the incorrect path to the check
2. Either Nagios doesn't have permisions to execute the check or something in the check
In my experience it has always been one of these two things.
I'm assuming you can run the check successfully as root, so su - nagios and run the check as the nagios user... you should get an error or it should at very least fail to return any output. I'm tipping the nagios user doesn't have permission to execute wget or to read that tmp file it's writing.
Alternatively the standard check_http plugin supports https if you use the -s switch. You can run ./check_http --help for full details on its functionality.
1. You have specified the incorrect path to the check
2. Either Nagios doesn't have permisions to execute the check or something in the check
In my experience it has always been one of these two things.
I'm assuming you can run the check successfully as root, so su - nagios and run the check as the nagios user... you should get an error or it should at very least fail to return any output. I'm tipping the nagios user doesn't have permission to execute wget or to read that tmp file it's writing.
Alternatively the standard check_http plugin supports https if you use the -s switch. You can run ./check_http --help for full details on its functionality.
Re: check_https not working...
Ahhh... if this check needs to connect to the box and write a file then I do not see this working out for me. This is a Barracuda Spam and Virus firewall. Unless there is something I am missing, I don't think I have the ability to write to the system.
This is aggravating... this unit keeps going offline and the only other service that goes offline with it is the web interface. The unit continues to be pingable. Only services that do not work are SMTP and HTTPS...
Thank you for the help and I will keep that info in mind in the future for other checks I setup on our web servers.
This is aggravating... this unit keeps going offline and the only other service that goes offline with it is the web interface. The unit continues to be pingable. Only services that do not work are SMTP and HTTPS...
Thank you for the help and I will keep that info in mind in the future for other checks I setup on our web servers.
-
Shivaramakrishnan
- Posts: 71
- Joined: Tue May 15, 2012 10:11 pm
Re: check_https not working...
You can simply check the https port by telnet and check if the port is working fine.
That would be an easy way out to check the port status.
And the check can be performed by something like:
check_nrpe_1arg!check_https
check_https would have a check that performs a telnet to local host at port 443
That would be an easy way out to check the port status.
And the check can be performed by something like:
check_nrpe_1arg!check_https
check_https would have a check that performs a telnet to local host at port 443
Re: check_https not working...
I honestly think the simplest solution to your problem is just to use the two standard check_http and check_smtp plugins... if you use check_http with the -S switch it will connect via HTTPS. The plugin you were trying to use seems unnecessarily over-complicated.sothardw wrote:Ahhh... if this check needs to connect to the box and write a file then I do not see this working out for me. This is a Barracuda Spam and Virus firewall. Unless there is something I am missing, I don't think I have the ability to write to the system.
This is aggravating... this unit keeps going offline and the only other service that goes offline with it is the web interface. The unit continues to be pingable. Only services that do not work are SMTP and HTTPS...
Thank you for the help and I will keep that info in mind in the future for other checks I setup on our web servers.
Man pages:
http://nagiosplugins.org/man/check_http
http://nagiosplugins.org/man/check_smtp
Re: check_https not working...
Alrighty, I have the check_smtp up and running and actually functioning as it should be.
However, when attempting to perform from root or as nagios:
/usr/local/nagios/libexec/check_http -S -I 192.168.#.#
I get the error below:
Connection refused
HTTP CRITICAL - Unable to open TCP socket
I have checked and openssl is installed and even went through the following steps and still get the same error:
(From the plugins untar'ed folder)
make distclean
./configure --with-openssl
make all
make install
Is there something I am missing?
However, when attempting to perform from root or as nagios:
/usr/local/nagios/libexec/check_http -S -I 192.168.#.#
I get the error below:
Connection refused
HTTP CRITICAL - Unable to open TCP socket
I have checked and openssl is installed and even went through the following steps and still get the same error:
(From the plugins untar'ed folder)
make distclean
./configure --with-openssl
make all
make install
Is there something I am missing?
Re: check_https not working...
Very interesting...
Though it doesn't work from the command line... it does seem to be working from the the config file...
I guess doing the '/.configure --with-openssl' worked after all.
Thanks for the help everyone!
Though it doesn't work from the command line... it does seem to be working from the the config file...
I guess doing the '/.configure --with-openssl' worked after all.
Thanks for the help everyone!
Re: check_https not working...
Glad you found a solution!