0

I have installed Nagios (Nagios® Core™ Version 4.2.2) in Linux Server.I have written a JIRA URL check using check_http for HTTPS url.

It should get a response 200, but It gives response HTTP CODE 302.

[demuc1dv48:/pkg/vdcrz/Nagios/libexec][orarz]# ./check_http -I xx.xx.xx  -u https://xxx.xxx.xxx.com/secure/Dashboard.jspa -S CONNECT
SSL Version: TLSv1
HTTP OK: HTTP/1.1 302 Found - 296 bytes in 0.134 second response time |time=0.134254s;;;0.000000 size=296B;;;

So I configured the same in the nagios configuration file.

define command{
        command_name    check_https_jira_prod
        command_line    $USER1$/check_http -I xxx.xxx.xxx.com  -u https://xxx.xxx.xxx.com/secure/Dashboard.jspa -S CONNECT -e 'HTTP/1.1 302'
}

Now my JIRA server is down, But it is not reflected in the nagios check.The nagios response still shows HTTP code 302 only.

How to fix this issue?

user2439278
  • 1,222
  • 7
  • 41
  • 75

2 Answers2

1

You did not specify, but I assume you defined your command in the Nagios central server commands.cfgconfiguration file, but you also need to define a service in services.cfg as services use commands to run scripts.

If you are running your check_httpcheck from a different server you also need to define it in the nrpe.cfg configuration file on that remote machine and then restart nrpe.

As a side note, from the output you've shared, I believe you're not using the flags that the check_http Nagios plugin supports correctly. From your post:

check_http -I xxx.xxx.xxx.com  -u https://xxx.xxx.xxx.com/secure/Dashboard.jspa -S CONNECT -e 'HTTP/1.1 302'

From ./check_http -h:

-I, --IP-address=ADDRESS
    IP address or name (use numeric address if possible to bypass DNS lookup).

You are using a host name instead (xxx.xxx.xxx.com )

-S, --ssl=VERSION
    Connect via SSL. Port defaults to 443. VERSION is optional, and prevents auto-negotiation (1 = TLSv1, 2 = SSLv2, 3 = SSLv3).

You specified CONNECT

AnythingIsFine
  • 1,777
  • 13
  • 11
  • Im running this check_http from my nagios machine, The JIRA URL is running in another machine. `./check_http -I <> -u https://jira-ex.com/secure/Dashboard.jspa -S` , the Output is `CRITICAL - Socket timeout`. But the URL is up and running now – user2439278 Feb 14 '18 at 16:17
1

You can't get code 200 unless you set follow parameter in chech_http script.

I suggest you to use something like this:

./check_http -I jira-ex.telefonica.de  -u https://xxx.xxx.xxx.com/secure/Dashboard.jspa -S -f follow

The -f follow is mandatory for your use case.

Rohlik
  • 1,286
  • 19
  • 28