Xymon Mailing List Archive search

rootlogin.pl

5 messages in this thread

list Joshua Krause · Thu, 10 Jan 2008 12:32:48 -0500 ·
I installed the rootlogin.pl and it wasn't working for a bit until I put the
actual $BBHOME directory in the hobbitlauch.cfg for the rootlogin.pl entry.
But now when I look at the rootlogin.log file I am getting these errors:

 
Use of uninitialized value in concatenation (.) or string at
/opt/hobbit/server/ext/rootlogin.pl line 76, <STDIN> line 102879.

Use of uninitialized value in concatenation (.) or string at
/opt/hobbit/server/ext/rootlogin.pl line 76, <STDIN> line 103303.

Use of uninitialized value in concatenation (.) or string at
/opt/hobbit/server/ext/rootlogin.pl line 76, <STDIN> line 103673.

Use of uninitialized value in concatenation (.) or string at
/opt/hobbit/server/ext/rootlogin.pl line 76, <STDIN> line 104351.

Use of uninitialized value in concatenation (.) or string at
/opt/hobbit/server/ext/rootlogin.pl line 76, <STDIN> line 105102.

Use of uninitialized value in concatenation (.) or string at
/opt/hobbit/server/ext/rootlogin.pl line 76, <STDIN> line 105945.

Use of uninitialized value in concatenation (.) or string at
/opt/hobbit/server/ext/rootlogin.pl line 76, <STDIN> line 106447.

Use of uninitialized value in concatenation (.) or string at
/opt/hobbit/server/ext/rootlogin.pl line 76, <STDIN> line 106861.

Use of uninitialized value in concatenation (.) or string at
/opt/hobbit/server/ext/rootlogin.pl line 76, <STDIN> line 107535.

Use of uninitialized value in concatenation (.) or string at
/opt/hobbit/server/ext/rootlogin.pl line 76, <STDIN> line 108031.

Use of uninitialized value in concatenation (.) or string at
/opt/hobbit/server/ext/rootlogin.pl line 76, <STDIN> line 108397.

Use of uninitialized value in concatenation (.) or string at
/opt/hobbit/server/ext/rootlogin.pl line 76, <STDIN> line 108912.

 
And line 76 is this:

 
62         elsif ($line =~ /^\@\@/) {

 63                 # End of a message. Do something with it.

 64                 processmessage();

 65         }

 66         elsif ($line =~ /^\[(.+)\]/) {

 67                 # Start of new message section.

 68

 69                 $cursection = $1;

 70                 $sections{ $cursection } = "\n";

 71         }

 72         else {

 73                 # Add another line to the entire message text variable,

 74                 # and the the current section.

 75                 $msgtxt = $msgtxt . $line;

 76                 $sections{ $cursection } = $sections{ $cursection } .
$line;

 77         }

 78 }

 79

 80

 
Anyone else seen this.

 
Thanks,

 
Josh
list Giovanni - Gestor Redix · Thu, 10 Jan 2008 15:41:38 -0200 ·
Hi Joshua, you can try the BASH version of this script, search in the
history of the list and you will find it... if you want i can send too...

Cheers
quoted from Joshua Krause

Joshua Krause wrote:
I installed the rootlogin.pl and it wasn't working for a bit until I
put the actual $BBHOME directory in the hobbitlauch.cfg for the
rootlogin.pl entry.  But now when I look at the rootlogin.log file I
am getting these errors:

 
Use of uninitialized value in concatenation (.) or string at
/opt/hobbit/server/ext/rootlogin.pl line 76, <STDIN> line 102879.

Use of uninitialized value in concatenation (.) or string at
/opt/hobbit/server/ext/rootlogin.pl line 76, <STDIN> line 103303.

Use of uninitialized value in concatenation (.) or string at
/opt/hobbit/server/ext/rootlogin.pl line 76, <STDIN> line 103673.

Use of uninitialized value in concatenation (.) or string at
/opt/hobbit/server/ext/rootlogin.pl line 76, <STDIN> line 104351.

Use of uninitialized value in concatenation (.) or string at
/opt/hobbit/server/ext/rootlogin.pl line 76, <STDIN> line 105102.

Use of uninitialized value in concatenation (.) or string at
/opt/hobbit/server/ext/rootlogin.pl line 76, <STDIN> line 105945.

Use of uninitialized value in concatenation (.) or string at
/opt/hobbit/server/ext/rootlogin.pl line 76, <STDIN> line 106447.

Use of uninitialized value in concatenation (.) or string at
/opt/hobbit/server/ext/rootlogin.pl line 76, <STDIN> line 106861.

Use of uninitialized value in concatenation (.) or string at
/opt/hobbit/server/ext/rootlogin.pl line 76, <STDIN> line 107535.

Use of uninitialized value in concatenation (.) or string at
/opt/hobbit/server/ext/rootlogin.pl line 76, <STDIN> line 108031.

Use of uninitialized value in concatenation (.) or string at
/opt/hobbit/server/ext/rootlogin.pl line 76, <STDIN> line 108397.

Use of uninitialized value in concatenation (.) or string at
/opt/hobbit/server/ext/rootlogin.pl line 76, <STDIN> line 108912.

 
And line 76 is this:

 
62         elsif ($line =~ /^\@\@/) {

 63                 # End of a message. Do something with it.

 64                 processmessage();

 65         }

 66         elsif ($line =~ /^\[(.+)\]/) {

 67                 # Start of new message section.

 68

 69                 $cursection = $1;

 70                 $sections{ $cursection } = "\n";

 71         }

 72         else {

 73                 # Add another line to the entire message text
variable,

 74                 # and the the current section.

 75                 $msgtxt = $msgtxt . $line;

* 76                 $sections{ $cursection } = $sections{ $cursection
} . $line;*

 77         }

 78 }

 79

 80

 
Anyone else seen this.

 
Thanks,

 
Josh
list Joshua Krause · Thu, 10 Jan 2008 13:08:41 -0500 ·
Sure I can try the bash version.  Can you send it to me?
quoted from Giovanni - Gestor Redix

 
From: Giovanni - Gestor Redix [mailto:user-e1d5cb184a81@xymon.invalid] 
Sent: Thursday, January 10, 2008 12:42 PM
To: user-ae9b8668bcde@xymon.invalid
Subject: Re: [hobbit] rootlogin.pl

 
Hi Joshua, you can try the BASH version of this script, search in the
history of the list and you will find it... if you want i can send too...

Cheers

Joshua Krause wrote: 

I installed the rootlogin.pl and it wasn't working for a bit until I put the
actual $BBHOME directory in the hobbitlauch.cfg for the rootlogin.pl entry.
But now when I look at the rootlogin.log file I am getting these errors:

 
Use of uninitialized value in concatenation (.) or string at
/opt/hobbit/server/ext/rootlogin.pl line 76, <STDIN> line 102879.

Use of uninitialized value in concatenation (.) or string at
/opt/hobbit/server/ext/rootlogin.pl line 76, <STDIN> line 103303.

Use of uninitialized value in concatenation (.) or string at
/opt/hobbit/server/ext/rootlogin.pl line 76, <STDIN> line 103673.

Use of uninitialized value in concatenation (.) or string at
/opt/hobbit/server/ext/rootlogin.pl line 76, <STDIN> line 104351.

Use of uninitialized value in concatenation (.) or string at
/opt/hobbit/server/ext/rootlogin.pl line 76, <STDIN> line 105102.

Use of uninitialized value in concatenation (.) or string at
/opt/hobbit/server/ext/rootlogin.pl line 76, <STDIN> line 105945.

Use of uninitialized value in concatenation (.) or string at
/opt/hobbit/server/ext/rootlogin.pl line 76, <STDIN> line 106447.

Use of uninitialized value in concatenation (.) or string at
/opt/hobbit/server/ext/rootlogin.pl line 76, <STDIN> line 106861.

Use of uninitialized value in concatenation (.) or string at
/opt/hobbit/server/ext/rootlogin.pl line 76, <STDIN> line 107535.

Use of uninitialized value in concatenation (.) or string at
/opt/hobbit/server/ext/rootlogin.pl line 76, <STDIN> line 108031.

Use of uninitialized value in concatenation (.) or string at
/opt/hobbit/server/ext/rootlogin.pl line 76, <STDIN> line 108397.

Use of uninitialized value in concatenation (.) or string at
/opt/hobbit/server/ext/rootlogin.pl line 76, <STDIN> line 108912.

 
And line 76 is this:

 
62         elsif ($line =~ /^\@\@/) {

 63                 # End of a message. Do something with it.

 64                 processmessage();

 65         }

 66         elsif ($line =~ /^\[(.+)\]/) {

 67                 # Start of new message section.

 68

 69                 $cursection = $1;

 70                 $sections{ $cursection } = "\n";

 71         }

 72         else {

 73                 # Add another line to the entire message text variable,

 74                 # and the the current section.

 75                 $msgtxt = $msgtxt . $line;

 76                 $sections{ $cursection } = $sections{ $cursection } .
$line;

 77         }

 78 }

 79

 80

 
Anyone else seen this.

 
Thanks,

 
Josh
list Hobbit User in Richmond · Thu, 10 Jan 2008 13:20:12 -0500 (EST) ·
quoted from Joshua Krause
On Thu, January 10, 2008 12:32, Joshua Krause wrote:
I installed the rootlogin.pl and it wasn't working for a bit until I put
the
actual $BBHOME directory in the hobbitlauch.cfg for the rootlogin.pl
entry.
But now when I look at the rootlogin.log file I am getting these errors:


Use of uninitialized value in concatenation (.) or string at
/opt/hobbit/server/ext/rootlogin.pl line 76, <STDIN> line 102879.

Use of uninitialized value in concatenation (.) or string at
/opt/hobbit/server/ext/rootlogin.pl line 76, <STDIN> line 103303.

Use of uninitialized value in concatenation (.) or string at
/opt/hobbit/server/ext/rootlogin.pl line 76, <STDIN> line 103673.

Use of uninitialized value in concatenation (.) or string at
/opt/hobbit/server/ext/rootlogin.pl line 76, <STDIN> line 104351.

Use of uninitialized value in concatenation (.) or string at
/opt/hobbit/server/ext/rootlogin.pl line 76, <STDIN> line 105102.

Use of uninitialized value in concatenation (.) or string at
/opt/hobbit/server/ext/rootlogin.pl line 76, <STDIN> line 105945.

Use of uninitialized value in concatenation (.) or string at
/opt/hobbit/server/ext/rootlogin.pl line 76, <STDIN> line 106447.

Use of uninitialized value in concatenation (.) or string at
/opt/hobbit/server/ext/rootlogin.pl line 76, <STDIN> line 106861.

Use of uninitialized value in concatenation (.) or string at
/opt/hobbit/server/ext/rootlogin.pl line 76, <STDIN> line 107535.

Use of uninitialized value in concatenation (.) or string at
/opt/hobbit/server/ext/rootlogin.pl line 76, <STDIN> line 108031.

Use of uninitialized value in concatenation (.) or string at
/opt/hobbit/server/ext/rootlogin.pl line 76, <STDIN> line 108397.

Use of uninitialized value in concatenation (.) or string at
/opt/hobbit/server/ext/rootlogin.pl line 76, <STDIN> line 108912.


And line 76 is this:


62         elsif ($line =~ /^\@\@/) {

 63                 # End of a message. Do something with it.

 64                 processmessage();

 65         }

 66         elsif ($line =~ /^\[(.+)\]/) {

 67                 # Start of new message section.

 68

 69                 $cursection = $1;

 70                 $sections{ $cursection } = "\n";

 71         }

 72         else {

 73                 # Add another line to the entire message text
variable,

 74                 # and the the current section.

 75                 $msgtxt = $msgtxt . $line;

 76                 $sections{ $cursection } = $sections{ $cursection } .
$line;

 77         }

 78 }

 79

 80

    * To: <user-ae9b8668bcde@xymon.invalid>
    * Subject: RE: [hobbit] Sample of Hobbit server-side module (was: Who
Test)
    * From: "Hubbard, Greg L" <user-d970b5e56ec9@xymon.invalid>
    * Date: Tue, 30 Jan 2007 08:39:43 -0600
    * Thread-index: AcdEXpGdY3UJQChIRdqsdnE5/kBgoQAHTv2A
    * Thread-topic: [hobbit] Sample of Hobbit server-side module (was: Who
Test)

That is a normal Perl gripe if you use one of the pragmas (use strict;
use warning) or have the -w switch in the first line.  Without this
stuff, Perl silently "handles" this condition -- Perl was not always
militant about having variables predeclared and initialized prior to
first use.

GLH

-----Original Message-----
From: Morris, Chris (SS-IS) [mailto:user-7c3d847d296d@xymon.invalid]
Sent: Tuesday, January 30, 2007 5:04 AM
To: 'user-ae9b8668bcde@xymon.invalid'
Subject: RE: [hobbit] Sample of Hobbit server-side module (was: Who
Test)

The script works but is generating this message in the log :-

Use of uninitialized value in concatenation (.) at
/usr/local/hobbit/server/ext/rootlogin.pl line 76, <STDIN> line 841341.
list Joshua Krause · Thu, 17 Jul 2008 14:28:37 -0400 ·
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