Thanks for pointing that out yes it was the extra verboseness I missed
seeing it was what I asked for,

 

Now I just need to have it not alert for the other events

 

From: [email protected]
[mailto:[email protected]] On Behalf Of Jon
Sent: 05 October 2011 16:44
To: This is the general mailing list for monit
Subject: Re: restart after cycles

 

Looks like what you want to me. I'm not sure why it throws that "else if
succeeded" line at the end of each statement. Perhaps someone else can
answer that one, but it shows 2 restarts and 2 alerts. You can still add an
"If 3 restarts within 6 cycles then timeout" so it doesn't continually
attempt to restart the process and keep failing.

 <http://www.Konasports.com> 
 <mailto:[email protected]> [email protected] 
Toll Free: 866-858-5864 
 <http://www.konasports.com> www.Konasports.com 


On 10/5/2011 11:22 AM, Mark Olliver wrote: 

 

Well it would appear I am partly getting what I want but I am not sure if
the webpage is reporting correctly as it is saying alert on lines 2 & 4 but
they should be restarts not alert, Is that a display bug or a config error?

 

Also I don't want to alert on all events including pid or ppid changes so do
I just need to include a NOALERT global setting?

 


Port

If failed [localhost:5432 [PGSQL via TCP] with timeout 5 seconds and retry 0
time(s)] 3 times within 3 cycle(s) then alert else if succeeded 1 times
within 1 cycle(s) then alert


Port

If failed [localhost:5432 [PGSQL via TCP] with timeout 5 seconds and retry 2
time(s)] 2 times within 2 cycle(s) then restart else if succeeded 1 times
within 1 cycle(s) then alert


Unix Socket

If failed [/var/run/postgresql/.s.PGSQL.5432 [PGSQL] with timeout 5s and
retry 0 time(s)] 3 times within 3 cycle(s) then alert else if succeeded 1
times within 1 cycle(s) then alert


Unix Socket

If failed [/var/run/postgresql/.s.PGSQL.5432 [PGSQL] with timeout 5s and
retry 2 time(s)] 2 times within 2 cycle(s) then restart else if succeeded 1
times within 1 cycle(s) then alert


Pid

If changed 1 times within 1 cycle(s) then alert


Ppid

If changed 1 times within 1 cycle(s) then alert


Alert mail to

[email protected]


Alert on

All events

 

 

check process postgresql with pidfile /var/run/postgresql/8.4-main.pid

    start program = "/etc/init.d/postgresql-8.4 start"

    stop  program = "/etc/init.d/postgresql-8.4 stop"

    if failed unixsocket /var/run/postgresql/.s.PGSQL.5432 protocol pgsql
retry 2 2 cycles then restart

    if failed unixsocket /var/run/postgresql/.s.PGSQL.5432 protocol pgsql 3
cycles then alert

    if failed host localhost port 5432 protocol pgsql retry 2 2 cycles then
restart

    if failed host localhost port 5432 protocol pgsql 3 cycles then alert

    alert [email protected]

    group database

 

 

Thanks

 

Mark






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






No virus found in this message.
Checked by AVG - www.avg.com
Version: 2012.0.1809 / Virus Database: 2085/4537 - Release Date: 10/04/11

<<image001.jpg>>

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

Reply via email to