Re: [monit 5.25.1] Question on quote escaping

[email protected]
Newsgroups gmane.comp.monitoring.monit.general
Message-ID <[email protected]>
Hello Vladimir!

For example the "hardware" parameters and the network environment of a  
virtual instance are monitored by a lot of one-liners contained in  
this script:
https://github.com/szepeviktor/debian-server-tools/blob/master/monitoring/monit/services/01-system_script

Then in monit service config they are executed as "Command Option1 Option2"
https://github.com/szepeviktor/debian-server-tools/blob/master/monitoring/monit/services/01-system

So you may combine them in 1 script with a huge switch/case statement.

С уважением,
Виктор


Quoting Vladimir Scherbinin <[email protected]>:

> Szervusz Viktor,
>
>   Thanks for your reply. I was afraid to hear exactly your answer. :)
>   The idea is that I was trying to avoid one-liner scripts, but it seems
> that there's no other choice unless someone would come up with the solution.
>
>   Thanks again.
>
>
> --
> Vladimir "vovin" Scherbinin.
> http://about.me/vovin
>
> On 5 February 2018 at 22:41, <[email protected]> wrote:
>
>> Quoting Vladimir Scherbinin <[email protected]>:
>>
>> Hi,
>>>
>>> I have the following check to monitor if all ntp servers configured are
>>> alive
>>>
>>> *check program ntpq*
>>> *  with path /bin/bash -c '/usr/bin/ntpq -4pn |tail -n +3 |awk '"'"'{
>>> print
>>> $3 }'"'"' |grep -q 16'*
>>> *  if status = 0 then alert*
>>>
>>> I'm using a shell quote escaping extensively to have ' and " in parallel.
>>>
>>
>> I think if you use anything other than "Command Option1 Option2" you
>> should write a shell/python script.



-- 
To unsubscribe:
https://lists.nongnu.org/mailman/listinfo/monit-general
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.