Page 1 of 1

CHECK_HTTP_REDIRECT PLUGIN:

Posted: Sat Jan 11, 2014 1:49 am
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.

Re: CHECK_HTTP_REDIRECT PLUGIN:

Posted: Mon Jan 13, 2014 11:55 am
by abrist
Can you post the full command and service configuration for the check?

Re: CHECK_HTTP_REDIRECT PLUGIN:

Posted: Fri Jan 17, 2014 5:12 am
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.

Re: CHECK_HTTP_REDIRECT PLUGIN:

Posted: Fri Jan 17, 2014 3:44 pm
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.

Re: CHECK_HTTP_REDIRECT PLUGIN:

Posted: Fri Jan 17, 2014 3:45 pm
by slansing
Are you providing a URL redirect location that is valid to the main https url you provided?

Re: CHECK_HTTP_REDIRECT PLUGIN:

Posted: Mon Jan 20, 2014 4:22 am
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.

Re: CHECK_HTTP_REDIRECT PLUGIN:

Posted: Mon Jan 20, 2014 4:24 am
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.

Re: CHECK_HTTP_REDIRECT PLUGIN:

Posted: Mon Jan 20, 2014 12:49 pm
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?

Re: CHECK_HTTP_REDIRECT PLUGIN:

Posted: Tue Jan 21, 2014 6:03 am
by shan_1986
Hello,

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

Thank you,
Sudarshan.

Re: CHECK_HTTP_REDIRECT PLUGIN:

Posted: Tue Jan 21, 2014 4:12 pm
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