CHECK_HTTP_REDIRECT PLUGIN:

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
shan_1986
Posts: 25
Joined: Sun Jul 28, 2013 9:10 am

CHECK_HTTP_REDIRECT PLUGIN:

Post by shan_1986 »

Hello Everyone,

I really need your help in redirect plugin. I have this plugin to monitor websites that are redirected to another site. I have configured everything but still it shows INVALID USAGE when i execute the command. Please help me on this. What does this option mean? Should i enter the redirect URL in this option "-R"?
option "-R" - URL that must be equal to Header Location Redirect URL

Also the redirected website has the credentials entered already. Will that be a problem?
Please anyone help me out on this.

Thank you,
Sudarshan.
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: CHECK_HTTP_REDIRECT PLUGIN:

Post by abrist »

Can you post the full command and service configuration for the check?
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
shan_1986
Posts: 25
Joined: Sun Jul 28, 2013 9:10 am

Re: CHECK_HTTP_REDIRECT PLUGIN:

Post by shan_1986 »

Hello,

I have posted the command and host configuration below. I dont have any service checks apart from ping and dns entry..
Please let me know your suggestions..


COMMAND: /usr/local/nagios/libexec/check_http_redirect -U http://****.com -R https://********** -t 30 -c 2 -v
OUTPUT: ERROR: INVALID USAGE
Retrieve an http/s url and checks its header for a given redirects.
If the redirect exists and equal to the redirect you entered then exits with OK, otherwise exits with CRITICAL (if not equal) or CRITICAL ( if doesn't exist)

--help shows this message
--version shows version information

-U URL to retrieve (http or https)
-R URL that must be equal to Header Location Redirect URL
-S The HTTP status code that is expected
-t Timeout in seconds to wait for the URL to load. If the page fails to load,
Nagios check_http_redirect will exit with UNKNOWN state (default 60)
-c Depth of redirects to follow (default 10)

Service Configuration:

define host {
host_name *****.******.com
use xiwizard_website_host
address *****.******.com
check_command check_redirect!http://****.******.com!https://**********
max_check_attempts 5
check_interval 5
retry_interval 1
check_period xi_timeperiod_24x7
contacts *********
notification_interval 60
notification_period xi_timeperiod_24x7
icon_image *****
statusmap_image *****
_xiwizard website
register 1
}

Thank you,
Sudarshan.
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: CHECK_HTTP_REDIRECT PLUGIN:

Post by lmiltchev »

This is a 3rd party plugin and I am not familiar with it, but I don't see the "-v" flag in the help menu as an option. Since, you ca getting a "INVALID USAGE" error, I would guess it's a syntax problem.

Can you try running the command without the "-v" flag and show us the output? Also, try testing it not only from the CCM, but also directly, from the CLI.

You can also post a comment/question on the Nagios Exchange to the developer of the plugin.
Be sure to check out our Knowledgebase for helpful articles and solutions!
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: CHECK_HTTP_REDIRECT PLUGIN:

Post by slansing »

Are you providing a URL redirect location that is valid to the main https url you provided?
shan_1986
Posts: 25
Joined: Sun Jul 28, 2013 9:10 am

Re: CHECK_HTTP_REDIRECT PLUGIN:

Post by shan_1986 »

Hello,

Here is the output using "-v". I'm getting the same output that i got before.
I'm suspecting this parameter "-R - redirect URL"..
-R URL that must be equal to Header Location Redirect URL,, Should it be the redirect URL or the header location of the redirect URL?


COMMAND: /usr/local/nagios/libexec/check_http_redirect -U http://******** -R https:************ -t 30 -c 2 -v
OUTPUT: ERROR: INVALID USAGE
Retrieve an http/s url and checks its header for a given redirects.
If the redirect exists and equal to the redirect you entered then exits with OK, otherwise exits with CRITICAL (if not equal) or CRITICAL ( if doesn't exist)

--help shows this message
--version shows version information

-U URL to retrieve (http or https)
-R URL that must be equal to Header Location Redirect URL
-S The HTTP status code that is expected
-t Timeout in seconds to wait for the URL to load. If the page fails to load,
Nagios check_http_redirect will exit with UNKNOWN state (default 60)
-c Depth of redirects to follow (default 10)

Output from CLI:

/usr/local/nagios/libexec/check_http_redirect -U http://******* -R https:://******* -t 30 -c 2 -v
ERROR: INVALID USAGE
Retrieve an http/s url and checks its header for a given redirects.
If the redirect exists and equal to the redirect you entered then exits with OK, otherwise exits with CRITICAL (if not equal) or CRITICAL ( if doesn't e xist)

--help shows this message
--version shows version information

-U URL to retrieve (http or https)
-R URL that must be equal to Header Location Redirect URL
-S The HTTP status code that is expected
-t Timeout in seconds to wait for the URL to load. If the page fails to load,
Nagios check_http_redirect will exit with UNKNOWN state (default 60)
-c Depth of redirects to follow (default 10)

Thank you,
Sudarshan.
shan_1986
Posts: 25
Joined: Sun Jul 28, 2013 9:10 am

Re: CHECK_HTTP_REDIRECT PLUGIN:

Post by shan_1986 »

Hello Slansing,

Are you providing a URL redirect location that is valid to the main https url you provided?

I'm providing the redirect URL which is retrieved once i hit base URL. Is that correct or should it be the header location of the redirect URL?
Please advise.

-R URL that must be equal to Header Location Redirect URL

Thank you,
Sudarshan.
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: CHECK_HTTP_REDIRECT PLUGIN:

Post by tmcdonald »

shan_1986 wrote:Here is the output using "-v". I'm getting the same output that i got before.
Could you try as lmiltchev suggested and omit the -v option?
Former Nagios employee
shan_1986
Posts: 25
Joined: Sun Jul 28, 2013 9:10 am

Re: CHECK_HTTP_REDIRECT PLUGIN:

Post by shan_1986 »

Hello,

I have tried without -v and i did get the same output "INVALID USAGE"

Thank you,
Sudarshan.
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: CHECK_HTTP_REDIRECT PLUGIN:

Post by tmcdonald »

If you run

Code: Select all

curl -I www.somesite.com
obviously replacing "www.somesite.com" with your own site, then whatever is listed after "Location:" should be what you want.

http://stackoverflow.com/questions/3037 ... 1-redirect
Former Nagios employee
Locked