Xymon Mailing List Archive search

external script not working

4 messages in this thread

list Rodney Simioni · Tue, 5 Aug 2014 13:30:46 +0000 ·
My custom script is not reporting anything to the Hobbit Server. I'm running this script on the Hobbit server.

I have placed my script in /usr/lib/hobbit/server/ext/b.pl. The script basically does nothing but report green:

#!/usr/bin/perl -w
use strict;

# Xymon Variables
#$ENV{BBPROG}    = "b.pl";
my($TESTNAME)   = "test";
my($BBHOME)     = $ENV{BBHOME};
my($BB)         = $ENV{BB};
my($BBDISP)     = $ENV{BBDISP};
my($BBVAR)      = $ENV{BBVAR};
my($MACHINE)    = $ENV{MACHINE};
my($DATE)       = localtime;
my($COLOR)      = "green";
my($MSG)        = "";
my($HEAD)       = "";
my($DATA)       = "";

print "$MACHINE\n";
$MACHINE =~ s/\./,/g;
      my($cmd) = "$BB $BBDISP \"status $MACHINE.$TESTNAME $COLOR $DATE $HEAD\n$DATA\n$MSG\"";
      system($cmd);


I put the following lines in the  /etc/hobbit/hobbitlaunch.cfg
[test]
        ENVFILE /usr/lib/hobbit/server/etc/hobbitserver.cfg
        NEEDS hobbitd
        CMD /usr/lib/hobbit/server/ext/b.pl
        LOGFILE $BBSERVERLOGS/test.log
        INTERVAL 5m

I have put 'test' in the bb-hosts file:
subpage vips VIPS
xxx.xxx.xxx.xxx   server1 #test
xxx.xxx.xxx.xxx  server2 #test


Any help will be greatly appreciated.

Rod
list Torsten Richter · Tue, 05 Aug 2014 17:01:16 +0200 ·
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi Rodney,

if I understand you correctly , then you run your script on the Hobbit
Server, right?
Then you should see a green dot on the line where your server is with
the name test.
And if you do, then your script is working fine.
If not, then please have a look at test.log and check for any unusual
messages regarding your script.

BUT(!) if you want your script to display the green dot named test on
the lines of server1 and server2 then you have to copy it to the clients
and run it from there.

In both cases there is no need of specifying the keyword test in bb-hosts.

If your script is already on the clients server1 and server2 and you
made the entries on the clients in hobbitlaunch.cfg then the problem
might be that your clients do not have a hobbitd running.

HTH
Torsten
quoted from Rodney Simioni

On 05.08.2014 15:30, Simioni, Rodney wrote:
My custom script is not reporting anything to the Hobbit Server. I'm running this script on the Hobbit server.

I have placed my script in /usr/lib/hobbit/server/ext/b.pl. The script basically does nothing but report green:

#!/usr/bin/perl -w
use strict;

# Xymon Variables
#$ENV{BBPROG}    = "b.pl";
my($TESTNAME)   = "test";
my($BBHOME)     = $ENV{BBHOME};
my($BB)         = $ENV{BB};
my($BBDISP)     = $ENV{BBDISP};
my($BBVAR)      = $ENV{BBVAR};
my($MACHINE)    = $ENV{MACHINE};
my($DATE)       = localtime;
my($COLOR)      = "green";
my($MSG)        = "";
my($HEAD)       = "";
my($DATA)       = "";

print "$MACHINE\n";
$MACHINE =~ s/\./,/g;
      my($cmd) = "$BB $BBDISP \"status $MACHINE.$TESTNAME $COLOR $DATE $HEAD\n$DATA\n$MSG\"";
      system($cmd);


I put the following lines in the  /etc/hobbit/hobbitlaunch.cfg
[test]
        ENVFILE /usr/lib/hobbit/server/etc/hobbitserver.cfg
        NEEDS hobbitd
        CMD /usr/lib/hobbit/server/ext/b.pl
        LOGFILE $BBSERVERLOGS/test.log
        INTERVAL 5m

I have put 'test' in the bb-hosts file:
subpage vips VIPS
xxx.xxx.xxx.xxx   server1 #test
xxx.xxx.xxx.xxx  server2 #test


Any help will be greatly appreciated.

Rod

- -- 
+---------------------------------------------------------+

| E-mail  : user-c862b499d9fa@xymon.invalid			  |
|							  |
| Homepage: http://www.richter-it.net/			  |
+---------------------------------------------------------+
Download my public key from:
http://gpg-keyserver.de/pks/lookup?search=0x899093AC&op=get
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (MingW32)

iEYEARECAAYFAlPg8bwACgkQ7DlmxomQk6yEvQCgp/fWL/KZfGUFJ/kcyYPl0Ivs
ABQAoLEfUc8wEoK7qjWZDWRXgjKVpw0U
=nPS2
-----END PGP SIGNATURE-----
list Rodney Simioni · Tue, 5 Aug 2014 15:56:06 +0000 ·
For now, I just want to test the Hobbit Server, so my bb-hosts has:

127.0.0.1       MonitoringServer #bbd ssh test

This is what I see in the test.log, please advise:

2014-08-05 11:53:25 Could not connect to bbd at 127.0.0.1:1984 - Connection refused
2014-08-05 11:53:25 Whoops ! bb failed to send message - Connection failed
quoted from Torsten Richter

From: Torsten Richter [user-c862b499d9fa@xymon.invalid]
Sent: Tuesday, August 05, 2014 10:01 AM
To: Simioni, Rodney; xymon at xymon.com
Subject: Re: [Xymon] external script not working

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi Rodney,

if I understand you correctly , then you run your script on the Hobbit
Server, right?
Then you should see a green dot on the line where your server is with
the name test.
And if you do, then your script is working fine.
If not, then please have a look at test.log and check for any unusual
messages regarding your script.

BUT(!) if you want your script to display the green dot named test on
the lines of server1 and server2 then you have to copy it to the clients
and run it from there.

In both cases there is no need of specifying the keyword test in bb-hosts.

If your script is already on the clients server1 and server2 and you
made the entries on the clients in hobbitlaunch.cfg then the problem
might be that your clients do not have a hobbitd running.

HTH
Torsten

On 05.08.2014 15:30, Simioni, Rodney wrote:
My custom script is not reporting anything to the Hobbit Server. I'm running this script on the Hobbit server.

I have placed my script in /usr/lib/hobbit/server/ext/b.pl. The script basically does nothing but report green:

#!/usr/bin/perl -w
use strict;

# Xymon Variables
#$ENV{BBPROG}    = "b.pl";
my($TESTNAME)   = "test";
my($BBHOME)     = $ENV{BBHOME};
my($BB)         = $ENV{BB};
my($BBDISP)     = $ENV{BBDISP};
my($BBVAR)      = $ENV{BBVAR};
my($MACHINE)    = $ENV{MACHINE};
my($DATE)       = localtime;
my($COLOR)      = "green";
my($MSG)        = "";
my($HEAD)       = "";
my($DATA)       = "";

print "$MACHINE\n";
$MACHINE =~ s/\./,/g;
      my($cmd) = "$BB $BBDISP \"status $MACHINE.$TESTNAME $COLOR $DATE $HEAD\n$DATA\n$MSG\"";
      system($cmd);


I put the following lines in the  /etc/hobbit/hobbitlaunch.cfg
[test]
        ENVFILE /usr/lib/hobbit/server/etc/hobbitserver.cfg
        NEEDS hobbitd
        CMD /usr/lib/hobbit/server/ext/b.pl
        LOGFILE $BBSERVERLOGS/test.log
        INTERVAL 5m

I have put 'test' in the bb-hosts file:
subpage vips VIPS
xxx.xxx.xxx.xxx   server1 #test
xxx.xxx.xxx.xxx  server2 #test


Any help will be greatly appreciated.

Rod

- --
+---------------------------------------------------------+
| E-mail  : user-c862b499d9fa@xymon.invalid                       |
|                                                         |
| Homepage: http://www.richter-it.net/                    |
+---------------------------------------------------------+
Download my public key from:
http://gpg-keyserver.de/pks/lookup?search=0x899093AC&op=get
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (MingW32)

iEYEARECAAYFAlPg8bwACgkQ7DlmxomQk6yEvQCgp/fWL/KZfGUFJ/kcyYPl0Ivs
ABQAoLEfUc8wEoK7qjWZDWRXgjKVpw0U
=nPS2
-----END PGP SIGNATURE-----
list Torsten Richter · Wed, 06 Aug 2014 11:17:13 +0200 ·
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi Rod,

there is no hobbitd listening on port 1984 on your localhost.
Which normally means that the server is not running.
If you do a netstat -an|grep LISTEN then you should normally see
something like this:

tcp        0  0 0.0.0.0:1984     0.0.0.0:*               LISTEN

This means the hobbit server is up and running.
Otherwise you have to start it.
If you already tried to start it then maybe $BBSERVERLOGS/hobbitd.log
and/or $BBSERVERLOGS/hobbitlaunch.log can give you some hint what went
wrong.

Cheers
Torsten
quoted from Rodney Simioni

On 05.08.2014 17:56, Simioni, Rodney wrote:
For now, I just want to test the Hobbit Server, so my bb-hosts has:

127.0.0.1       MonitoringServer #bbd ssh test

This is what I see in the test.log, please advise:

2014-08-05 11:53:25 Could not connect to bbd at 127.0.0.1:1984 - Connection refused
2014-08-05 11:53:25 Whoops ! bb failed to send message - Connection failed

From: Torsten Richter [user-c862b499d9fa@xymon.invalid]
Sent: Tuesday, August 05, 2014 10:01 AM
To: Simioni, Rodney; xymon at xymon.com
Subject: Re: [Xymon] external script not working

Hi Rodney,

if I understand you correctly , then you run your script on the Hobbit
Server, right?
Then you should see a green dot on the line where your server is with
the name test.
And if you do, then your script is working fine.
If not, then please have a look at test.log and check for any unusual
messages regarding your script.

BUT(!) if you want your script to display the green dot named test on
the lines of server1 and server2 then you have to copy it to the clients
and run it from there.

In both cases there is no need of specifying the keyword test in bb-hosts.

If your script is already on the clients server1 and server2 and you
made the entries on the clients in hobbitlaunch.cfg then the problem
might be that your clients do not have a hobbitd running.

HTH
Torsten

On 05.08.2014 15:30, Simioni, Rodney wrote:
My custom script is not reporting anything to the Hobbit Server. I'm running this script on the Hobbit server.
I have placed my script in /usr/lib/hobbit/server/ext/b.pl. The script basically does nothing but report green:
#!/usr/bin/perl -w
use strict;
# Xymon Variables
#$ENV{BBPROG}    = "b.pl";
my($TESTNAME)   = "test";
my($BBHOME)     = $ENV{BBHOME};
my($BB)         = $ENV{BB};
my($BBDISP)     = $ENV{BBDISP};
my($BBVAR)      = $ENV{BBVAR};
my($MACHINE)    = $ENV{MACHINE};
my($DATE)       = localtime;
my($COLOR)      = "green";
my($MSG)        = "";
my($HEAD)       = "";
my($DATA)       = "";
print "$MACHINE\n";
$MACHINE =~ s/\./,/g;
      my($cmd) = "$BB $BBDISP \"status $MACHINE.$TESTNAME $COLOR $DATE $HEAD\n$DATA\n$MSG\"";
      system($cmd);
I put the following lines in the  /etc/hobbit/hobbitlaunch.cfg
[test]
        ENVFILE /usr/lib/hobbit/server/etc/hobbitserver.cfg
        NEEDS hobbitd
        CMD /usr/lib/hobbit/server/ext/b.pl
        LOGFILE $BBSERVERLOGS/test.log
        INTERVAL 5m
I have put 'test' in the bb-hosts file:
subpage vips VIPS
xxx.xxx.xxx.xxx   server1 #test
xxx.xxx.xxx.xxx  server2 #test
Any help will be greatly appreciated.
Rod
- -- 
+---------------------------------------------------------+
| E-mail  : user-c862b499d9fa@xymon.invalid			  |
|							  |
| Homepage: http://www.richter-it.net/			  |
+---------------------------------------------------------+
Download my public key from:
http://gpg-keyserver.de/pks/lookup?search=0x899093AC&op=get
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (MingW32)

iEYEARECAAYFAlPh8pkACgkQ7DlmxomQk6xVTgCeMpUGk5uy4tIyNVBRtcHA4x1d
HjMAoOFXNresa0YJTj65bX+tsJgTDKXI
=lrI2
-----END PGP SIGNATURE-----