Am Tue, 7 Oct 2025 10:21:45 +0200
schrieb Gerrit Kühn <[email protected]>:


Looks like I missed trying the most simple solution: Just putting in an
additional set of quotes (-T "opta optb") on the config line turns out to
work just fine. Monit's config parser obviously just removes the outer
pair of quotes around the "path" setting and happily continues with the
rest. All my tries to clevery escape the inner quotes were needless. ;-)


cu
  Gerrit


> Hello,
> 
> I need monit to execute and check the result of a script on a remote host
> via ssh. What works for me right now is something like this:
> 
> check program mycheck with path "/usr/bin/ssh [email protected]
> '/home/myuser/myscripts/mycheck.sh -a 4.5 myserver'"
> 
> However, now I need to add another option for the script: -T.
> Unfortunately, this requires multiple strings separated by space. On the
> commandline this would be something like
> /usr/bin/ssh [email protected] '/home/myuser/myscripts/arc_check.sh -T
> "opta optb" -a 4.5 myserver'
> 
> However, I cannot figure out how to the the additional quotes around
> "opta optb" into the monit config line. Everything I tried so far fails
> either parsing on the monit side, or on the remote shell side, or simply
> does create the intended commandline on the remote side?
> 
> Is there a solution for this? I know the recommended solution would
> probably be to come up with a custom script for monit to call. However, I
> need this kind of test very often with varying options, and setting up a
> separate script for each test is not really a good solution, either.
> 
> 
> cu
>   Gerrit

Attachment: smime.p7s
Description: S/MIME cryptographic signature

Reply via email to