LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
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


Reply
  Search this Thread
Old 12-02-2008, 02:42 PM   #1
ncsuapex
Member
 
Registered: Dec 2004
Location: Raleigh, NC
Distribution: CentOS 2.6.18-53.1.4.el5
Posts: 770

Rep: Reputation: 44
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!
 
Old 12-02-2008, 03:22 PM   #2
ncsuapex
Member
 
Registered: Dec 2004
Location: Raleigh, NC
Distribution: CentOS 2.6.18-53.1.4.el5
Posts: 770

Original Poster
Rep: Reputation: 44
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.
 
Old 12-03-2008, 09:17 AM   #3
ncsuapex
Member
 
Registered: Dec 2004
Location: Raleigh, NC
Distribution: CentOS 2.6.18-53.1.4.el5
Posts: 770

Original Poster
Rep: Reputation: 44
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
 
Old 12-08-2008, 03:38 PM   #4
ncsuapex
Member
 
Registered: Dec 2004
Location: Raleigh, NC
Distribution: CentOS 2.6.18-53.1.4.el5
Posts: 770

Original Poster
Rep: Reputation: 44
Ok so it looks like putting:

RunAsDaemon: yes

in the mrtg.cfg file fixed the log files disappearing problem.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
MRTG stats updating Oskare100 Linux - Server 1 10-15-2007 10:55 AM
MRTG IP Wise Bandwidth usage statistics jayakrishnan Linux - Networking 4 02-02-2006 12:09 AM
Apache Server up, but acid and MRTG home page could not be view!! yitloo Linux - Networking 1 11-08-2004 04:20 AM
How MRTG is updating ? prasad_sr Linux - General 0 07-09-2003 08:17 AM
MRTG statistics for Modem Pool Hacker Linux - Software 0 06-06-2003 06:46 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 04:38 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration