Page 1 of 2
MRTG Fails to Create .rrd in 2012R2.8b
Posted: Sun Jan 19, 2014 11:17 am
by mikew
After using the router/switch wizard to install a switch. No .rrd files are created in /var/lib/mrtg nor are .rrd files or xml files created in /usr/local/nagios/share/perfdata.
I have waited an hour so obviously it is not working.
* nagios has been restarted
Install version - new install
CentOS 6.4 64_bit
Nagios 2012R2.8b
When using the check command it shows that there are errors in mrtg.
Code: Select all
LANG=C LC_ALL=C /usr/bin/mrtg /etc/mrtg/mrtg.cfg –check
Use of uninitialized value $dir in concatenation (.) or string at /usr/bin/mrtg line 2531.
Use of uninitialized value $dir in concatenation (.) or string at /usr/bin/mrtg line 2549.
Use of uninitialized value $dir in concatenation (.) or string at /usr/bin/mrtg line 2565.
ERROR: "WorkDir" not specified in mrtg config file
Re: MRTG Fails to Create .rrd in 2012R2.8b
Posted: Mon Jan 20, 2014 8:43 am
by scottwilkerson
Yes, I believe the switch wizard was upgraded prematurely.
You can install the attached wizard and re-run and it should perform properly in 2.8b.
Re: MRTG Fails to Create .rrd in 2012R2.8b
Posted: Mon Jan 20, 2014 8:55 am
by mikew
I replaced the switch wizard with a working version but I think the issue is with the program as it still fails. In addition it only reports on 3 ports when there are 20 working.
Code: Select all
LANG=C LC_ALL=C /usr/bin/mrtg /etc/mrtg/mrtg.cfg –check
Use of uninitialized value $dir in concatenation (.) or string at /usr/bin/mrtg line 2531.
Use of uninitialized value $dir in concatenation (.) or string at /usr/bin/mrtg line 2549.
Use of uninitialized value $dir in concatenation (.) or string at /usr/bin/mrtg line 2565.
ERROR: "WorkDir" not specified in mrtg config file
Before running it I cleaned up the mrtg.cfg file and made sure no rrd files were in the /var/lib/mrtg.
Re: MRTG Fails to Create .rrd in 2012R2.8b
Posted: Mon Jan 20, 2014 12:38 pm
by scottwilkerson
lets make sure your mrtg.cfg has this line toward the top
Re: MRTG Fails to Create .rrd in 2012R2.8b
Posted: Mon Jan 20, 2014 12:43 pm
by lmiltchev
Did you also cleaned up the "/usr/local/nagiosxi/tmp/" directory, according to the following document?
http://assets.nagios.com/downloads/nagi ... Router.pdf
What is the output of the following command?
Code: Select all
grep -i workdir /etc/mrtg/mrtg.cfg
Re: MRTG Fails to Create .rrd in 2012R2.8b
Posted: Tue Jan 21, 2014 6:52 am
by mikew
The WorkDir /var/lib/mrtg did not exist in the file.
In addition, the /var/lib/mrtg is filled with images and html files? These files are being updated. Something is seriously wrong here.
Code: Select all
192.168.5.10_100000-day.png 192.168.5.10_1006-week.png 192.168.5.10_54.log 192.168.5.10_62-day.png
192.168.5.10_100000.html 192.168.5.10_1006-year.png 192.168.5.10_54-month.png 192.168.5.10_62.html
192.168.5.10_100000.log 192.168.5.10_1007-day.png 192.168.5.10_54-week.png 192.168.5.10_62.log
192.168.5.10_100000-month.png 192.168.5.10_1007.html 192.168.5.10_54-year.png 192.168.5.10_62-month.png
192.168.5.10_100000-week.png 192.168.5.10_1007.log 192.168.5.10_55-day.png 192.168.5.10_62-week.png
192.168.5.10_100000-year.png 192.168.5.10_1007-month.png 192.168.5.10_55.html 192.168.5.10_62-year.png
192.168.5.10_1000-day.png 192.168.5.10_1007-week.png 192.168.5.10_55.log 192.168.5.10_63-day.png
192.168.5.10_1000.html 192.168.5.10_1007-year.png 192.168.5.10_55-month.png 192.168.5.10_63.html
I added the workdir directory and tried again....
Code: Select all
LANG=C LC_ALL=C /usr/bin/mrtg /etc/mrtg/mrtg.cfg –check
2014-01-21 11:43:38: ERROR: Target[192.168.5.10_49][_IN_] ' $target->[0]{$mode} c' (warn): (Missing operator before c?)
2014-01-21 11:43:38: ERROR: Target[192.168.5.10_49][_OUT_] ' $target->[0]{$mode} c' (warn): (Missing operator before c?)
2014-01-21 11:43:38, Rateup WARNING: /usr/bin/rateup Can't remove 192.168.5.10_49.old updating log file
2014-01-21 11:43:38: ERROR: Target[192.168.5.10_50][_IN_] ' $target->[1]{$mode} c' (warn): (Missing operator before c?)
2014-01-21 11:43:38: ERROR: Target[192.168.5.10_50][_OUT_] ' $target->[1]{$mode} c' (warn): (Missing operator before c?)
2014-01-21 11:43:38, Rateup WARNING: /usr/bin/rateup Can't remove 192.168.5.10_50.old updating log file
So I removed everything, scan files, mrtg.cfg, /var/lib/mrtg/files, router wizard and installed a known good wizard and tried again. Now no workdir is added and I get this:
Code: Select all
LANG=C LC_ALL=C /usr/bin/mrtg /etc/mrtg/mrtg.cfg –check
Use of uninitialized value $dir in concatenation (.) or string at /usr/bin/mrtg line 2531.
Use of uninitialized value $dir in concatenation (.) or string at /usr/bin/mrtg line 2549.
Use of uninitialized value $dir in concatenation (.) or string at /usr/bin/mrtg line 2565.
ERROR: "WorkDir" not specified in mrtg config file
I added the workdir and get this:
Code: Select all
LANG=C LC_ALL=C /usr/bin/mrtg /etc/mrtg/mrtg.cfg –check
2014-01-21 11:52:12, Rateup WARNING: /usr/bin/rateup could not read the primary log file for 192.168.5.10_49
2014-01-21 11:52:12, Rateup WARNING: /usr/bin/rateup The backup log file for 192.168.5.10_49 was invalid as well
2014-01-21 11:52:12, Rateup WARNING: /usr/bin/rateup Can't remove 192.168.5.10_49.old updating log file
2014-01-21 11:52:12, Rateup WARNING: /usr/bin/rateup Can't rename 192.168.5.10_49.log to 192.168.5.10_49.old updating log file
2014-01-21 11:52:12, Rateup WARNING: /usr/bin/rateup could not read the primary log file for 192.168.5.10_50
2014-01-21 11:52:12, Rateup WARNING: /usr/bin/rateup The backup log file for 192.168.5.10_50 was invalid as well
Re: MRTG Fails to Create .rrd in 2012R2.8b
Posted: Tue Jan 21, 2014 11:08 am
by lmiltchev
Mike, run the commands below and show us the output:
Code: Select all
ll /usr/bin/rateup
ll /var/lib/mrtg
ll -d /var/lib/mrtg
Re: MRTG Fails to Create .rrd in 2012R2.8b
Posted: Tue Jan 21, 2014 7:25 pm
by mikew
ll /usr/bin/rateup
-rwxr-xr-x. 1 root root 55648 Nov 12 2012 /usr/bin/rateup
ll /var/lib/mrtg
total 0
ll -d /var/lib/mrtg
drwxr-xr-x. 2 root root 12288 Jan 21 11:56 /var/lib/mrtg
Re: MRTG Fails to Create .rrd in 2012R2.8b
Posted: Tue Jan 21, 2014 11:01 pm
by rmfaria
When do you use wizard to run switch/router - the background command changed the configuration in /etc/mrtg/mrtg.cfg
The problem is - when you run the wizard, the command remove/comment important lines in mrtg.cfg in last update in XI but the problem was solved in last version.
Remove #######
HtmlDir: /var/www/mrtg
ImageDir: /var/www/mrtg
LogFormat: rrdtool
LogDir: /var/lib/mrtg
ThreshDir: /var/lib/mrtg
Comment ########
WorkDir: /var/lib/mrtg
Problem in Nagios XI: SERVICE ALERT: 192.168.0.1;Lan Bandwidth;UNKNOWN;SOFT;1;/var/lib/mrtg/192.168.0.1_4.rrd does not exist.
Re: MRTG Fails to Create .rrd in 2012R2.8b
Posted: Wed Jan 22, 2014 8:04 am
by scottwilkerson
mikew wrote:In addition, the /var/lib/mrtg is filled with images and html files? These files are being updated. Something is seriously wrong here.
@mikew - do you have this directive in the mrtg.cfg ?
Make sure the top of the mrtg.cfg file contains the following
Code: Select all
# Minimal mrtg.cfg
#--------------------
HtmlDir: /var/www/mrtg
ImageDir: /var/www/mrtg
LogFormat: rrdtool
LogDir: /var/lib/mrtg
ThreshDir: /var/lib/mrtg
#Target[r1]: 2:[email protected]
#MaxBytes[r1]: 1250000
#Title[r1]: Traffic Analysis
#PageTop[r1]: <H1>Stats for our Ethernet</H1>
WorkDir: /var/lib/mrtg