check_http with spaces problem

Κοκμάδης Δημήτριος dkokmadis at gmail.com
Sun May 5 21:47:52 CEST 2013


Thank you for the replies.

I tried to use all these before asking!

By the check_debug.sh

Sun May 5 22:29:03 EEST 2013 /usr/lib64/nagios/plugins/check_http -H
granma.gr -u http://granma.gr/index.html -R "Web " -w 10 -c 20
Name or service not known HTTP CRITICAL - Unable to open TCP socket


If i check the same without space it works!

Do you have any ideas?


2013/5/5 Páll Guðjón Sigurðsson <palli at ok.is>

> Put your ARG in quotes. So it looks like this:
>
> $USER1$/check_http -H '$ARG1$' -s '$ARG2$' -w 10 -c 20
>
> Then it will handle spaces.
>
> Alternatively, you can use custom variables to a check command that is
> more complex, but in return your service definitions will become much more
> readable. Example:
>
>
> define service {
>         host_name               HOSTNAME
>         service_description     http://...
>         check_command           okc-check_http
>         use                     generic-service
>
>         __RESPONSE_WARNING      2
>         __RESPONSE_CRITICAL     10
>         __SEARCH_STRING
>         __VIRTUAL_HOST      HOSTNAME
>         __PORT              80
>         __URI                   /
>
> }
>
>
>
> define command {
>   command_line                   $USER1$/check_http -I $HOSTADDRESS$ -H
> "$_SERVICE_VIRTUAL_HOST$" -p "$_SERVICE_PORT$" -u "$_SERVICE_URI$" -s
> "$_SERVICE_SEARCH_STRING$" -w "$_SERVICE_RESPONSE_WARNING$" -c
> "$_SERVICE_RESPONSE_CRITICAL$"
>   command_name                   okc-check_http
> }
>
>
>
>
> ----- Original Message -----
> From: "Κοκμάδης Δημήτριος" <dkokmadis at gmail.com>
> To: nagios-users at lists.sourceforge.net
> Sent: Sunday, May 5, 2013 3:23:02 PM
> Subject: [Nagios-users] check_http with spaces problem
>
>
>
>
>
>
>
>
> Hi,
>
> I am trying to check multiple http sites, so i configure a bash script
> which create the service definition but i faced a problem when the expected
> string has spaces.
>
> So the command definition is like:
>
> $USER1$/check_http -H $ARG1$ -s $ARG2$ -w 10 -c 20
>
> if i pass an $ARG2$ without spaces it's work fine, but if it has spaces
> nagios can't make check. Could you give me a help?
>
> Thanks,
>
> Jim
>
>
> ------------------------------------------------------------------------------
> Get 100% visibility into Java/.NET code with AppDynamics Lite
> It's a free troubleshooting tool designed for production
> Get down to code-level detail for bottlenecks, with <2% overhead.
> Download for free and get started troubleshooting in minutes.
> http://p.sf.net/sfu/appdyn_d2d_ap2
> _______________________________________________
> Nagios-users mailing list
> Nagios-users at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/nagios-users
> ::: Please include Nagios version, plugin version (-v) and OS when
> reporting any issue.
> ::: Messages without supporting info will risk being sent to /dev/null
>
>
> ------------------------------------------------------------------------------
> Get 100% visibility into Java/.NET code with AppDynamics Lite
> It's a free troubleshooting tool designed for production
> Get down to code-level detail for bottlenecks, with <2% overhead.
> Download for free and get started troubleshooting in minutes.
> http://p.sf.net/sfu/appdyn_d2d_ap2
> _______________________________________________
> Nagios-users mailing list
> Nagios-users at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/nagios-users
> ::: Please include Nagios version, plugin version (-v) and OS when
> reporting any issue.
> ::: Messages without supporting info will risk being sent to /dev/null
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.monitoring-lists.org/archive/users/attachments/20130505/7ff00a91/attachment.html>
-------------- next part --------------
------------------------------------------------------------------------------
Get 100% visibility into Java/.NET code with AppDynamics Lite
It's a free troubleshooting tool designed for production
Get down to code-level detail for bottlenecks, with <2% overhead.
Download for free and get started troubleshooting in minutes.
http://p.sf.net/sfu/appdyn_d2d_ap2
-------------- next part --------------
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. 
::: Messages without supporting info will risk being sent to /dev/null


More information about the Users mailing list