monit-general
[Top][All Lists]
Advanced

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

Re: Terminal Batch doesn't work always


From: Lutz Mader
Subject: Re: Terminal Batch doesn't work always
Date: Tue, 27 Mar 2018 15:42:07 +0200
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:31.0) Gecko/20100101 Thunderbird/31.6.0

Hello Martin,
thanks or your suggestion to strip the ANSI escape codes.

I'm not aware that the ANSI codes set on the server side all the time an
stripped by the monit CLI in the batch mode. Nice to know someone try to
make the color handling more easy.

With regards,
I'm happy,
Lutz

p.s.
Someone should make the xml-format for the _summary available also.


Am 23.03.18 um 21:45 schrieb address@hidden:
> Hello Lutz,
> 
> the color (ANSI escape sequence) is set on server-side and stripped by monit 
> CLI if in batch mode. If you use curl to fetch the status in txt format 
> directly, you need to strip the escape sequence yourselves, for example:
> 
>       curl http://127.0.0.1:2812/_status <http://127.0.0.1:2812/_status> | 
> sed -r "s/\x1B\[([0-9]{1,2}(;[0-9]{1,2})?)?[m|K]//g"
> 
> We'll simplify the color handling in the future release.
> 
> Best regards,
> Martin
> 
> 
> 
> 
>> On 23 Mar 2018, at 14:19, Lutz Mader <address@hidden> wrote:
>>
>> Hello Tildeslash,
>> I try to gather the Service status summary via a curl request from an
>> other/remote monit system to use the status in a local monit check
>> program script.
>>
>> curl 'http://admin:address@hidden:2812/_summary?format=xml'
>> or
>> curl 'http://admin:address@hidden:2812/_summary?format=text'
>>
>> Unfortunately, I got the output in the terminal output format only.
>>
>> I try to disable tabular output and colours completely in the monitrc
>> used by monit.
>>
>> set terminal batch
>>
>> Nothing was happened, I got the terminal text format with tabular output
>> and colours. But the tabular and colours are removed from the local
>> monit command output (the monit daemon was restarted), the set terminal
>> batch mode seems to be used (handled like -B).
>>
>> My question is this the normal behaviour?
>> How to get text only or xml output via curl for _summary?
>>
>> With _status and format xml I got xml output, but many other
>> informations also. And with format text I got the coloured output as well.
>>
>> Thanks for any help or suggestion,
>> Lutz
>>
>> p.s.
>> I use Monit 5.25.1 and 5.22.0, 5.19.0.
>>
>> -- 
>> To unsubscribe:
>> https://lists.nongnu.org/mailman/listinfo/monit-general
> 
> 
> 
> 




reply via email to

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