Page 2 of 2
Re: check_http
Posted: Fri Sep 13, 2019 1:36 am
by afigles
Hello,
Yes, I installed all the prerequisites from the web
https://support.nagios.com/kb/article.php?id=569.
I have runned your last commands but I get the same error from Nagios console with -S option -> check_http: Invalid option - SSL is not available
Parameter -S is not exist in the command but --sni is valid.
root@rdxnagios:/usr/local/nagios/etc/objects# /root/nagios-plugins-release-2.2.1/plugins/check_http -H 172.22.93.35 -P 443 --sni -u /sctd/loginPage.do
HTTP OK: HTTP/1.1 200 OK - 63458 bytes in 0.060 second response time |time=0.060028s;;;0.000000 size=63458B;;;0
Change commands.cfg with --sni but the error in nagios web is CRITICAL - Socket timeout
other ideas??
Re: check_http
Posted: Fri Sep 13, 2019 6:38 am
by scottwilkerson
When you are testing these, you are using the path
Code: Select all
/root/nagios-plugins-release-2.2.1/plugins/check_http
What is the path of $USER1$ that nagios is using?
Code: Select all
grep USER1 /usr/local/nagios/etc/cgi.cfg
Re: check_http
Posted: Fri Sep 13, 2019 7:31 am
by afigles
grep command does not return anything.
root@rdxnagios:/usr/local/nagios/etc# grep USER1 /usr/local/nagios/etc/cgi.cfg
root@rdxnagios:/usr/local/nagios/etc#
I change the command in command.cfg but same result.
# 'check_http_url' command definition
define command{
command_name check_http_url
command_line /root/nagios-plugins-release-2.2.1/plugins/check_http -H $HOSTADDRESS$ -p $ARG1$ -u $ARG2$
}
Re: check_http
Posted: Fri Sep 13, 2019 8:22 am
by scottwilkerson
Sorry, I had the file wrong
Code: Select all
grep USER1 /usr/local/nagios/etc/resources.cfg
My guess is they are in /usr/local/nagios/libexec
Can you run this and show the output
Code: Select all
/usr/local/nagios/libexec/check_http -h
Re: check_http
Posted: Mon Sep 16, 2019 3:32 am
by afigles
Code: Select all
root@rdxnagios://usr/local/nagios/etc# /usr/local/nagios/libexec/check_http -h
check_http v2.2.1.git (nagios-plugins 2.2.1)
Copyright (c) 1999 Ethan Galstad <nagios@nagios.org>
Copyright (c) 1999-2014 Nagios Plugin Development Team
<devel@nagios-plugins.org>
This plugin tests the HTTP service on the specified host. It can test
normal (http) and secure (https) servers, follow redirects, search for
strings and regular expressions, check connection times, and report on
certificate expiration times.
Usage:
check_http -H <vhost> | -I <IP-address> [-u <uri>] [-p <port>]
[-J <client certificate file>] [-K <private key>]
[-w <warn time>] [-c <critical time>] [-t <timeout>] [-L] [-E] [-a auth]
[-b proxy_auth] [-f <ok|warning|critcal|follow|sticky|stickyport>]
[-e <expect>] [-d string] [-s string] [-l] [-r <regex> | -R <case-insensitive regex>]
[-P string] [-m <min_pg_size>:<max_pg_size>] [-4|-6] [-N] [-M <age>]
[-A string] [-k string] [-S <version>] [--sni] [-C <warn_age>[,<crit_age>]]
[-T <content-type>] [-j method]
NOTE: One or both of -H and -I must be specified
Code: Select all
root@rdxnagios://usr/local/nagios/etc# grep USER1 resource.cfg
# Nagios supports up to 32 $USERx$ macros ($USER1$ through $USER32$)
# Sets $USER1$ to be the path to the plugins
$USER1$=/usr/local/nagios/libexec
Re: check_http
Posted: Mon Sep 16, 2019 6:53 am
by scottwilkerson
So when nagios executes the checks it is using /usr/local/nagios/libexec/check_http but you have been testing from /usr/local/nagios/libexec/check_http
Re: check_http
Posted: Tue Sep 24, 2019 1:46 am
by afigles
I compiled wirh ssl and check_http -S works now.
Re: check_http
Posted: Tue Sep 24, 2019 9:39 am
by scottwilkerson
afigles wrote:I compiled wirh ssl and check_http -S works now.
Great!
Locking