Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > Linux Forums > Server Operation

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Reply
 
Thread Tools Display Modes
  #11  
Old 18th August 2006, 23:00
nenad nenad is offline
Senior Member
 
Join Date: Nov 2005
Location: Novi Sad, Serbia
Posts: 415
Thanks: 13
Thanked 5 Times in 5 Posts
Default

Hi,

is it possible to increase timeout for http protocol from 5 to 15 sec.?
Code:
check process apache with pidfile /var/run/apache2.pid
   group www
   start program = "/etc/init.d/apache2 start"
   stop program  = "/etc/init.d/apache2 stop"
   if failed host www.web-hosting.co.yu 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 10 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
and is it possible to check apache localy without testing it through web acess ?
sometimes, internet connection where my server resides is under heavy load, so timeouts could be bigger than 5 sec. , and it causes unnecesery resrtarts of apache...
__________________
Nenad Bulatovic
---------------
Debian Lenny & ISPConfig 3

Last edited by nenad; 18th August 2006 at 23:02.
Reply With Quote
Sponsored Links
  #12  
Old 19th August 2006, 14:38
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,735 Times in 2,571 Posts
Default

Quote:
Originally Posted by nenad
Hi,

is it possible to increase timeout for http protocol from 5 to 15 sec.?
Which timeout?
Quote:
Originally Posted by nenad
Code:
check process apache with pidfile /var/run/apache2.pid
   group www
   start program = "/etc/init.d/apache2 start"
   stop program  = "/etc/init.d/apache2 stop"
   if failed host www.web-hosting.co.yu 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 10 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
and is it possible to check apache localy without testing it through web acess ?
Yes, use
Code:
check process apache with pidfile /var/run/apache2.pid
   group www
   start program = "/etc/init.d/apache2 start"
   stop program  = "/etc/init.d/apache2 stop"
   if failed host 127.0.0.1 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 10 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
then, but make sure that monit/token is in that webspace then.
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
  #13  
Old 19th August 2006, 16:49
nenad nenad is offline
Senior Member
 
Join Date: Nov 2005
Location: Novi Sad, Serbia
Posts: 415
Thanks: 13
Thanked 5 Times in 5 Posts
Default

Code:
Port: If failed 127.0.0.1:80 [DEFAULT] with timeout 5 seconds then restart else if recovered then alert
That timeout. I guess it is port timeout.


Isn't it enough just to use
Code:
if failed host 127.0.0.1 port 80 then restart
__________________
Nenad Bulatovic
---------------
Debian Lenny & ISPConfig 3

Last edited by nenad; 19th August 2006 at 16:58.
Reply With Quote
  #14  
Old 20th August 2006, 18:07
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,735 Times in 2,571 Posts
Default

Quote:
Originally Posted by nenad
That timeout. I guess it is port timeout.
What's in /etc/default/monit?


Quote:
Originally Posted by nenad
Isn't it enough just to use
Code:
if failed host 127.0.0.1 port 80 then restart
You can do that if you like.
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
  #15  
Old 20th August 2006, 20:23
nenad nenad is offline
Senior Member
 
Join Date: Nov 2005
Location: Novi Sad, Serbia
Posts: 415
Thanks: 13
Thanked 5 Times in 5 Posts
Default

Code:
# Defaults for monit initscript
# sourced by /etc/init.d/monit
# installed at /etc/default/monit by maintainer scripts
# Fredrik Steen <stone@debian.org>

# You must set this variable to for monit to start
startup=1

# To change the intervals which monit should run uncomment
# and change this variable.
CHECK_INTERVALS=60
/etc/default/monit
__________________
Nenad Bulatovic
---------------
Debian Lenny & ISPConfig 3
Reply With Quote
  #16  
Old 21st August 2006, 17:00
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,735 Times in 2,571 Posts
Default

Quote:
Originally Posted by nenad
That timeout. I guess it is port timeout.
I'm not quite sure how to change that, but you can have a look here: http://www.tildeslash.com/monit/doc/
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
  #17  
Old 6th November 2006, 17:38
danfulton danfulton is offline
Junior Member
 
Join Date: Nov 2006
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
 
Default

I've followed the howto, but I can not get munin to display the apache stats,

When I run the plugin directly I get,

Can't locate object method "new" via package "LWP::UserAgent" at ./apache_accesses line 128.

Has anyone managed to get the apache stats to display?

Cheers

Dan
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
munin permissions sjau HOWTO-Related Questions 10 17th April 2009 17:27
Extension for the monit and munin programs(tut from falko) ColdDoT Server Operation 7 4th May 2006 11:37
Server Monitoring With munin And monit - Page 2 Hans Server Operation 6 28th April 2006 16:17


All times are GMT +2. The time now is 00:46.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.