check_http

This forum is intended for the discussion of Nagios plugin development. Feature requests, patches, bug fixes, and all types of development-related discussions are welcome!

NOTE: The SourceForge.net nagiosplug-devel mailing list has been deprecated in favor of this forum in order to expedite support and provide additional features not available on the old mailing list.

Re: check_http

Postby afigles » Fri Sep 13, 2019 1:36 am

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

Re: check_http

Postby scottwilkerson » Fri Sep 13, 2019 6:38 am

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
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
User avatar
scottwilkerson
DevOps Engineer
 
Posts: 17032
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises

Re: check_http

Postby afigles » Fri Sep 13, 2019 7:31 am

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

Re: check_http

Postby scottwilkerson » Fri Sep 13, 2019 8:22 am

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
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
User avatar
scottwilkerson
DevOps Engineer
 
Posts: 17032
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises

Re: check_http

Postby afigles » Mon Sep 16, 2019 3:32 am

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

Re: check_http

Postby scottwilkerson » Mon Sep 16, 2019 6:53 am

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
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
User avatar
scottwilkerson
DevOps Engineer
 
Posts: 17032
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises

Re: check_http

Postby afigles » Tue Sep 24, 2019 1:46 am

I compiled wirh ssl and check_http -S works now.
afigles
 
Posts: 19
Joined: Wed Sep 11, 2019 12:15 pm

Re: check_http

Postby scottwilkerson » Tue Sep 24, 2019 9:39 am

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

Great!

Locking
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
User avatar
scottwilkerson
DevOps Engineer
 
Posts: 17032
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises

Previous

Return to Nagios Plugin Development

Who is online

Users browsing this forum: No registered users and 1 guest