[Top][All Lists]

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

Re: Unable to exec external script

From: Martin Pala
Subject: Re: Unable to exec external script
Date: Fri, 15 Dec 2006 14:53:38 +0100
User-agent: Thunderbird (Windows/20061025)

Dragan Zubac wrote:
Anyway,what am I trying to accomplish ?
Have a certain processes which doesn't genereate their own PID's,so wrote a little wrapper around them,no problem.The problem is how to configure monit to execute external shell script if some processes was restarted let's say 5 times in 2 cycles or so ? I don't want the alerts to be spam each time the process is restarted,but if there was N times in M cycles,execute some external script which should send me process's log file with explanation of restart reason ?

You can use the timestamp test on the pidfile which was created by your wrapper on precess startup/restart:

  check file myprocpid with path /var/run/
    if changed timestamp 2 times within 5 cycles then exec '...'

Second ones,is there a possibility to configure multiply mail formats for different process checks or something similar ? process-N send mail format-N or ? Or maybe different mail layout for different service tests ?

Yes, you can set the format per recipient (monit also provides macros for mail format which are expanded to the actual values):

  check process proc1 with pidfile /var/run/
    alert address@hidden with mail-format { subject: HELO }

  check process proc2 with pidfile /var/run/
    alert address@hidden with mail-format { subject: EHLO }


reply via email to

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