From Robert.Taylor@HendrickAuto.com Wed Jun 24 08:14:13 2026 From: Robert.Taylor@HendrickAuto.com To: xymon@xymon.com Subject: Slightly OT: External Perl Script Date: Wed, 01 Mar 2006 09:24:03 -0500 Message-ID: <58244622A4F3A04DBBF911ECBAF673A704218BDF@hagsv0040.hendrickauto.local> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============8231449681090713030==" --===============8231449681090713030== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit 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 = <
< snip other 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: sh: line 5: width:: command not found sh: line 13: > then there are also a lot of the following messages: sh: line 14: >

Thanks in advance for any help. Robert Taylor --===============8231449681090713030==-- From Schrittenlocher@rz.uni-frankfurt.de Wed Jun 24 08:14:13 2026 From: Schrittenlocher@rz.uni-frankfurt.de To: xymon@xymon.com Subject: [hobbit] Slightly OT: External Perl Script Date: Wed, 01 Mar 2006 15:42:24 +0100 Message-ID: <4405B2D0.3090301@rz.uni-frankfurt.de> In-Reply-To: <58244622A4F3A04DBBF911ECBAF673A704218BDF@hagsv0040.hendrickauto.local> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============5304799151173668069==" --===============5304799151173668069== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Hi, >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 = <
> >
Hostname:
style=\"height: 197px; width: 649px;\"> > > > > > >< snip other 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: >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 >then there are also a lot of the following messages: > >sh: line 14: > >
>
sh: line 14: height:: command not found >sh: line 17: > > > > > > >Thanks in advance for any help. > >Robert Taylor > > >To unsubscribe from the hobbit list, send an e-mail to >hobbit-unsubscribe at hswn.dk > > > > > -- Mit freundlichen Gruessen Rolf Schrittenlocher HRZ/BDV, Senckenberganlage 31, 60054 Frankfurt Tel: (49) 69 - 798 28908 Fax: (49) 69 - 798 28817 LBS: lbs-f at mlist.uni-frankfurt.de Persoenlich: schritte at rz.uni-frankfurt.de --===============5304799151173668069==-- From lebarber@gmail.com Wed Jun 24 08:14:13 2026 From: lebarber@gmail.com To: xymon@xymon.com Subject: [hobbit] Slightly OT: External Perl Script Date: Wed, 01 Mar 2006 08:44:58 -0600 Message-ID: <199afa060603010644l45320a38i101710ff032a991d@mail.gmail.com> In-Reply-To: <58244622A4F3A04DBBF911ECBAF673A704218BDF@hagsv0040.hendrickauto.local> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============2591228778106037324==" --===============2591228778106037324== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit 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 On 3/1/06, Taylor, Robert 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 = <
> >
sh: line 17: text-align:: command not found >sh: line 18: >Hostname:
style=\"height: 197px; width: 649px;\"> > > > > > > < snip other 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: > sh: line 5: width:: command not found > sh: line 13: > > > then there are also a lot of the following messages: > > sh: line 14: > >
>
sh: line 14: height:: command not found > sh: line 17: > > > > > > > Thanks in advance for any help. > > Robert Taylor > > > To unsubscribe from the hobbit list, send an e-mail to > hobbit-unsubscribe at hswn.dk > > > --===============2591228778106037324==--
sh: line 17: text-align:: command not found > sh: line 18: >Hostname: