Check the URL with portnumber using check_http command

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
rashmi
Posts: 4
Joined: Thu Jun 26, 2014 8:56 am

Check the URL with portnumber using check_http command

Post by rashmi »

Hi ,

I have problem checking the status of the websit which has port number is it

if i try below command

./check_http -H https://something:8016/abc/ it gives me error message as

Name or service not known
HTTP CRITICAL - Unable to open TCP socket

could you please let me know how can i solve this issue ?
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: Check the URL with portnumber using check_http command

Post by tmcdonald »

You can specify the port with the -p flag like so:

Code: Select all

./check_http -H https://something/abc/ -p 8016
Pass just the --help flag to get full help output.
Former Nagios employee
rashmi
Posts: 4
Joined: Thu Jun 26, 2014 8:56 am

Re: Check the URL with portnumber using check_http command

Post by rashmi »

Hi ,

Giving command as mentioned by you gives me "Name or service not know" it is still not passing by however URL will be still reachable via Browser. I have tried increasing time out to 30 seconds that does not help to solve the error.

could you please advise ?

My command looks like this commands.cfg file

# 'check-https-nettv' (ssl) command definition
define command{
command_name check-https-nettv
command_line $USER1$/check_http -H $ARG1$ $ARG2$ -S -f follow -t 30 -A "xxxxxxxxxxxxx"
}

and my config file from where URLis monotired looks like this

# --- --- Banaxi Cyprus- ---

define host{
use nettv-host-production
host_name Banaxi Cyprus
display_name Banaxi Cyprus
address something.com
hostgroups DE, GR
}

define service{
use generic-service
host_name Banaxi Cyprus
check_command check-http-nettv!something.com!-u /index.xhtml -p 7020
}

actual URL http://something.com:7020/index.xhtml

Regards,
Rashmi
User avatar
lgroschen
Posts: 384
Joined: Wed Nov 27, 2013 1:17 pm

Re: Check the URL with portnumber using check_http command

Post by lgroschen »

command_line $USER1$/check_http -H $ARG1$ $ARG2$ -S -f follow -t 30 -A "xxxxxxxxxxxxx"
What is the $ARG2$ reffering to in the above command? Also the '-S' flag uses default port 443 to connect via SSL, other options= (1 = TLSv1, 2 = SSLv2, 3 = SSLv3) so this could be part of the problem, unless you have default SSL settings.

One more thing what is being passed into -A? If its sensitive you can PM it to me, but the user agent is passed here. Just make sure its the correct http header for "User Agent" ie spelling on both sides.
/Luke
Locked