monit-general
[Top][All Lists]
Advanced

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

Re: Monit does not start flxlm


From: Martin Pala
Subject: Re: Monit does not start flxlm
Date: Tue, 3 Sep 2013 19:06:15 +0200

Hi,

monit runs the start/stop programs in a sandbox and strips all environment 
variables (for security reasons) - it sets only the spartan path: 
"PATH=/bin:/usr/bin:/sbin:/usr/sbin"

If your script depends on some environment variable, it may fail when executed 
by monit. You can log the script output by wrapping it like this:

        start program = "/bin/bash -c '/sbin/service flexlm start >> 
/tmp/flexlm_start.log 2>&1'"

You can also pass the variables in the bash command or create some wrapper 
which will set the variables and call start.


Regards,
Martin




On Sep 3, 2013, at 6:58 PM, "Hearns, John" <address@hidden> wrote:

> 
> 
> I am using Monit to monitor and restart if necessary some Flexlm licensing 
> servers.
>  
> I am checking if port 1999 is open on a remote server, and restarting f 
> necessary.
> The snippet is:
>  
>  
> check host license3 with address 1.2.3.4
>  
> start program = "/usr/bin/ssh  license3 /sbin/service flexlm start"  with 
> timeout 20 seconds
> stop  program = "/usr/bin/ssh  license3 /sbin/service license stop"   with 
> timeout 20 seconds
>      if failed port 1999 type tcp with timeout 5 seconds then restart
>  
> If I stop the license server Monit will detect this, and I can see that the 
> stop then start command is run.
> The frustrating thing is that the Flexlm server immediately dies.
>  
> I can start the license server OK when running that ssh command fromt he 
> command line.
>  
> If I install monit locally on the license server license3 and use
>  
> start program = “/sbin/service flexlm start”
>  
> I get the same thing, ie the command line works, but when Monit runs the 
> command it does not.
>  
> Am I barking up a wrong tree here – does Monit always require a PID for a 
> process, even though all I want to do is monitor a port?
>  
>  
>  
> Dr John Hearns | McLaren Racing Limited
> McLaren Technology Centre, Chertsey Road, Woking, Surrey GU21 4YH, UK
> 
> T:  +44 (0) 1483 262000
> D:  +44 (0) 1483 262352
> F:  +44 (0) 1483 261928 
> E:  address@hidden
> W: www.mclaren.com
>  
> 
> 
> The contents of this e-mail are confidential and for the exclusive use of the 
> intended recipient. If you are not the intended recipient you should not 
> read, copy, retransmit or disclose its contents. If you have received this 
> email in error please delete it from your system immediately and notify us 
> either by email or telephone. The views expressed in this communication may 
> not necessarily be the views held by McLaren Racing Limited. 
> McLaren Racing Limited | McLaren Technology Centre | Chertsey Road | Woking | 
> Surrey | GU21 4YH | UK | Company Number: 01517478 --
> To unsubscribe:
> https://lists.nongnu.org/mailman/listinfo/monit-general




reply via email to

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