rootlogin.pl

Joshua Krause forums at triadbiz.rr.com
Thu Jul 17 20:28:37 CEST 2008


I am trying to get the rootlogin.pl to go red on root, yellow on any other
user and green if nothing is available.  I have made some modifications to
the script and restarted hobbit but it will never go yellow just green and
red.  I have modified the script from:

 

        if ( $sections{"who"} =~ /^root /m ) {

                $color = "red";

                $summary = "ROOT login active";

                $statusmsg = "&red ROOT login detected!\n\n" .
$sections{"who"};

        }

        else {

                $color = "green";

                #$summary = "OK";

                $summary = "OK" . $sections{"who"};

                $statusmsg = "&green No root login active\n\n" .
$sections{"who"};

        }

 

 

To this:

 

        if ( $sections{"who"} =~ /^root /m ) {

                $color = "red";

                $summary = "ROOT login active";

                $statusmsg = "&red ROOT login detected!\n\n " .
$sections{"who"};

        }

        elsif ( $sections{"who"} =~/^\n/) {

                $color = "green";

                $summary = "OK";

                $statusmsg = "&green No active logins\n\n" .
$sections{"who"};

        }

        else {

                $color = "yellow";

                $summary = "USER login active";

                $statusmsg = "&yellow USER login detected!" .
$sections{"who"};

        }

 

Can anyone let me know what I am doing wrong?

 

Thanks,

-Josh

 

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.xymon.com/pipermail/xymon/attachments/20080717/3c26d706/attachment.html>


More information about the Xymon mailing list