Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum. |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
12-02-2008, 02:42 PM
|
#1
|
Member
Registered: Dec 2004
Location: Raleigh, NC
Distribution: CentOS 2.6.18-53.1.4.el5
Posts: 770
Rep:
|
MRTG page not updating statistics.
I just set up MRTG to use with nagios and the Traffic Analysis page for my router is not updating therefore causing nagios to spit out this error:
The statistics were last updated Tuesday, 2 December 2008 at 14:45,
at which time '*router*' had been up for 0:29:59.
*changed*, it is the valid router name
***** Nagios *****
Notification Type: PROBLEM
Service: Port 1 Bandwidth Usage
Host: hostname
Address: 127.0.0.1
State: WARNING
Date/Time: Tue Dec 2 15:21:18 EST 2008
Additional Info:
MRTG data has expired (36 minutes old)
*hostname had been changed. It is a valid hostname on my network
crontab entry to have mrtg run every 5 minutes:
*/5 * * * * env LANG=C /usr/bin/mrtg /etc/mrtg/mrtg.cfg --logging /var/log/mrtg.log
tail -f /var/log/mrtg.log
2008-12-02 15:15:02 -- Started mrtg with config '/etc/mrtg/mrtg.cfg'
2008-12-02 15:20:01 -- Started mrtg with config '/etc/mrtg/mrtg.cfg'
2008-12-02 15:25:02 -- Started mrtg with config '/etc/mrtg/mrtg.cfg'
2008-12-02 15:30:01 -- Started mrtg with config '/etc/mrtg/mrtg.cfg'
2008-12-02 15:35:01 -- Started mrtg with config '/etc/mrtg/mrtg.cfg'
last update to the mrtg analysis page was 14:45, which is probably when I first started mrtg.
The router logs in /var/www/html/mrtg are updating every 5 minutes.
created the config file by:
cfgmaker --global 'WorkDir: /var/www/html/mrtg' --output /etc/mrtg/mrtg.cfg community@router
*community and router are correct in the command, changed for security.
created the index pages by:
indexmaker --output=/var/www/html/mrtg/index.html /etc/mrtg/mrtg.cfg
Centos 5.1
mrtg-2.14.5-2
Why are the log files updating but the webpage isn't?
thanks!
|
|
|
12-02-2008, 03:22 PM
|
#2
|
Member
Registered: Dec 2004
Location: Raleigh, NC
Distribution: CentOS 2.6.18-53.1.4.el5
Posts: 770
Original Poster
Rep:
|
SOLVED
For some reason the first time I tried to set MRTG up I choose /var/www whereas the document root is /var/www/html. I then reran my index scripts and the logs were updating in /var/www/html/mrtg, BUT /etc/httpd/conf.d/mrtg.conf still had an alias for /mrtg /var/www
once I corrected that everything updated as fine.
|
|
|
12-03-2008, 09:17 AM
|
#3
|
Member
Registered: Dec 2004
Location: Raleigh, NC
Distribution: CentOS 2.6.18-53.1.4.el5
Posts: 770
Original Poster
Rep:
|
Ok this is weird... my mrtg router log files keep disappearing/reappearing...
as you can see
Dec 3 09:10:38 hostname nagios: SERVICE ALERT: hostname;em2 Bandwidth Usage;OK;HARD;3;Traffic OK - Avg. In = 325.6 KB/s, Avg. Out = 30.4 KB/s
Dec 3 09:20:38 hostname nagios: SERVICE ALERT: hostname;em2 Bandwidth Usage;UNKNOWN;SOFT;1;check_mrtgtraf: Unable to open MRTG log file
Dec 3 09:44:38 hostname nagios: SERVICE ALERT: hostname;em2 Bandwidth Usage;OK;HARD;3;Traffic OK - Avg. In = 288.8 KB/s, Avg. Out = 26.5 KB/s
at at 9:10 the log file was there, 9:20 the log file was not there and at 9:44 the log file was there.. What's making the log files go away?
The mrtg webpage seems to still be updating but nagios complains.
Dec 3 09:20:38 hostname nagios: SERVICE ALERT: hostname;em2 Bandwidth Usage;UNKNOWN;SOFT;1;check_mrtgtraf: Unable to open MRTG log file
Dec 3 09:20:38 hostname nagios: SERVICE ALERT: hostname;em3 Bandwidth Usage;UNKNOWN;SOFT;1;check_mrtgtraf: Unable to open MRTG log file
Dec 3 09:22:38 hostname nagios: SERVICE ALERT: hostname;em2 Bandwidth Usage;UNKNOWN;SOFT;2;check_mrtgtraf: Unable to open MRTG log file
Dec 3 09:22:38 hostname nagios: SERVICE ALERT: hostname;em3 Bandwidth Usage;UNKNOWN;SOFT;2;check_mrtgtraf: Unable to open MRTG log file
Dec 3 09:24:38 hostname nagios: SERVICE ALERT: hostname;em2 Bandwidth Usage;UNKNOWN;HARD;3;check_mrtgtraf: Unable to open MRTG log file
Dec 3 09:24:38 hostname nagios: SERVICE ALERT: hostname;em3 Bandwidth Usage;UNKNOWN;HARD;3;check_mrtgtraf: Unable to open MRTG log file
Dec 3 09:31:28 hostname nagios: SERVICE ALERT: hostname;em0 Bandwidth Usage;UNKNOWN;SOFT;1;check_mrtgtraf: Unable to open MRTG log file
Dec 3 09:33:08 hostname nagios: SERVICE ALERT: hostname;em1 Bandwidth Usage;UNKNOWN;SOFT;1;check_mrtgtraf: Unable to open MRTG log file
Dec 3 09:33:28 hostname nagios: SERVICE ALERT: hostname;em0 Bandwidth Usage;UNKNOWN;SOFT;2;check_mrtgtraf: Unable to open MRTG log file
Dec 3 09:35:08 hostname nagios: SERVICE ALERT: hostname;em1 Bandwidth Usage;UNKNOWN;SOFT;2;check_mrtgtraf: Unable to open MRTG log file
Dec 3 09:35:28 hostname nagios: SERVICE ALERT: hostname;em0 Bandwidth Usage;OK;SOFT;3;Traffic OK - Avg. In = 10.4 KB/s, Avg. Out = 4.7 KB/s
Dec 3 09:37:08 hostname nagios: SERVICE ALERT: hostname;em1 Bandwidth Usage;OK;SOFT;3;Traffic OK - Avg. In = 33.8 KB/s, Avg. Out = 241.9 KB/s
Dec 3 09:40:48 hostname nagios: Auto-save of retention data completed successfully.
Dec 3 09:44:38 hostname nagios: SERVICE ALERT: hostname;em2 Bandwidth Usage;OK;HARD;3;Traffic OK - Avg. In = 288.8 KB/s, Avg. Out = 26.5 KB/s
Dec 3 09:44:38 hostname nagios: SERVICE ALERT: hostname;em3 Bandwidth Usage;OK;HARD;3;Traffic OK - Avg. In = 282.2 KB/s, Avg. Out = 317.3 KB/s
Dec 3 09:57:08 hostname nagios: SERVICE ALERT: hostname;em1 Bandwidth Usage;UNKNOWN;SOFT;1;check_mrtgtraf: Unable to open MRTG log file
Dec 3 09:59:08 hostname nagios: SERVICE ALERT: hostname;em1 Bandwidth Usage;UNKNOWN;SOFT;2;check_mrtgtraf: Unable to open MRTG log file
Dec 3 10:01:08 hostname nagios: SERVICE ALERT: hostname;em1 Bandwidth Usage;OK;SOFT;3;Traffic OK - Avg. In = 39.7 KB/s, Avg. Out = 346.0 KB/s
Dec 3 10:05:28 hostname nagios: SERVICE ALERT: hostname;em0 Bandwidth Usage;UNKNOWN;SOFT;1;check_mrtgtraf: Unable to open MRTG log file
Dec 3 10:07:28 hostname nagios: SERVICE ALERT: hostname;em0 Bandwidth Usage;UNKNOWN;SOFT;2;check_mrtgtraf: Unable to open MRTG log file
Dec 3 10:09:28 hostname nagios: SERVICE ALERT: hostname;em0 Bandwidth Usage;UNKNOWN;HARD;3;check_mrtgtraf: Unable to open MRTG log file
|
|
|
12-08-2008, 03:38 PM
|
#4
|
Member
Registered: Dec 2004
Location: Raleigh, NC
Distribution: CentOS 2.6.18-53.1.4.el5
Posts: 770
Original Poster
Rep:
|
Ok so it looks like putting:
RunAsDaemon: yes
in the mrtg.cfg file fixed the log files disappearing problem.
|
|
|
All times are GMT -5. The time now is 02:52 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|