Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have written a script in monit interface for Webmin service. I can execute the process wherien I am unable to restart the service.

check process webmin with pidfile /var/webmin/miniserv.pid start = "/etc/init.d /webmin start"
stop = "/etc/init.d /webmin stop" if failed host in1.miracletel.com port 10000 then restart if 5 restarts within 5 cycles then timeout #if changed pid 2 times within 2 cycles then aler

Would you please look into this and let me know, whether I can considered the service correct or not?

share|improve this question
    
select your code and apply the code option to it. will look better. –  marc.riera Nov 23 '10 at 11:36
add comment

2 Answers 2

Looks a little different from mine:

   root@wl183004:/home/marc.riera/scripts/admin/trunk/src/bin# cat ../etc/monit/conf.d/apache.conf 
   check process apache with pidfile /var/run/apache2.pid
   group www-data
   start program = "/etc/init.d/apache2 start"
   stop program  = "/etc/init.d/apache2 stop"
   if failed host server.org port 80 protocol http
      and request "/monit/token" then restart
   if cpu is greater than 60% for 2 cycles then alert
   if cpu > 80% for 5 cycles then restart
   if totalmem > 500 MB for 5 cycles then restart
   if children > 250 then restart
   if loadavg(5min) greater than 10 for 8 cycles then stop
   if 3 restarts within 5 cycles then timeout

may be "start program" instead of only "start"??

share|improve this answer
    
I have tired working on start program, but the status show as "Execution failed". –  Nagaraj Nov 23 '10 at 11:53
    
I just wanted to know, what are all the process can be done in Monit, could you please confirm –  Nagaraj Nov 23 '10 at 13:38
add comment

My /etc/monit.d/webmin.monit.conf

Note these directories apply to CentOS (5.8, i686/32 bit) w/ Webmin 1.580. Change according to your system &, as always, YMMV.

check process webmin with pidfile /var/webmin/miniserv.pid 
   group webmin
   start program = "/etc/init.d/webmin start"
   stop  program = "/etc/init.d/webmin stop"
   if failed host localhost port 10000 then restart
   if failed host localhost port 10000 then restart
   if 5 restarts within 5 cycles then timeout
   if 5 restarts within 5 cycles then alert

check file webmin_rc with path /etc/init.d/webmin
   group webmin
   if failed checksum then unmonitor
   if failed permission 755 then unmonitor
   if failed uid root then unmonitor
   if failed gid root then unmonitor
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.