Xymon Mailing List Archive search

Slightly OT: External Perl Script

8 messages in this thread

list Robert Taylor · Wed, 1 Mar 2006 09:24:03 -0500 ·
All,

This may be slightly off topic, but I figured that there is someone here
that can help.  Over the past weekend I wrote my first Perl script to
replace a number of aging shell scripts that I had.  What I have done is
written Perl scripts to query Liebert UPS systems, Netbotz environment
monitors and Juniper SSL VPN appliances.  Needless to say I am now a
believer in how much faster Perl is than shell.  My scripts dropped from
about almost two minutes to run to 8 seconds.

I can see all of the output when I print to screen so I know that it is
polling everything okay.  The problem that I am having is getting Perl
to send this data to Hobbit.  It is just a formatting issue as I can
have it send plain text fine, but I am trying to send HTML to create
nice looking status pages.  I have looked at previous scripts, but they
all use the BigBrother.pm module and I would like to get this working
without that.  I am by no means a programmer but this problem is going
to bother me until I can get it working.

Perhaps someone could provide just a bit of Perl guidance?  The portion
of the code that I think it is getting hung up on is the colons in the
HTML, but I am not sure.

sub sendupdates {

$msg = <<EOM;
<html><body><center>
<!-- Created with Version 3 of the Liebert Test Script-->
<table border=\"0\" align=\"center\" id=\"table1\"
 style=\"height: 197px; width: 649px;\">
  <tbody>
    <tr>
      <th align=\"center\">
      <hr width=\"100%\"></th>
    </tr>

< snip other HTML >

</center>
</body>
</html>

EOM

my $now = localtime($^T) . "\n";

if ($debug eq "yes"){
        print "------------------- Time Stamp --------------------\n";
        print "Time Stamp: $now\n";
        print "------------------- HTML Output -------------------\n";
        print $msg;
}


system("$bb $bbhost \"status ${bbhostname}.ups $color $now ${msg}\"");


}


The error messages that our output to the screen give the following:

bb: incorrect number of arguments
Format: <IP-ADDR> <DATA>
sh: line 5: width:: command not found
sh: line 13: >

then there are also a lot of the following messages:

sh: line 14: > </div>
      <table id=table2 style=width:: No such file or directory
sh: line 14: height:: command not found
sh: line 17: >
        <tbody>
          <tr>
            <th width=267style=font-weight:: command not found
sh: line 17: text-align:: command not found
sh: line 18: >Hostname:</th>


Thanks in advance for any help.

Robert Taylor
list Larry Sherman · Wed, 1 Mar 2006 09:41:28 -0500 ·
How about

 
$LINE = "status $hostname.ups $color $now - some Text if you want it
$msg";

system("/path/to/bb $bbhost \"$LINE\" &")

 
That's what I do
quoted from Robert Taylor

 
-----Original Message-----
From: Taylor, Robert [mailto:user-3e97fc7d80fd@xymon.invalid] 
Sent: Wednesday, March 01, 2006 9:24 AM
To: user-ae9b8668bcde@xymon.invalid
Subject: [hobbit] Slightly OT: External Perl Script

 
All,

 
This may be slightly off topic, but I figured that there is someone here

that can help.  Over the past weekend I wrote my first Perl script to

replace a number of aging shell scripts that I had.  What I have done is

written Perl scripts to query Liebert UPS systems, Netbotz environment

monitors and Juniper SSL VPN appliances.  Needless to say I am now a

believer in how much faster Perl is than shell.  My scripts dropped from

about almost two minutes to run to 8 seconds.

 
I can see all of the output when I print to screen so I know that it is

polling everything okay.  The problem that I am having is getting Perl

to send this data to Hobbit.  It is just a formatting issue as I can

have it send plain text fine, but I am trying to send HTML to create

nice looking status pages.  I have looked at previous scripts, but they

all use the BigBrother.pm module and I would like to get this working

without that.  I am by no means a programmer but this problem is going

to bother me until I can get it working.

 
Perhaps someone could provide just a bit of Perl guidance?  The portion

of the code that I think it is getting hung up on is the colons in the

HTML, but I am not sure.

 
sub sendupdates {

 
$msg = <<EOM;

<html><body><center>

<!-- Created with Version 3 of the Liebert Test Script-->

<table border=\"0\" align=\"center\" id=\"table1\"

 style=\"height: 197px; width: 649px;\">

  <tbody>

    <tr>

      <th align=\"center\">

      <hr width=\"100%\"></th>

    </tr>

 
< snip other HTML >

 
</center>

</body>

</html>

 
EOM

 
my $now = localtime($^T) . "\n";

 
if ($debug eq "yes"){

        print "------------------- Time Stamp --------------------\n";

        print "Time Stamp: $now\n";

        print "------------------- HTML Output -------------------\n";

        print $msg;

}

 
system("$bb $bbhost \"status ${bbhostname}.ups $color $now ${msg}\"");

 
}

 
The error messages that our output to the screen give the following:

 
bb: incorrect number of arguments

Format: <IP-ADDR> <DATA>

sh: line 5: width:: command not found

sh: line 13: >

 
then there are also a lot of the following messages:

 
sh: line 14: > </div>

      <table id=table2 style=width:: No such file or directory

sh: line 14: height:: command not found

sh: line 17: >

        <tbody>

          <tr>

            <th width=267style=font-weight:: command not found

sh: line 17: text-align:: command not found

sh: line 18: >Hostname:</th>

 
Thanks in advance for any help.

 
Robert Taylor 

 
*******************************************************************

• This e-mail is intended only for the addressee named above.
As this e-mail may contain confidential or privileged information,
if you are not the named addressee, you are not authorized
to retain, read, copy or disseminate this message or any part of
it.

*******************************************************************
*
list Rolf Schrittenlocher · Wed, 01 Mar 2006 15:42:24 +0100 ·
Hi,
quoted from Larry Sherman
All,

This may be slightly off topic, but I figured that there is someone here
that can help.  Over the past weekend I wrote my first Perl script to
replace a number of aging shell scripts that I had.  What I have done is
written Perl scripts to query Liebert UPS systems, Netbotz environment
monitors and Juniper SSL VPN appliances.  Needless to say I am now a
believer in how much faster Perl is than shell.  My scripts dropped from
about almost two minutes to run to 8 seconds.

I can see all of the output when I print to screen so I know that it is
polling everything okay.  The problem that I am having is getting Perl
to send this data to Hobbit.  It is just a formatting issue as I can
have it send plain text fine, but I am trying to send HTML to create
nice looking status pages.  I have looked at previous scripts, but they
all use the BigBrother.pm module and I would like to get this working
without that.  I am by no means a programmer but this problem is going
to bother me until I can get it working.

Perhaps someone could provide just a bit of Perl guidance?  The portion
of the code that I think it is getting hung up on is the colons in the
HTML, but I am not sure.

sub sendupdates {

$msg = <<EOM;
<html><body><center>
<!-- Created with Version 3 of the Liebert Test Script-->
<table border=\"0\" align=\"center\" id=\"table1\"
style=\"height: 197px; width: 649px;\">
 <tbody>
   <tr>
     <th align=\"center\">
     <hr width=\"100%\"></th>
   </tr>

< snip other HTML >

</center>
</body>
</html>

EOM

my $now = localtime($^T) . "\n";

if ($debug eq "yes"){
       print "------------------- Time Stamp --------------------\n";
       print "Time Stamp: $now\n";
       print "------------------- HTML Output -------------------\n";
       print $msg;
}


system("$bb $bbhost \"status ${bbhostname}.ups $color $now ${msg}\"");


}


The error messages that our output to the screen give the following:

bb: incorrect number of arguments
Format: <IP-ADDR> <DATA>
sh: line 5: width:: command not found
sh: line 13: >

 
I'm no perl guru, but it seems that the double quotes in your text 
aren't masked with escapes any more while your message is interpreted by 
the hobbit server. So hobbit doesn't know what to do with the rest and 
the shell tries to deal with the rest. Perhaps give that a try: replace 
all \" by \\\"

regards
Rolf
quoted from Larry Sherman
then there are also a lot of the following messages:

sh: line 14: > </div>
     <table id=table2 style=width:: No such file or directory
sh: line 14: height:: command not found
sh: line 17: >
       <tbody>
         <tr>
           <th width=267style=font-weight:: command not found
sh: line 17: text-align:: command not found
sh: line 18: >Hostname:</th>


Thanks in advance for any help.

Robert Taylor 

-- 

Mit freundlichen Gruessen
Rolf Schrittenlocher

HRZ/BDV, Senckenberganlage 31, 60054 Frankfurt 
Tel: (XX) XX - XXX XXXXX   Fax: (XX) XX - XXX XXXXX
LBS: user-1e39a1813094@xymon.invalid
Persoenlich: user-6ea8e907e200@xymon.invalid
list Larry Barber · Wed, 1 Mar 2006 08:44:58 -0600 ·
Looks like your shell is processing the html as a command, try enclosing it
in single quotes (') instead of double quotes, like this:

system("$bb $bbhost 'status ${bbhostname}.ups $color $now ${msg}'");

Thanks,
Larry Barber
quoted from Rolf Schrittenlocher

On 3/1/06, Taylor, Robert <user-3e97fc7d80fd@xymon.invalid> wrote:
All,

This may be slightly off topic, but I figured that there is someone here
that can help.  Over the past weekend I wrote my first Perl script to
replace a number of aging shell scripts that I had.  What I have done is
written Perl scripts to query Liebert UPS systems, Netbotz environment
monitors and Juniper SSL VPN appliances.  Needless to say I am now a
believer in how much faster Perl is than shell.  My scripts dropped from
about almost two minutes to run to 8 seconds.

I can see all of the output when I print to screen so I know that it is
polling everything okay.  The problem that I am having is getting Perl
to send this data to Hobbit.  It is just a formatting issue as I can
have it send plain text fine, but I am trying to send HTML to create
nice looking status pages.  I have looked at previous scripts, but they
all use the BigBrother.pm module and I would like to get this working
without that.  I am by no means a programmer but this problem is going
to bother me until I can get it working.

Perhaps someone could provide just a bit of Perl guidance?  The portion
of the code that I think it is getting hung up on is the colons in the
HTML, but I am not sure.

sub sendupdates {

$msg = <<EOM;
<html><body><center>
<!-- Created with Version 3 of the Liebert Test Script-->
<table border=\"0\" align=\"center\" id=\"table1\"
style=\"height: 197px; width: 649px;\">
  <tbody>
    <tr>
      <th align=\"center\">
      <hr width=\"100%\"></th>
    </tr>

< snip other HTML >

</center>
</body>
</html>

EOM

my $now = localtime($^T) . "\n";

if ($debug eq "yes"){
        print "------------------- Time Stamp --------------------\n";
        print "Time Stamp: $now\n";
        print "------------------- HTML Output -------------------\n";
        print $msg;
}


system("$bb $bbhost \"status ${bbhostname}.ups $color $now ${msg}\"");


}


The error messages that our output to the screen give the following:

bb: incorrect number of arguments
Format: <IP-ADDR> <DATA>
sh: line 5: width:: command not found
sh: line 13: >

then there are also a lot of the following messages:

sh: line 14: > </div>
      <table id=table2 style=width:: No such file or directory
sh: line 14: height:: command not found
sh: line 17: >
        <tbody>
          <tr>
            <th width=267style=font-weight:: command not found
sh: line 17: text-align:: command not found
sh: line 18: >Hostname:</th>


Thanks in advance for any help.

Robert Taylor

list Andy Farrior · Wed, 1 Mar 2006 10:22:33 -0600 ·
 
ARGH!  replied to the wrong person....   must drink more coffee....
 
 
that'd do it to.  I know his $msg had a bunch of quotes in it and was
killing the shell.
 
 
again, sorry about that.
 
andy
quoted from Larry Barber
 

From: Sherman, Larry, GCM [mailto:user-8d9629e8e9c7@xymon.invalid] 
Sent: Wednesday, March 01, 2006 8:41 AM
To: user-ae9b8668bcde@xymon.invalid
Subject: RE: [hobbit] Slightly OT: External Perl Script


How about

 
$LINE = "status $hostname.ups $color $now - some Text if you want it
$msg";

system("/path/to/bb $bbhost \"$LINE\" &")

 
That's what I do

 
-----Original Message-----
From: Taylor, Robert [mailto:user-3e97fc7d80fd@xymon.invalid] 
Sent: Wednesday, March 01, 2006 9:24 AM
To: user-ae9b8668bcde@xymon.invalid
Subject: [hobbit] Slightly OT: External Perl Script

 
All,

 
This may be slightly off topic, but I figured that there is someone here

that can help.  Over the past weekend I wrote my first Perl script to

replace a number of aging shell scripts that I had.  What I have done is

written Perl scripts to query Liebert UPS systems, Netbotz environment

monitors and Juniper SSL VPN appliances.  Needless to say I am now a

believer in how much faster Perl is than shell.  My scripts dropped from

about almost two minutes to run to 8 seconds.

 
I can see all of the output when I print to screen so I know that it is

polling everything okay.  The problem that I am having is getting Perl

to send this data to Hobbit.  It is just a formatting issue as I can

have it send plain text fine, but I am trying to send HTML to create

nice looking status pages.  I have looked at previous scripts, but they

all use the BigBrother.pm module and I would like to get this working

without that.  I am by no means a programmer but this problem is going

to bother me until I can get it working.

 
Perhaps someone could provide just a bit of Perl guidance?  The portion

of the code that I think it is getting hung up on is the colons in the

HTML, but I am not sure.

 
sub sendupdates {

 
$msg = <<EOM;

<html><body><center>

<!-- Created with Version 3 of the Liebert Test Script-->

<table border=\"0\" align=\"center\" id=\"table1\"

 style=\"height: 197px; width: 649px;\">

  <tbody>

    <tr>

      <th align=\"center\">

      <hr width=\"100%\"></th>

    </tr>

 
< snip other HTML >

 
</center>

</body>

</html>

 
EOM

 
my $now = localtime($^T) . "\n";

 
if ($debug eq "yes"){

        print "------------------- Time Stamp --------------------\n";

        print "Time Stamp: $now\n";

        print "------------------- HTML Output -------------------\n";

        print $msg;

}

 
system("$bb $bbhost \"status ${bbhostname}.ups $color $now ${msg}\"");

 
}

 
The error messages that our output to the screen give the following:

 
bb: incorrect number of arguments

Format: <IP-ADDR> <DATA>

sh: line 5: width:: command not found

sh: line 13: >

 
then there are also a lot of the following messages:

 
sh: line 14: > </div>

      <table id=table2 style=width:: No such file or directory

sh: line 14: height:: command not found

sh: line 17: >

        <tbody>

          <tr>

            <th width=267style=font-weight:: command not found

sh: line 17: text-align:: command not found

sh: line 18: >Hostname:</th>

 
Thanks in advance for any help.

 
Robert Taylor 

 
*******************************************************************
• This e-mail is intended only for the addressee named above.
As this e-mail may contain confidential or privileged information,
if you are not the named addressee, you are not authorized
to retain, read, copy or disseminate this message or any part of
it.

*******************************************************************
*
list Eric E *hs Schwimmer · Wed, 1 Mar 2006 13:02:16 -0500 ·
I've got a perl module that emulates the bb binary, if anybody
is interested.

-Eric 
quoted from Andy Farrior
-----Original Message-----
From: FARRIOR, Andy [mailto:user-ca324d8ab782@xymon.invalid] Sent: Wednesday, March 01, 2006 11:23 AM
To: user-ae9b8668bcde@xymon.invalid
Subject: RE: [hobbit] Slightly OT: External Perl Script

 ARGH!  replied to the wrong person....   must drink more coffee....
  that'd do it to.  I know his $msg had a bunch of quotes in it and was killing the shell.
  again, sorry about that.
 andy
 

From: Sherman, Larry, GCM [mailto:user-8d9629e8e9c7@xymon.invalid] Sent: Wednesday, March 01, 2006 8:41 AM
To: user-ae9b8668bcde@xymon.invalid
Subject: RE: [hobbit] Slightly OT: External Perl Script


How about

 
$LINE = "status $hostname.ups $color $now - some Text if you want it $msg";

system("/path/to/bb $bbhost \"$LINE\" &")

 
That's what I do

 
-----Original Message-----
From: Taylor, Robert [mailto:user-3e97fc7d80fd@xymon.invalid] Sent: Wednesday, March 01, 2006 9:24 AM
To: user-ae9b8668bcde@xymon.invalid
Subject: [hobbit] Slightly OT: External Perl Script

 
All,

 
This may be slightly off topic, but I figured that there is someone here

that can help.  Over the past weekend I wrote my first Perl script to

replace a number of aging shell scripts that I had.  What I have done is

written Perl scripts to query Liebert UPS systems, Netbotz environment

monitors and Juniper SSL VPN appliances.  Needless to say I am now a

believer in how much faster Perl is than shell.  My scripts dropped from

about almost two minutes to run to 8 seconds.

 
I can see all of the output when I print to screen so I know that it is

polling everything okay.  The problem that I am having is getting Perl

to send this data to Hobbit.  It is just a formatting issue as I can

have it send plain text fine, but I am trying to send HTML to create

nice looking status pages.  I have looked at previous scripts, but they

all use the BigBrother.pm module and I would like to get this working

without that.  I am by no means a programmer but this problem is going

to bother me until I can get it working.

 
Perhaps someone could provide just a bit of Perl guidance?  The portion

of the code that I think it is getting hung up on is the colons in the

HTML, but I am not sure.

 
sub sendupdates {

 
$msg = <<EOM;

<html><body><center>

<!-- Created with Version 3 of the Liebert Test Script-->

<table border=\"0\" align=\"center\" id=\"table1\"

 style=\"height: 197px; width: 649px;\">

  <tbody>

    <tr>

      <th align=\"center\">

      <hr width=\"100%\"></th>

    </tr>

 
< snip other HTML >

 
</center>

</body>

</html>

 
EOM

 
my $now = localtime($^T) . "\n";

 
if ($debug eq "yes"){

        print "------------------- Time Stamp --------------------\n";

        print "Time Stamp: $now\n";

        print "------------------- HTML Output -------------------\n";

        print $msg;

}

 
system("$bb $bbhost \"status ${bbhostname}.ups $color $now ${msg}\"");

 
}

 
The error messages that our output to the screen give the following:

 
bb: incorrect number of arguments

Format: <IP-ADDR> <DATA>

sh: line 5: width:: command not found

sh: line 13: >

 
then there are also a lot of the following messages:

 
sh: line 14: > </div>

      <table id=table2 style=width:: No such file or directory

sh: line 14: height:: command not found

sh: line 17: >

        <tbody>

          <tr>

            <th width=267style=font-weight:: command not found

sh: line 17: text-align:: command not found

sh: line 18: >Hostname:</th>

 
Thanks in advance for any help.

 
Robert Taylor 
 
 
*******************************************************************
• This e-mail is intended only for the addressee named above.
As this e-mail may contain confidential or privileged information,
if you are not the named addressee, you are not authorized
to retain, read, copy or disseminate this message or any part of
it.

*******************************************************************
*

list Charles Jones · Wed, 01 Mar 2006 12:44:31 -0700 ·
If it's short please post it, or a link to it. Isn't all that is needed 
is to make a TCP connection, or are you completely emulating all of the 
functions of the bb binary?

-Charles
quoted from Eric E *hs Schwimmer

Schwimmer, Eric E *HS wrote:
I've got a perl module that emulates the bb binary, if anybody
is interested.

-Eric 

 
-----Original Message-----
From: FARRIOR, Andy [mailto:user-ca324d8ab782@xymon.invalid] 
Sent: Wednesday, March 01, 2006 11:23 AM
To: user-ae9b8668bcde@xymon.invalid
Subject: RE: [hobbit] Slightly OT: External Perl Script


ARGH!  replied to the wrong person....   must drink more coffee....


that'd do it to.  I know his $msg had a bunch of quotes in it 
and was killing the shell.


again, sorry about that.

andy


From: Sherman, Larry, GCM [mailto:user-8d9629e8e9c7@xymon.invalid] 
Sent: Wednesday, March 01, 2006 8:41 AM
To: user-ae9b8668bcde@xymon.invalid
Subject: RE: [hobbit] Slightly OT: External Perl Script


How about


$LINE = "status $hostname.ups $color $now - some Text if you 
want it $msg";

system("/path/to/bb $bbhost \"$LINE\" &")


That's what I do


-----Original Message-----
From: Taylor, Robert [mailto:user-3e97fc7d80fd@xymon.invalid] 
Sent: Wednesday, March 01, 2006 9:24 AM
To: user-ae9b8668bcde@xymon.invalid
Subject: [hobbit] Slightly OT: External Perl Script


All,


This may be slightly off topic, but I figured that there is 
someone here

that can help.  Over the past weekend I wrote my first Perl script to

replace a number of aging shell scripts that I had.  What I 
have done is

written Perl scripts to query Liebert UPS systems, Netbotz environment

monitors and Juniper SSL VPN appliances.  Needless to say I am now a

believer in how much faster Perl is than shell.  My scripts 
dropped from

about almost two minutes to run to 8 seconds.


I can see all of the output when I print to screen so I know 
that it is

polling everything okay.  The problem that I am having is getting Perl

to send this data to Hobbit.  It is just a formatting issue as I can

have it send plain text fine, but I am trying to send HTML to create

nice looking status pages.  I have looked at previous 
scripts, but they

all use the BigBrother.pm module and I would like to get this working

without that.  I am by no means a programmer but this problem is going

to bother me until I can get it working.


Perhaps someone could provide just a bit of Perl guidance?  
The portion

of the code that I think it is getting hung up on is the colons in the

HTML, but I am not sure.


sub sendupdates {


$msg = <<EOM;

<html><body><center>

<!-- Created with Version 3 of the Liebert Test Script-->

<table border=\"0\" align=\"center\" id=\"table1\"

style=\"height: 197px; width: 649px;\">

 <tbody>

   <tr>

     <th align=\"center\">

     <hr width=\"100%\"></th>

   </tr>


< snip other HTML >


</center>

</body>

</html>


EOM


my $now = localtime($^T) . "\n";


if ($debug eq "yes"){

       print "------------------- Time Stamp --------------------\n";

       print "Time Stamp: $now\n";

       print "------------------- HTML Output -------------------\n";

       print $msg;

}


system("$bb $bbhost \"status ${bbhostname}.ups $color $now ${msg}\"");


}


The error messages that our output to the screen give the following:


bb: incorrect number of arguments

Format: <IP-ADDR> <DATA>

sh: line 5: width:: command not found

sh: line 13: >


then there are also a lot of the following messages:


sh: line 14: > </div>

     <table id=table2 style=width:: No such file or directory

sh: line 14: height:: command not found

sh: line 17: >

       <tbody>

         <tr>

           <th width=267style=font-weight:: command not found

sh: line 17: text-align:: command not found

sh: line 18: >Hostname:</th>


Thanks in advance for any help.


Robert Taylor 


*******************************************************************
• This e-mail is intended only for the addressee named above.
As this e-mail may contain confidential or privileged information,
if you are not the named addressee, you are not authorized
to retain, read, copy or disseminate this message or any part of
it.

*******************************************************************
*

list Eric E *hs Schwimmer · Wed, 1 Mar 2006 15:01:14 -0500 ·
It's 118 lines, it does open a TCP socket, strictly for message
sending, but it also does a little error handling and combo msging to make life easier on your bb server:

http://nerdvana.org/eric/files/bbmsg.pm

You could probably also send other commands (drop, rename, etc)
through it, but I havent tried, so caveat emptor :)

-Eric
quoted from Charles Jones
-----Original Message-----
From: Charles Jones [mailto:user-e86b4aeade4e@xymon.invalid] Sent: Wednesday, March 01, 2006 2:45 PM
To: user-ae9b8668bcde@xymon.invalid
Subject: Re: [hobbit] Slightly OT: External Perl Script

If it's short please post it, or a link to it. Isn't all that is needed is to make a TCP connection, or are you completely emulating all of the functions of the bb binary?

-Charles

Schwimmer, Eric E *HS wrote: 
	I've got a perl module that emulates the bb binary, if anybody
	is interested.
	
	-Eric 	
	  
		-----Original Message-----
		From: FARRIOR, Andy [mailto:user-ca324d8ab782@xymon.invalid] 		Sent: Wednesday, March 01, 2006 11:23 AM
		To: user-ae9b8668bcde@xymon.invalid
		Subject: RE: [hobbit] Slightly OT: External Perl Script
		
		 		ARGH!  replied to the wrong person....   must drink more coffee....
		 		 		that'd do it to.  I know his $msg had a bunch of quotes in it 		and was killing the shell.
		 		 		again, sorry about that.
		 		andy
		 		
		
		From: Sherman, Larry, GCM [mailto:user-8d9629e8e9c7@xymon.invalid] 		Sent: Wednesday, March 01, 2006 8:41 AM
		To: user-ae9b8668bcde@xymon.invalid
		Subject: RE: [hobbit] Slightly OT: External Perl Script
		
		
		How about
		
		 		
		$LINE = "status $hostname.ups $color $now - some Text if you 		want it $msg";
		
		system("/path/to/bb $bbhost \"$LINE\" &")
		
		 		
		That's what I do
		
		 		
		-----Original Message-----
		From: Taylor, Robert [mailto:user-3e97fc7d80fd@xymon.invalid] 		Sent: Wednesday, March 01, 2006 9:24 AM
		To: user-ae9b8668bcde@xymon.invalid
		Subject: [hobbit] Slightly OT: External Perl Script
		
		 		
		All,
		
		 		
		This may be slightly off topic, but I figured that there is 		someone here
		
		that can help.  Over the past weekend I wrote my first Perl script to
		
		replace a number of aging shell scripts that I had.  What I 		have done is
		
		written Perl scripts to query Liebert UPS systems, Netbotz environment
		
		monitors and Juniper SSL VPN appliances.  Needless to say I am now a
		
		believer in how much faster Perl is than shell.  My scripts 		dropped from
		
		about almost two minutes to run to 8 seconds.
		
		 		
		I can see all of the output when I print to screen so I know 		that it is
		
		polling everything okay.  The problem that I am having is getting Perl
		
		to send this data to Hobbit.  It is just a formatting issue as I can
		
		have it send plain text fine, but I am trying to send HTML to create
		
		nice looking status pages.  I have looked at previous 		scripts, but they
		
		all use the BigBrother.pm module and I would like to get this working
		
		without that.  I am by no means a programmer but this problem is going
		
		to bother me until I can get it working.
		
		 		
		Perhaps someone could provide just a bit of Perl guidance?  		The portion
		
		of the code that I think it is getting hung up on is the colons in the
		
		HTML, but I am not sure.
		
		 		
		sub sendupdates {
		
		 		
		$msg = <<EOM;
		
		<html><body><center>
		
		<!-- Created with Version 3 of the Liebert Test Script-->
		
		<table border=\"0\" align=\"center\" id=\"table1\"
		
		 style=\"height: 197px; width: 649px;\">
		
		  <tbody>
		
		    <tr>
		
		      <th align=\"center\">
		
		      <hr width=\"100%\"></th>
		
		    </tr>
		
		 		
		< snip other HTML >
		
		 		
		</center>
		
		</body>
		
		</html>
		
		 		
		EOM
		
		 		
		my $now = localtime($^T) . "\n";
		
		 		
		if ($debug eq "yes"){
		
		        print "------------------- Time Stamp --------------------\n";
		
		        print "Time Stamp: $now\n";
		
		        print "------------------- HTML Output -------------------\n";
		
		        print $msg;
		
		}
		
		 		
		system("$bb $bbhost \"status ${bbhostname}.ups $color $now ${msg}\"");
		
		 		
		}
		
		 		
		The error messages that our output to the screen give the following:
		
		 		
		bb: incorrect number of arguments
		
		Format: <IP-ADDR> <DATA>
		
		sh: line 5: width:: command not found
		
		sh: line 13: >
		
		 		
		then there are also a lot of the following messages:
		
		 		
		sh: line 14: > </div>
		
		      <table id=table2 style=width:: No such file or directory
		
		sh: line 14: height:: command not found
		
		sh: line 17: >
		
		        <tbody>
		
		          <tr>
		
		            <th width=267style=font-weight:: command not found
		
		sh: line 17: text-align:: command not found
		
		sh: line 18: >Hostname:</th>
		
		 		
		Thanks in advance for any help.
		
		 		
		Robert Taylor 		
		 		
		 		
*******************************************************************
		• This e-mail is intended only for the addressee named above.
		As this e-mail may contain confidential or privileged information,
		if you are not the named addressee, you are not authorized
		to retain, read, copy or disseminate this message or any part of
		it.
		
		
*******************************************************************
		*