[Nagiosplug-devel] check_tcp and local sockets

Alex Samorukov ml at os2.kiev.ua
Sun Oct 30 05:03:37 CET 2005


sean finney wrote:

>hey alex,
>
>On Sat, Oct 29, 2005 at 09:24:04PM +0300, Alex Samorukov wrote:
>  
>
>yeah.  and that's what i get for making a code optimization without
>double checking myself.  anyway, both of these are fixed in cvs now.
>  
>
I updated my src tree to latest cvs. Now it seems that all work fine (i 
tested check_clamd and
check_tcp). I found one minor problem. When using with local sockets i 
found that there is a timeout (~2sec) from starting of the command and 
before any output. I found that this happens because of  request with 
socket name to DNS server. This patch will fix this:
diff -u -r1.71 check_tcp.c
--- check_tcp.c 30 Oct 2005 10:25:26 -0000      1.71
+++ check_tcp.c 30 Oct 2005 13:01:18 -0000
@@ -550,7 +550,7 @@
 
        if (server_address == NULL)
                usage4 (_("You must provide a server address"));
-       else if (is_host (server_address) == FALSE && server_address[0] 
!= '/')
+       else if (server_address[0] != '/' && is_host (server_address) == 
FALSE)
                usage2 (_("Invalid hostname, address, or socket"), 
server_address);
 
        return TRUE;

>on a related note, i believe that providing this feature also provides
>a much better/thorough way to test the tcp-based plugins.  i don't know
>much about how the test suite works, but it wouldn't be too hard to
>write a test program that creates a unix domain socket and spoke
>the proper things to the plugins...
>  
>
Sure. May be i`ll try to find some time and create daemon which will 
response on check_tcp commands.





More information about the Devel mailing list