monit-general
[Top][All Lists]
Advanced

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

Re: [monit] noob question


From: Eric Pailleau
Subject: Re: [monit] noob question
Date: Wed, 28 Apr 2010 18:03:38 +0200
User-agent: Thunderbird 2.0.0.23 (X11/20090822)

no,

in such case do :
---8<-----------------------------------------------------------
check process pppd with pidfile /var/run/ppp0.pid
 start program = "/usr/bin/pon dsl-provider"
 stop  program = "/usr/bin/poff dsl-provider"
 if failed host www.google.com port 80 protocol http and request "/" for 2 
cycles
 then restart
---8<-----------------------------------------------------------

or

---8<-----------------------------------------------------------
# check pppd
check process pppd with pidfile /var/run/ppp0.pid
 start program = "/usr/bin/pon dsl-provider"
 stop  program = "/usr/bin/poff dsl-provider"

# internet test
check host internet with address www.google.fr
    if failed icmp type echo count 5 with timeout 30 seconds
        then exec "/usr/bin/killall pppd"
---8<-----------------------------------------------------------
If pppd is killed, monit will see than ppp0.pid does not relate to a living 
process,
and will start (and not restart) the pppd.

or
---8<-----------------------------------------------------------
# check pppd
check process pppd with pidfile /var/run/ppp0.pid
 start program = "/usr/bin/pon dsl-provider"
 stop  program = "/usr/bin/poff dsl-provider"
 depends on internet

# internet test
check host internet with address www.google.fr
    if failed icmp type echo count 5 with timeout 30 seconds
        then alert

---8<-----------------------------------------------------------

2nd and 3rd can let you use 'internet' for another dependance to another monit 
definitions.


Thank you Eric, so if I put together what you suggest together with what Philippe presented then I get the following

check process pppd with pidfile /var/run/ppp0.pid
start program = "/usr/bin/pon dsl-provider"
stop  program = "/usr/bin/poff dsl-provider"
if failed host www.google.com port 80 protocol http and request "/" for 2 cycles
    then exec "/usr/bin/killall pppd"


Is that right or would this just kill a stalled program? What I am asking is would it then start again? (sorry to be so basic but I am on a learning curve here)



On 04/28/2010 10:38 PM, Eric Pailleau wrote:
    if failed icmp type echo count 5 with timeout 30 seconds
        then exec "/bin/rm -f /var/run/ppp0.pid"

(if deleting of pid file is sufficient to let the pppd daemon suiciding...
if not, prefere a "/usr/bin/killall pppd" )

------------------------------------------------------------------------

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


--
Salutations - Best regards - mit freundlichen Grüssen

----------------- address@hidden ------------------------------------
fr - Merci d'utiliser cette addresse pour le support ou question technique
en - Please use this address for any support or technical question
----------------- https://support.numlog.fr --------------------------------
fr - Privilégier la gestion de ticket d'incident  (Clients NUMLOG)
en - Prefere our trouble ticket application   (NUMLOG's customers)





reply via email to

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