Welcome back to the fold.  A lot of questions.

For reading a pid file look at the function 'readfile'.

I've been experimenting with tcpread and open ports.  This is untested but 
please try it out and let me know if it works.  If you have to modify it 
please repost your work.

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

bundle common g {
    classes:
        "all" expression => "any";
}

bundle agent test {

    vars:
 
        "sym" string => 
            readtcp("www.example.com","80","","10240000");

        "local" string => 
            readtcp("www.localhost.com","81","","10240000");

    classes:
 
        "sym_ok" expression => regcmp("","${sym}");
        "local_ok" expression => regcmp("","${local}");

 
    reports:

        all::
            "sym: ${sym}";
            "local: ${local}";

        !sym_ok::
            "Port closed to 80.";

        sym_ok::
            "Port open to 80.";

        !local_ok::
            "Port closed to 81.";

        local_ok::
            "Port open to 81.";

}
Sincerely,
--
Neil Watson
416-673-3465

CONFIDENTIALITY WARNING 
This communication, including any attachments, is for the exclusive use of 
addressee and may contain proprietary and/or confidential information. If you 
are not the intended recipient, any use, copying, disclosure, dissemination or 
distribution is strictly prohibited. If you are not the intended recipient, 
please notify the sender immediately by return e-mail, delete this 
communication and destroy all copies.

AVERTISSEMENT RELATIF À LA CONFIDENTIALITÉ 
Ce message, ainsi que les pièces qui y sont jointes, est destiné à l’usage 
exclusif de la personne à laquelle il s’adresse et peut contenir de 
l’information personnelle ou confidentielle. Si le lecteur de ce message n’en 
est pas le destinataire, nous l’avisons par la présente que toute diffusion, 
distribution, reproduction ou utilisation de son contenu est strictement 
interdite. Veuillez avertir sur-le-champ l’expéditeur par retour de courrier 
électronique et supprimez ce message ainsi que toutes les pièces jointes.
_______________________________________________
Help-cfengine mailing list
[email protected]
https://cfengine.org/mailman/listinfo/help-cfengine

Reply via email to