monit-general
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Can I use dollar sign in paths in monit config file?


From: Sergio Trejo
Subject: Re: Can I use dollar sign in paths in monit config file?
Date: Wed, 20 Jun 2007 20:45:46 -1000


On 6/20/07, Jan-Henrik Haukeland <address@hidden> wrote:
On 21. jun. 2007, at 07.53, Sergio Trejo wrote:

> I was wondering why it is illegal (according to monit when I run it
> on the command line with the -t (syntax check) option) to preface a
> path with $HOME, such as:
>
> set logfile $HOME/monit/my.log
>
> I guess monit doesn't parse $HOME and expand shell variables such
> as $HOME?

No monit does not expand shell variables in monitrc and as a reminder
does not allow $ in path names. Looks to me, a useful feature to add
or did we have this discussion before? I seem to recall we discussed
this and decided against.

> Any suggestions or work arounds?

Instead of $HOME/monit/my.log write for instance /home/sergtrejo/
monit/my.log :-)

If you absolutely must use shell variables, preprocess monitrc for
instance using something like

perl -pi -e 's,\$HOME,'$HOME',' .monitrc


Jan-Henrik


Thanks for clarifying this. I can write a simple Ruby script to pre-process quite easy.

Cheers,

Serg 

--
To unsubscribe:
http://lists.nongnu.org/mailman/listinfo/monit-general


reply via email to

[Prev in Thread] Current Thread [Next in Thread]