![]() |
|
#1
|
|||
|
|||
|
HOWTO: Install MRTG (FULLY AUTOMATED)
Hi Guys,
** June 6th. 2008: MRTG tarball location has been updated to reflect it's new home on the official MRTG site. Also worth noting, I haven't updated this thread since 2005. Jeeze...you guys have been using this thing for a while! With the addition of a new server I found myself in the position of installing MRTG again. Chris (ProWebUK) wrote up a nice guide for installing MRTG manually - but I found the config to be lacking in some of the features I needed to monitor. So, I grabbed the mrtg.cfg from an old CPanel rpm and modified it slightly to work on a DA machine. The script I wrote will automatically download and install the latest version of MRTG and apply a very nice config for your viewing pleasure. Please note...I take ABSOLUTELY no credit for the mrtg.cfg included - I simply made a small modification and wrote an installer for the whole process. The installer will check to see if you have anything installed in /var/www/html/mrtg - if you have mrtg installed in another directory, you should remove it first. If you are already running MRTG, you need to make sure you delete it and its crontab entry before continuing with the installer. Guide: Code:
wget http://serveio.com/da/install.mrtg.sh chmod +x install.mrtg.sh ./install.mrtg.sh /var/www/html/mrtg and can be viewed at: http://your.hostname.com/mrtg You can see the output of my install at: http://loop.serveio.com/mrtg Enjoy! Confirmed Supported OSs: RedHat 9 Fedora Core 3 Fedora Core 2 Debian 3.0 CentOS 3.4 CentOS 4.0 If this installer works properly for you, please let me know what OS you used so I can update this list! Uninstall Instructions For those of you that want to uninstall MRTG (assuming you used this installer), please follow these steps:
Last edited by loopforever; 06-06-2008 at 05:52 AM. |
|
#2
|
||||
|
||||
|
Just installed it and working perfectly on Debian 3.0
Thanks for the script loopforever
__________________
Just do what it takes to make it happen
|
|
#3
|
|||
|
|||
|
Great! If you install it on any other OSs, let me know. I'll keep a list of confirmed operating systems for everyone's reference.
|
|
#4
|
|||
|
|||
|
FAILED ON
CentOS4 It gives a message of INSTALLED OK created the /var/www/html/mrtg dir, bust acessing to http://www.server.com/mrtg just gives nothing Now the question is How to remove-it |
|
#5
|
|||
|
|||
|
It would be helpful if you provided the output of the install script whereever errors occurred. Do you even know if it gave you an error?
You also must access the mrtg directory through your servers host name or IP. Not a Vhost in your httpd.conf. Try: http://serverip/mrtg And if that doesn't work, please tell me what errors the install script produced. |
|
#6
|
|||
|
|||
|
#7
|
|||
|
|||
|
You cannot access files in your global html directory through vhosts. Vhosts direct you to shared accounts on a given IP. The only way to access anything in the global html directory is through any ip or domain that is pointing to your server but does not have a virtualhost configured. You can add an A record (infact...you should most definitely add an A record) that points hostname.yourdomain.com -> yourip.
|
|
#8
|
||||
|
||||
|
You could add an alias to the httpd.conf file so that it would be like /webmail /squirrelmail etc and accessible on all domains.
__________________
Just do what it takes to make it happen
|
|
#9
|
|||
|
|||
|
I usually get the following warnings:
Executing MRTG for the first time (you may see some warnings)... ----------------------------------------------------------------------- ERROR: Mrtg will most likely not work properly when the environment variable LANG is set to UTF-8. Please run mrtg in an environment where this is not the case. Try the following command to start: env LANG=C /usr/local/mrtg-2/bin/mrtg /var/www/html/mrtg/core/mrtg.cfg ----------------------------------------------------------------------- If you see warnings above, it is generally safe to ignore. Perhaps it's an idea to add the env LANG=C thingy to the crontab to avoid getting this error too much .(Although I don't know if this is also required on all systems )I looked at the network stats script, it's interesting that it uses not snmpd but the /proc data. Edit: Furthermore I get the following error on the server I installed this on to test it: Quote:
__________________
http://www.sebsoft.nl Last edited by Icheb; 04-22-2005 at 03:08 AM. |
|
#10
|
|||
|
|||
|
I will take a look at the LANG bit - I know that may be a bit of an issue for some people. Thanks for bringing it to my attention.
Also, regarding your "swap" error. This is the section of the system file which I rewrote because /proc/meminfo can vary from distro to distro. What OS are you trying to install on, and can you provide me the output of: cat /proc/meminfo Thanks! |
|
#11
|
|||
|
|||
|
I fixed the error by editing the system bash file; on some line in the swap part it calculates the amount of used swap. The way it calculates this is wrong for my bash version (most versions, I hope).
Edited that part so that it reads: Quote:
![]() (calculating in bash should use the expr program instead of directly trying it in bash, in my opinion). And for your pleasure: Quote:
__________________
http://www.sebsoft.nl |
|
#12
|
|||
|
|||
|
DOH!
Very cool - I apologize for that...I was on my way out the door from work when I slopped those two commands together. I will update the system file in my tarball for future uses. Thanks! Edit: Tarball has been updated with a revised system file! Last edited by loopforever; 04-22-2005 at 11:18 AM. |
|
#13
|
||||
|
||||
|
works great , thank you
Great running on CentOS 3.4 and CentOS 4.0
__________________
ServerTweak Networks, LLC ServerTweak.comServerTweak.com: Premium Services, Powered by Customers. Fremont & Los Angeles Locations | RAID 10 Dedicated Servers | Colocation | IP Transit | 1/4 - Full Cab & Cages sales Last edited by servertweak; 04-23-2005 at 06:21 PM. |
|
#14
|
|||
|
|||
|
http://loop.serveio.com/mrtg/cpu.html
I think you've got a bug there. It would be truely remarcable if your CPU can run at 280%. Peter |
|
#15
|
|||
|
|||
|
this is just great! i did try to speed time how to add more things to monitor in mrtg, but was not successful.
thanks.loopforever, you are one of the professionals here also! |
|
#16
|
|||
|
|||
|
Working well on CentOS 3.4.
Is there any way I can get it to display my bandwidth in bits instead of bytes though? I tried adding "bits" to the options string in the cfg, but it didn't change anything. It's sort of a pain to have to multiply everything by 8 when I want to figure out how much of my pipe I'm using. EDIT: I figured it out. Had to add it to the traffic options, not global options. Last edited by CEpeep; 04-27-2005 at 01:49 PM. |
|
#17
|
|||
|
|||
|
Btw: I don't know if anyone is interested in it, I've been working with MRTG for ages.
I've used this setup on one of my servers and am slowly adding more and more stats to it, if you are interested I'm willing to pm the specs so that they can be included in future releases. At the moment the main addition is a Apache hit counter. (Total hits on server per hour) When I have some more time, I'll add some other stuff as well .
__________________
http://www.sebsoft.nl |
|
#18
|
|||
|
|||
|
Icheb - That would be a great addition. I also so mention in another thread of a script that outputs mysql process information. I think these are two features we can easily include in the install script. With the addition of these I will also fix the bug that is report CPU usage incorrectly.
I'll try and get in touch with you shortly to put your Apache hit counter in the "system" script. |
|
#19
|
|||
|
|||
|
Hi,
I dont get it how do i view those stats now? Weccop |
|
#20
|
||||
|
||||
|
Which stats Weccop?
mrtg - hostname.domain.com/mrtg apache hit counter - probably requires a new configuration for mrtg it possible.
__________________
Just do what it takes to make it happen
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Howto: Install Horde 3.0.4/IMP on FreeBSD | Wouter | How-To Guides | 77 | 05-30-2007 01:24 PM |
| HOWTO: Install MRTG (FULLY AUTOMATED) 2.12.2 | @how@ | How-To Guides | 73 | 05-12-2007 12:10 AM |
| [RELEASE] Ruby on Rails Direct Admin Plugin | vandal | 3rd Party Software | 84 | 04-13-2007 03:44 AM |
| SNMP is not supported by your PHP installation. | deltaned | General Technical Discussion & Troubleshooting | 6 | 04-03-2005 10:50 AM |
| HOWTO: Very easy RPM based MRTG installation | ProWebUK | How-To Guides | 60 | 03-12-2005 08:55 AM |