The "check program" is kind of test plugin - it runs the specified program, 
which is expected to perform a check and exit. Monit then evaluates the exit 
value (status). The "check program" is not suitable for executing the program 
such as /usr/bin/google-chrome which will keep running - for such programs the 
"check process" can be used (but the program must daemonize/detach itself and 
as mentioned if you use the pattern based check the pattern must be unique).

Regarding the "mode passive" ... works for me, please can you send a sample 
configuration file, which returns the syntax error?

Regards,
Martin


> On 11 Nov 2015, at 17:12, Joost Plas | Pandora Producties.nl 
> <[email protected]> wrote:
> 
> Unfortunately I cannot trust the number of processes, they don’t really tell 
> me something.
>  
> I think this technique will be better:
> 
> check program chrome with path /usr/bin/google-chrome
> if status!=0 then exec “/usr/bin/pkill chrome”
> 
> But what I don’t understand is why monit doesn’t restore/reset the status of 
> Chrome. It keeps saying ‘status failed’ for Chrome when I simulate a crash. 
> After I’ve restarted Chrome I think it should correct the status on the next 
> 2 minute interval check right? Unfortuantely this doesn’t work. It keeps 
> saying ‘status failed’ until I restart Monit.
> 
> Furthermore: does anyone have a idea why the ‘mode passive’ gives a syntax 
> error?
> 
> 
> Op 11 nov. 2015, om 17:10 heeft [email protected] 
> <mailto:[email protected]> het volgende geschreven:
> 
>> You are not allowed to post to this mailing list, and your message has
>> been automatically rejected.  If you think that your messages are
>> being rejected in error, contact the mailing list owner at
>> [email protected] <mailto:[email protected]>.
>> 
>> 
>> Van: Joost Plas | 1eRang Producties <[email protected] 
>> <mailto:[email protected]>>
>> Onderwerp: Antw.: Best practice to monitor google-chrome
>> Datum: 11 november 2015 17:07:56 CET
>> Aan: This is the general mailing list for monit <[email protected] 
>> <mailto:[email protected]>>
>> 
>> 
>> Unfortunately I cannot trust the number of processes, they don’t really tell 
>> me something.
>>  
>> I think this technique will be better:
>> 
>> check program chrome with path /usr/bin/google-chrome
>> if status!=0 then exec “/usr/bin/pkill chrome”
>> 
>> But what I don’t understand is why monit doesn’t restore/reset the status of 
>> Chrome. It keeps saying ‘status failed’ for Chrome when I simulate a crash. 
>> After I’ve restarted Chrome I think it should correct the status on the next 
>> 2 minute interval check right? Unfortuantely this doesn’t work. It keeps 
>> saying ‘status failed’ until I restart Monit.
>> 
>> Furthermore: does anyone have a idea why the ‘mode passive’ gives a syntax 
>> error?
>> 
>> 
>> Op 5 nov. 2015, om 17:23 heeft Martin Pala <[email protected] 
>> <mailto:[email protected]>> het volgende geschreven:
>> 
>>> The process check doesn't allow to count matching processes, in this case 
>>> you can use the "check program" with simple script, that will pgrep chrome 
>>> and return the processes count as exit value, so you can then use "if 
>>> status < 7 then alert"
>>> 
>>> Regards,
>>> Martin
>>> 
>>> 
>>>> On 05 Nov 2015, at 12:50, Joost Plas | Pandora Producties.nl 
>>>> <http://producties.nl/> <[email protected] 
>>>> <mailto:[email protected]>> wrote:
>>>> 
>>>> 
>>>> Hi Martin,
>>>> 
>>>> Thanks for the input. 
>>>> This indeed is listing a total of 7 matches. Any idea how to force a 
>>>> action of any of the 7 have a problem?
>>>> 
>>>> Any thoughts about option 1? How to fix the ‘recurring action’?
>>>> 
>>>> 
>>>> Op 4 nov. 2015, om 22:01 heeft Martin Pala <[email protected] 
>>>> <mailto:[email protected]>> het volgende geschreven:
>>>> 
>>>>> Using match based "check process" should be possible, but you need unique 
>>>>> pattern - if multiple processes match the pattern, monit will report that 
>>>>> the process is running.
>>>>> 
>>>>> You can test the pattern using:
>>>>> 
>>>>>   monit procmatch "chrome"
>>>>> 
>>>>> Regards,
>>>>> Martin
>>>>> 
>>>>> 
>>>>> 
>>>>>> On 04 Nov 2015, at 10:19, Joost Plas | Pandora Producties.nl 
>>>>>> <http://producties.nl/> <[email protected] 
>>>>>> <mailto:[email protected]>> wrote:
>>>>>> 
>>>>>> I’m looking for the best practice to monitor the health of Google 
>>>>>> Chrome. 
>>>>>> Am I right to understand that Chrome doesn’t have a PID file?
>>>>>> 
>>>>>> I’ve tried the following 2 techniques:
>>>>>> 
>>>>>> 1. 
>>>>>> check program chrome with path /usr/bin/google-chrome
>>>>>> if status!=0 then exec “/usr/bin/pkill chrome”
>>>>>> 
>>>>>> (I have a script that auto reboots chrome with the correct settings when 
>>>>>> I kill chrome).
>>>>>> This is sort of working when I simulate a crash (type in chrome://crash 
>>>>>> <chrome://crash> in browser). The problem is that it keeps killing 
>>>>>> chrome every time monit runs.
>>>>>> I think it doesn’t reset the last exit value? When I type ‘monit status’ 
>>>>>> it keeps saying ‘last exit value = 1’. How do I fix this? 
>>>>>> Also I keep getting errors in M/Monit ‘cannot open display’. I think 
>>>>>> this is because monit keeps trying to reopen chrome by itself. I thought 
>>>>>> I could fix this by adding ‘mode passive’ but this doesn’t seem to be 
>>>>>> allowed here because I get a syntax error.
>>>>>> 
>>>>>> 2. 
>>>>>> check process chrome matching “chrome”
>>>>>> 
>>>>>> The problem with this version is that nothing happens when I manually 
>>>>>> crash chrome. It keeps saying ‘status = Running’.
>>>>>> 
>>>>>> Hope someone can help me. I’m basically looking for the best technique 
>>>>>> to catch all possible issues with chrome. Thanks!
>>>>>> --
>>>>>> To unsubscribe:
>>>>>> https://lists.nongnu.org/mailman/listinfo/monit-general 
>>>>>> <https://lists.nongnu.org/mailman/listinfo/monit-general>
>>>>> 
>>>>> 
>>>>> --
>>>>> To unsubscribe:
>>>>> https://lists.nongnu.org/mailman/listinfo/monit-general 
>>>>> <https://lists.nongnu.org/mailman/listinfo/monit-general>
>>>> 
>>>> --
>>>> To unsubscribe:
>>>> https://lists.nongnu.org/mailman/listinfo/monit-general 
>>>> <https://lists.nongnu.org/mailman/listinfo/monit-general>
>>> --
>>> To unsubscribe:
>>> https://lists.nongnu.org/mailman/listinfo/monit-general 
>>> <https://lists.nongnu.org/mailman/listinfo/monit-general>
>> 
>> 
> 

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

Reply via email to