check_http

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.
afigles
Posts: 19
Joined: Wed Sep 11, 2019 12:15 pm

Re: check_http

Post 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?? :oops:
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: check_http

Post 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
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
afigles
Posts: 19
Joined: Wed Sep 11, 2019 12:15 pm

Re: check_http

Post 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$
}
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: check_http

Post 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
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
afigles
Posts: 19
Joined: Wed Sep 11, 2019 12:15 pm

Re: check_http

Post 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
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: check_http

Post 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
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
afigles
Posts: 19
Joined: Wed Sep 11, 2019 12:15 pm

Re: check_http

Post by afigles »

I compiled wirh ssl and check_http -S works now.
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: check_http

Post by scottwilkerson »

afigles wrote:I compiled wirh ssl and check_http -S works now.
Great!

Locking
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
Locked