<div dir="ltr"><div><div><div>Thank you for the replies.<br><br></div>I tried to use all these before asking!<br><br></div>By the check_debug.sh<br><br>Sun May 5 22:29:03 EEST 2013 /usr/lib64/nagios/plugins/check_http -H <a href="http://granma.gr">granma.gr</a> -u <a href="http://granma.gr/index.html">http://granma.gr/index.html</a> -R "Web " -w 10 -c 20<br>
Name or service not known HTTP CRITICAL - Unable to open TCP socket<br><br><br></div><div>If i check the same without space it works!<br><br>Do you have any ideas?<br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">
2013/5/5 Páll Guðjón Sigurðsson <span dir="ltr"><<a href="mailto:palli@ok.is" target="_blank">palli@ok.is</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Put your ARG in quotes. So it looks like this:<br>
<div class="im"><br>
$USER1$/check_http -H '$ARG1$' -s '$ARG2$' -w 10 -c 20<br>
<br>
</div>Then it will handle spaces.<br>
<br>
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:<br>
<br>
<br>
define service {<br>
        host_name               HOSTNAME<br>
        service_description     http://...<br>
        check_command           okc-check_http<br>
        use                     generic-service<br>
<br>
        __RESPONSE_WARNING      2<br>
        __RESPONSE_CRITICAL     10<br>
        __SEARCH_STRING<br>
        __VIRTUAL_HOST      HOSTNAME<br>
        __PORT              80<br>
        __URI                   /<br>
<br>
}<br>
<br>
<br>
<br>
define command {<br>
  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$"<br>

  command_name                   okc-check_http<br>
<div class="im HOEnZb">}<br>
<br>
<br>
<br>
<br>
----- Original Message -----<br>
From: "Κοκμάδης Δημήτριος" <<a href="mailto:dkokmadis@gmail.com">dkokmadis@gmail.com</a>><br>
To: <a href="mailto:nagios-users@lists.sourceforge.net">nagios-users@lists.sourceforge.net</a><br>
Sent: Sunday, May 5, 2013 3:23:02 PM<br>
Subject: [Nagios-users] check_http with spaces problem<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
</div><div class="HOEnZb"><div class="h5">Hi,<br>
<br>
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.<br>
<br>
So the command definition is like:<br>
<br>
$USER1$/check_http -H $ARG1$ -s $ARG2$ -w 10 -c 20<br>
<br>
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?<br>
<br>
Thanks,<br>
<br>
Jim<br>
<br>
</div></div><div class="HOEnZb"><div class="h5">------------------------------------------------------------------------------<br>
Get 100% visibility into Java/.NET code with AppDynamics Lite<br>
It's a free troubleshooting tool designed for production<br>
Get down to code-level detail for bottlenecks, with <2% overhead.<br>
Download for free and get started troubleshooting in minutes.<br>
<a href="http://p.sf.net/sfu/appdyn_d2d_ap2" target="_blank">http://p.sf.net/sfu/appdyn_d2d_ap2</a><br>
_______________________________________________<br>
Nagios-users mailing list<br>
<a href="mailto:Nagios-users@lists.sourceforge.net">Nagios-users@lists.sourceforge.net</a><br>
<a href="https://lists.sourceforge.net/lists/listinfo/nagios-users" target="_blank">https://lists.sourceforge.net/lists/listinfo/nagios-users</a><br>
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue.<br>
::: Messages without supporting info will risk being sent to /dev/null<br>
<br>
------------------------------------------------------------------------------<br>
Get 100% visibility into Java/.NET code with AppDynamics Lite<br>
It's a free troubleshooting tool designed for production<br>
Get down to code-level detail for bottlenecks, with <2% overhead.<br>
Download for free and get started troubleshooting in minutes.<br>
<a href="http://p.sf.net/sfu/appdyn_d2d_ap2" target="_blank">http://p.sf.net/sfu/appdyn_d2d_ap2</a><br>
_______________________________________________<br>
Nagios-users mailing list<br>
<a href="mailto:Nagios-users@lists.sourceforge.net">Nagios-users@lists.sourceforge.net</a><br>
<a href="https://lists.sourceforge.net/lists/listinfo/nagios-users" target="_blank">https://lists.sourceforge.net/lists/listinfo/nagios-users</a><br>
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue.<br>
::: Messages without supporting info will risk being sent to /dev/null</div></div></blockquote></div><br></div>