hosted by liquidweb


Go Back   Web Hosting Talk : Web Hosting Main Forums : Hosting Security and Technology : Hosting Security and Technology Tutorials : Analyse your http e mysql requests on MRTG!
Reply

Hosting Security and Technology Tutorials Tutorials related to server security or the like.
Forum Jump

Analyse your http e mysql requests on MRTG!

Reply Post New Thread In Hosting Security and Technology Tutorials Subscription
 
Send news tip View All Posts Thread Tools Search this Thread Display Modes
  #1  
Old 09-08-2004, 02:17 AM
Lem0nHead Lem0nHead is offline
Web Hosting Master
 
Join Date: Feb 2004
Posts: 1,226

Analyse your http e mysql requests on MRTG!


hello

this shell script generates the number of http requests/second on the first line and mysql requests/second (average) on second line

that's all MRTG needs to make a graphic

the script should work on any cpanel server... for other control panels it will need modifications on the apache status url (who finds the URL for other panels may post on this thread to help others):

Code:
#!/bin/sh
# by Luís Fernando Estrozi - 09/08/2004

echo `lynx -dump http://127.0.0.1/whm-server-status?auto | grep ReqPerSec | awk '{print$2}'`
PASS=`cat /root/.my.cnf | grep pass | cut -d'=' -f2`
echo `mysqladmin -uroot -p$PASS status | awk '{print$22}'`
save it as /your_mrtg_path/reqpersec
chmod 755 /your_mrtg_path/reqpersec

now edit mrtg.cfg and add:

Code:
#----------------------------
# Requests per second
#----------------------------

Target[reqpersec]: `/etc/mrtg/reqpersec`
Title[reqpersec]: Requests per second
PageTop[reqpersec]: <h3>Requests per second</h3>
YLegend[reqpersec]: Requests per second
ShortLegend[reqpersec]: &nbsp;&nbsp;&nbsp;
LegendI[reqpersec]: apache&nbsp;
LegendO[reqpersec]: mysql&nbsp;
service mrtg restart

good luck

Reply With Quote


Sponsored Links
  #2  
Old 09-08-2004, 03:34 AM
BizB BizB is offline
Web Hosting Evangelist
 
Join Date: Jul 2003
Posts: 526
i did all that but nothing changed in my mrtg page ?!

Reply With Quote
  #3  
Old 09-08-2004, 09:14 AM
Lem0nHead Lem0nHead is offline
Web Hosting Master
 
Join Date: Feb 2004
Posts: 1,226
Quote:
Originally posted by BizB
i did all that but nothing changed in my mrtg page ?!
the index didn't change
just access http://.../mrtg/reqpersec.html

Reply With Quote
Sponsored Links
  #4  
Old 09-08-2004, 11:42 AM
BizB BizB is offline
Web Hosting Evangelist
 
Join Date: Jul 2003
Posts: 526
cool found it
thanks

Reply With Quote
  #5  
Old 02-17-2005, 04:46 PM
evilek evilek is offline
Junior Guru Wannabe
 
Join Date: Mar 2004
Location: Poland, Lublin
Posts: 71
Quote:
# /etc/rc.d/init.d/mrtg start
Starting MRTG: /etc/rc.d/init.d/mrtg: /usr/bin/mrtg: /usr/local/bin/perl: bad interpreter: No such file or directory
wtf ?
i have perl.. and show this msg

anyone know how to fix it?

Reply With Quote
  #6  
Old 02-17-2005, 06:55 PM
sehe sehe is offline
Web Hosting Master
 
Join Date: Jun 2003
Posts: 962
Quote:
Starting MRTG: /etc/rc.d/init.d/mrtg: /usr/bin/mrtg: /usr/local/bin/perl: bad interpreter: No such file or directory
does your perl binary exist in /usr/local/bin/? i guess not
maybe /usr/bin/perl?
you can fix it with a symlink

Reply With Quote
  #7  
Old 02-17-2005, 07:24 PM
sehe sehe is offline
Web Hosting Master
 
Join Date: Jun 2003
Posts: 962
Re: Analyse your http e mysql requests on MRTG!

Quote:
Originally posted by Lem0nHead
the script should work on any cpanel server... for other control panels it will need modifications on the apache status url (who finds the URL for other panels may post on this thread to help others):

Code:
echo `lynx -dump http://127.0.0.1/whm-server-status?auto | grep ReqPerSec | awk '{print$2}'`
untested
Code:
lynx --dump http://127.0.0.1/server-status | grep "requests/sec" | awk {'print $1'}
needs server-status and "ExtendedStatus On" in httpd.conf

Reply With Quote
Reply

Related posts from TheWhir.com
Title Type Date Posted
LeaseWeb Releases First Law Enforcement Transparency Report Web Hosting News 2013-04-11 10:54:27
New Google Transparency Report Provides Insight into URL Takedown Requests Web Hosting News 2012-05-25 13:59:26
Web Host Rackspace Launches Private Beta for MySQL Cloud Database Web Hosting News 2011-12-01 21:09:51
.XXX Domain Land Rush Period Begins Web Hosting News 2011-11-08 19:34:24
Netcraft Survey Names Rackspace Most Reliable Web Hosting Site in October Web Hosting News 2011-11-02 19:13:38


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes
Postbit Selector

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
Login:
Log in with your username and password
Username:
Password:



Forgot Password?
Advertisement:
Web Hosting News:



 

X

Welcome to WebHostingTalk.com

Create your username to jump into the discussion!

WebHostingTalk.com is the largest, most influentual web hosting community on the Internet. Join us by filling in the form below.


(4 digit year)

Already a member?