Forum: Cfengine Help
Subject: Re: readtcp with empty send string: how to use?
Author: Seva Gluschenko
Link to topic: https://cfengine.com/forum/read.php?3,17768,17775#msg-17775

Perhaps, the selectservers function may help. The following example works 
pretty well:


body common control
{
 bundlesequence => { "test" };
}

########################################################
bundle agent test
{
 vars:
        "servers" slist => { "localhost" };
        "result"     int   => selectservers("@(servers)", "80", "", "", "20", 
"alive_servers");

 classes:
         "is_up"  expression => isgreaterthan("$(result)","0");

 reports:
    is_up::
        "OK: $(result), $(alive_servers[0])";
}


Replace localhost and "80" with host and port you want to test.

_______________________________________________
Help-cfengine mailing list
Help-cfengine@cfengine.org
https://cfengine.org/mailman/listinfo/help-cfengine

Reply via email to