Help - Search - Members - Calendar
Full Version: HOWTO: MRTG on RHEL w/cPanel
The Planet Forums > Control Panels > cPanel/WHM > Cpanel/WHM HOWTOs
Pages: 1, 2, 3
Got-Hosting
This is not my own HOWTO, but really a reiteration of gpan's mrtg rpm and a slight adaption of brandonk's RH8 thread.

Make sure that another mrtg rpm is not installed:

rpm -e mrtg

Then get gpan's rpm:

wget http://joseph.got-servers.net/mrtg-2.9.17-...cpanel.i386.rpm

Install the gpan RPM:

rpm -Uvh mrtg-2.9.17-1cpanel.i386.rpm

from WHM install this package:

gnome-libs

This installs a dependency that is not compatible, so we force uninstall it:

rpm -e --nodeps libpng10

Create a symlink as follows:

cd /usr/lib
ln -s libpng.so.3 libpng.so.2

Then start mrtg:

/etc/rc.d/init.d/mrtg restart

You'll probably need to do the above line at least three times to clear up some initial errors.

Then you can look at your graphs by going to:

http://host.name.com/mrtg/

Once that is done, you need to tell up2date not to update mrtg automatically.

up2date --configure

Select whichever option number for pkgSkipList
add

mrtg*;

to whatever else you have in there.
kris1351
Thanks Jon!
HighRiskCO
QUOTE
Originally posted by Got-Hosting
This is not my own HOWTO, but really a reiteration of gpan's mrtg rpm and a slight adaption of brandonk's RH8 thread.

oppppsss icon_sad.gif

mrtg installed and starts but I get the following:
root@secure [~]# ls: /var/spool/exim/input/*-H: No such file or directory
ls: /var/spool/exim/input/*-H: No such file or directory
ls: /var/spool/exim/input/*-H: No such file or directory

What did I do wrong :confused:

Restarted mrtg about 6 times receiving the same error each time.
/var/spool/exim/input/ is there with no files...

Any sugestions?

Thank you
Got-Hosting
Yes, I got them as well. Not sure what the deal with it is, btu I know the graphs are working okay. I could not find it logging that message anywhere either. Eventually I closed the SSH session, and obviously, i stopped seeing the messages, and all the graphs were looking okay.

I looked in the configuration file and saw the line. My best guess is that it is because that directory was empty.

When I restart it in SSH now, I am not getting the messages any longer, so I am thinking that it does that until it catches a file in there?

Give it a little time, and come back and restart it and see if you are still getting them.
HighRiskCO
Will do...

Thanks for the fast response!
zappz
QUOTE
When I restart it in SSH now, I am not getting the messages any longer, so I am thinking that it does that until it catches a file in there?

Give it a little time, and come back and restart it and see if you are still getting them. [/B]


Same thing happened to me, left SSH and logged into root again -no messages. Everything appears to be working as well. Just need to sort out the mailscanner-mrtg problems I've got!

Thanks for the great HOW-TO!
Got-Hosting
Yeah, that is on my list, the mrtg thing. (Ok, its not NEXT on my list, but its on my list)
Got-Hosting
Just edited the post. upcp, sysup, etc will automatically install a newer version of mrtg which will break it.

Follow the extra steps at the end to tell up2date to ignore mrtg updates.
HighRiskCO
QUOTE
Originally posted by Got-Hosting
Just edited the post.  upcp, sysup, etc will automatically install a newer version of mrtg which will break it.

Follow the extra steps at the end to tell up2date to ignore mrtg updates.

Thanks for the update!

mrtg is now working icon_biggrin.gif

Great HowTo by the way!

Thank you
zappz
QUOTE
Originally posted by Got-Hosting
Just edited the post.  upcp, sysup, etc will automatically install a newer version of mrtg which will break it.

Follow the extra steps at the end to tell up2date to ignore mrtg updates.


Hi,

Please change the up2date, should be option 8. pkgSkipList

Thanks,

Mark
HighRiskCO
QUOTE
Originally posted by zappz
Hi,

Please change the up2date, should be option  8.  pkgSkipList

Thanks,

Mark

:confused:

RHEL 3 and cPanel
up2date --configure
Option 8 = noSSLServerURL
Option 9 = pkgSkipList
Got-Hosting
This is my option list:

8. noSSLServerURL http://xmlrpc.rhn.redhat.com/XMLRPC
9. pkgSkipList ['httpd*', 'perl*', 'mysql*', 'php*', 'mrtg*']
10. storageDir /var/spool/up2date
11. adminAddress ['root@localhost']

So, on mine it is nine. I guess I'll edit it to reflect which one to edit by text.
zappz
QUOTE
Originally posted by HighRiskCO
:confused:

[B]RHEL 3 and cPanel

up2date --configure
Option 8 = noSSLServerURL
Option 9 = pkgSkipList [/B]


That's bizarre! RHEL 3 and cPanel here......


7. noSSLServerURL http://xmlrpc.rhn.redhat.com/XMLRPC
8. pkgSkipList ['kernel*', 'httpd', 'perl*', 'mrtg*']
9. storageDir /var/spool/up2date

Work that one out! rolleyes.gif
HighRiskCO
QUOTE
Originally posted by zappz
That's bizarre! RHEL 3 and cPanel here......


7.  noSSLServerURL     http://xmlrpc.rhn.redhat.com/XMLRPC
8.  pkgSkipList        ['kernel*', 'httpd', 'perl*', 'mrtg*']
9.  storageDir         /var/spool/up2date

Work that one out! rolleyes.gif

My options are the same as Got-Hosting

Go figure rolleyes.gif Interesting to say the least!
chielsen
from WHM install this package:

gnome-libs


How can i do that?
Got-Hosting
Under the software section, Install an RPM.
Rock Daddy
Can this be used on a plain RH 3.0 Ent or is it for only cpanel?

If the latter, anywhere to get it for RH 3.0 Ent.?


EDIT: I might be barking up the wrong thread here. Im looking for basic cpu and mem usage stuff.
Got-Hosting
gpan's mrtg rpm is specifically for cpanel. I would imagine that some of it would work, but many of the cpanel specific items, such as the mail stuff would not work.
EWD
Do you know if this would work on RH9 w/ Cpanel??

Thanks icon_wink.gif
Got-Hosting
Yes, these are essentially the same steps I followed for RH9.
EWD
Cool thank you!

worked like a charm icon_wink.gif
Got-Hosting
I should add a warning, that with the MyDoom virus, the mail stats portions were really dragging down my server (p4 2 gig) and I had to comment them out. If anyone else has that problem let me know and I'll post the fix.
chielsen
Shutting down MRTG: [ OK ]
Starting MRTG: Daemonizing MRTG ..

No errors, but /mrtg wont show me anything. Top says it is running though. I can't find any config in httpd.conf also ...
Got-Hosting
There won't be anything in the httpd.conf file.

If http://host.name.com/mrtg/ doesn't work. try http://xx.xx.xx.xx/mrtg/

Also, on some machines, leaving off the trailing / will make it not work.
chielsen
Still nothing...
Got-Hosting
Did you get any errors when you started it?

Did you restart it at least three times?

What is your hostname/ip?
7thgencivic.com
I keep getting this in SSH session

ls: /var/spool/exim/input/*-H: No such file or directory

Also, will MRTG start on reboot?
chielsen
Check...

QUOTE
Originally posted by chielsen
Shutting down MRTG:                                        [  OK  ]
Starting MRTG: Daemonizing MRTG ..

No errors, but /mrtg wont show me anything. Top says it is running though. I can't find any config in httpd.conf also ...



I have pmed you my ip.
Got-Hosting
QUOTE
Originally posted by 7thgencivic.com
I keep getting this in SSH session

ls: /var/spool/exim/input/*-H: No such file or directory

Also, will MRTG start on reboot?


That problem is covered in the third reply to this thread.
7thgencivic.com
sorry. my bad. should have known better. :o
Got-Hosting
QUOTE
Originally posted by chielsen
Check...

 


I have pmed you my ip.


Are you running cpanel?
chielsen
RHEL and cpanel yes.
Got-Hosting
That is very odd. Have you cahnged the document root?

The IP address you gave me should have given me the default cpanel page. Instead I got something different.

Something is very odd about your server, but if you changed the document root for the IP you supplied me, then it will not work. the RPM installs the mrtg files in /usr/local/apache/htdocs. If you look in there you should see an mrtg directory.

I think the issue probably stems from a changed document root.
chielsen
DocumentRoot /usr/local/apache/htdocs


The dir mrtg excist. So it's a apache config thing. When i go to my server ip, i see the first listed site....
Got-Hosting
You need a virtualhost entry for your server hostname. It should be the virst virtualhost entry in the httpd.conf file and should look something like this:


BytesLog domlogs/host.name.com-bytes_log
ServerName host.name.com
DocumentRoot /usr/local/apache/htdocs


And it should be right after the namevirtualhost directive with the main server IP.
7thgencivic.com
there is a 404 on the RPM now

got the new one from ur site

http://jacob.got-hosting.com/mrtg-2.9.17-1...cpanel.i386.rpm
janderk
Same problem here: link is dead. Could anybody please post the required rpm?

Jan Derk
7thgencivic.com
i just posted it above ^^^
7thgencivic.com
will this start when the box is restarted?

one more thing, where is the cfg file to edit the settings? I looked at a couple but didn't appear that they were it.
Got-Hosting
I fixed the original post to indicate the proper link.

Yes, it will start automatically on reboot.

The config file is located in /etc/mrtg/mrtg.cfg.

Jon
d00der
Doh. Stupid question. There is nothing listed under install rpm section in my cpanel, and rebuild rpm db doesnt do anything to it either. all blanks.

any ideas?
Got-Hosting
You probably have a broken up2date setup. EV1 is getting famous for that.

From SSH type up2date -l and if it returns something about excessive use or licensing or some such sillines, put in a trouble ticket to EV! adn they will fix it.
jameshsi
I did everything right and no errors, while in http://host.name.com/mrtg/ , I only see text , there is no charts al all, why ?
jameshsi
Finally see the chart, I now know you should wait, wait about 10~20 minutes (it depends) to see the chart, I guess it need some scripts to grep some data to produce the chart.
jameshsi
I found this is very waste cpu resources, makes your server high load cause the "grep" keeps running all the time.

Is there a way to get rid of the email total ?
Got-Hosting
You can edit that portion out of the mrtg.cfg file.

The way I got around it was to change the log rotation on the exim logs from weekly to daily.
jameshsi
QUOTE
Originally posted by Got-Hosting
You can edit that portion out of the mrtg.cfg file.

The way I got around it was to change the log rotation on the exim logs from weekly to daily.


Hi!
Thanks for reply but, these 2 methods you teach me are beyond my knoledge, can you teach me more ?
1. How to edit the mrtg.cfg file ?
I try add an comment before some lines, don't work.
for example:
#Options[MAIL-HOST-email-totals]:gauge,noinfo

2. How to change the log rotation on the exim logs ?
gochris
QUOTE
Originally posted by 7thgencivic.com
there is a 404 on the RPM now

got the new one from ur site

http://jacob.got-hosting.com/mrtg-2.9.17-1...cpanel.i386.rpm


now this one doesnt work
Got-Hosting
Yeah, that was two servers ago. icon_smile.gif

http://joseph.got-servers.net/mrtg-2.9.17-...cpanel.i386.rpm

Original post soon to be updated.
adriandaz
I installed this, it's quite cool thanks, few questions:

The error comes because that path is wrong I think, the exim 4.34 path is similar, like /var/spool/exim/exim_input - can this be changed?

Also, why does up2date break it?

thanks,

Adrian.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2009 Invision Power Services, Inc.