Xymon Mailing List Archive search

Issue with MAILC env variable?

5 messages in this thread

list Tom Moore · Wed, 9 Dec 2009 15:12:22 -0500 ·
I'm trying to use the -r option in "nail" to change the from address headers.  It works fine if I just have an email address, however if I use the (Name) nomenclature the hobbitd bombs with this error:

/usr/local/xymon/server/etc/hobbitserver.cfg: line 97: syntax error near unexpected token `('
/usr/local/xymon/server/etc/hobbitserver.cfg: line 97: `MAILC="/usr/bin/nail -r "user-4b9489cbb9ab@xymon.invalid (Xymon)""        

Env is this:
MAILC="/usr/bin/nail -r "user-4b9489cbb9ab@xymon.invalid (Xymon)""        
MAIL="$MAILC -s"

From the command line this works fine as well:

/usr/bin/nail -r "user-4b9489cbb9ab@xymon.invalid (Xymon)" user-fd45172e7876@xymon.invalid


Is there something in Xymon that is interpreting the parenthesis?  I've even tried to escape them with \ to no avail.

Thx,
Tom
list Tom Moore · Wed, 9 Dec 2009 16:57:30 -0500 ·
Actually.. I think I've narrowed it down to this in the hobbitlaunch.cfg file

        ENVFILE /usr/local/hobbit/server/etc/hobbitserver.cfg

When it's parsing that it gives the error for the MAILC option.  The server itself seems to send out emails fine with the syntax on alerts.
quoted from Tom Moore


-----Original Message-----
From: Tom Moore 
Sent: Wednesday, December 09, 2009 3:12 PM
To: 'user-ae9b8668bcde@xymon.invalid'
Subject: Issue with MAILC env variable?

I'm trying to use the -r option in "nail" to change the from address headers.  It works fine if I just have an email address, however if I use the (Name) nomenclature the hobbitd bombs with this error:

/usr/local/xymon/server/etc/hobbitserver.cfg: line 97: syntax error near unexpected token `('
/usr/local/xymon/server/etc/hobbitserver.cfg: line 97: `MAILC="/usr/bin/nail -r "user-4b9489cbb9ab@xymon.invalid (Xymon)""        

Env is this:
MAILC="/usr/bin/nail -r "user-4b9489cbb9ab@xymon.invalid (Xymon)""        
MAIL="$MAILC -s"

From the command line this works fine as well:

/usr/bin/nail -r "user-4b9489cbb9ab@xymon.invalid (Xymon)" user-fd45172e7876@xymon.invalid


Is there something in Xymon that is interpreting the parenthesis?  I've even tried to escape them with \ to no avail.

Thx,
Tom
list Tom Moore · Wed, 9 Dec 2009 17:27:03 -0500 ·
Resolved.  It turns out I have a bash script running from hobbitlaunch.cfg, and in bash parenthesis have a special meaning and thus it blows up when running the cmd:

. /usr/local/xymon/server/etc/hobbitserver.cfg

I changed the MAILC line to use single quotes such as:

MAILC="/usr/bin/nail -r 'user-4b9489cbb9ab@xymon.invalid (Xymon)'"        

And all is well.  Sorry for the email traffic, but hey, this will hit the archive and maybe help someone in the future ;)

-Tom
quoted from Tom Moore


-----Original Message-----
From: Tom Moore 
Sent: Wednesday, December 09, 2009 4:58 PM
To: Tom Moore; user-ae9b8668bcde@xymon.invalid
Subject: RE: Issue with MAILC env variable?

Actually.. I think I've narrowed it down to this in the hobbitlaunch.cfg file

        ENVFILE /usr/local/hobbit/server/etc/hobbitserver.cfg

When it's parsing that it gives the error for the MAILC option.  The server itself seems to send out emails fine with the syntax on alerts.


-----Original Message-----
From: Tom Moore 
Sent: Wednesday, December 09, 2009 3:12 PM
To: 'user-ae9b8668bcde@xymon.invalid'
Subject: Issue with MAILC env variable?

I'm trying to use the -r option in "nail" to change the from address headers.  It works fine if I just have an email address, however if I use the (Name) nomenclature the hobbitd bombs with this error:

/usr/local/xymon/server/etc/hobbitserver.cfg: line 97: syntax error near unexpected token `('
/usr/local/xymon/server/etc/hobbitserver.cfg: line 97: `MAILC="/usr/bin/nail -r "user-4b9489cbb9ab@xymon.invalid (Xymon)""        

Env is this:
MAILC="/usr/bin/nail -r "user-4b9489cbb9ab@xymon.invalid (Xymon)""        
MAIL="$MAILC -s"

From the command line this works fine as well:

/usr/bin/nail -r "user-4b9489cbb9ab@xymon.invalid (Xymon)" user-fd45172e7876@xymon.invalid


Is there something in Xymon that is interpreting the parenthesis?  I've even tried to escape them with \ to no avail.

Thx,
Tom
list Malcolm Hunter · Thu, 10 Dec 2009 02:46:11 +0100 ·
quoted from Tom Moore
Resolved.  It turns out I have a bash script running from
hobbitlaunch.cfg, and in bash parenthesis have a special meaning and thus it blows up when
running the cmd:

. /usr/local/xymon/server/etc/hobbitserver.cfg

I changed the MAILC line to use single quotes such as:

MAILC="/usr/bin/nail -r 'user-4b9489cbb9ab@xymon.invalid (Xymon)'"        

And all is well.  Sorry for the email traffic, but hey, this will hit the
archive and maybe help someone in the future ;)
I don't suppose you tried escaping the quotes?


MAILC="/usr/bin/nail -r \"user-4b9489cbb9ab@xymon.invalid (Xymon)\""

Regards,

Malcolm

-- 
Technical copy-editor & proofreader

KDE Proofreading Team
KDE British English Translation Team

http://l10n.kde.org/team-infos.php?teamcode=en_GB

Facebook: http://www.facebook.com/FriendlyAtheist

GRATIS für alle GMX-Mitglieder: Die maxdome Movie-FLAT!
Jetzt freischalten unter http://portal.gmx.net/de/go/maxdome01
list Tom Moore · Thu, 10 Dec 2009 08:35:53 -0500 ·
Yea that was the first thing I tried. Got errors as well.

On Dec 9, 2009, at 8:49 PM, "Malcolm Hunter"  
quoted from Malcolm Hunter
<user-b3e590ffeb6d@xymon.invalid> wrote:
Resolved.  It turns out I have a bash script running from
hobbitlaunch.cfg, and in bash parenthesis have a special meaning  
and thus it blows up when
running the cmd:

. /usr/local/xymon/server/etc/hobbitserver.cfg

I changed the MAILC line to use single quotes such as:

MAILC="/usr/bin/nail -r 'user-4b9489cbb9ab@xymon.invalid (Xymon)'"

And all is well.  Sorry for the email traffic, but hey, this will  
hit the
archive and maybe help someone in the future ;)
I don't suppose you tried escaping the quotes?


MAILC="/usr/bin/nail -r \"user-4b9489cbb9ab@xymon.invalid (Xymon)\""

Regards,

Malcolm

-- 
Technical copy-editor & proofreader

KDE Proofreading Team
KDE British English Translation Team

http://l10n.kde.org/team-infos.php?teamcode=en_GB

Facebook: http://www.facebook.com/FriendlyAtheist

GRATIS für alle GMX-Mitglieder: Die maxdome Movie-FLAT!
Jetzt freischalten unter http://portal.gmx.net/de/go/maxdome01