MRTG Fails to Create .rrd in 2012R2.8b

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
User avatar
mikew
Posts: 243
Joined: Sun Feb 05, 2012 7:05 pm

MRTG Fails to Create .rrd in 2012R2.8b

Post 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
Mike Weber

Nagios Training/Consulting
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: MRTG Fails to Create .rrd in 2012R2.8b

Post 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.
You do not have the required permissions to view the files attached to this post.
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
User avatar
mikew
Posts: 243
Joined: Sun Feb 05, 2012 7:05 pm

Re: MRTG Fails to Create .rrd in 2012R2.8b

Post 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.
Mike Weber

Nagios Training/Consulting
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: MRTG Fails to Create .rrd in 2012R2.8b

Post by scottwilkerson »

lets make sure your mrtg.cfg has this line toward the top

Code: Select all

WorkDir: /var/lib/mrtg
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: MRTG Fails to Create .rrd in 2012R2.8b

Post 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
Be sure to check out our Knowledgebase for helpful articles and solutions!
User avatar
mikew
Posts: 243
Joined: Sun Feb 05, 2012 7:05 pm

Re: MRTG Fails to Create .rrd in 2012R2.8b

Post 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
Mike Weber

Nagios Training/Consulting
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: MRTG Fails to Create .rrd in 2012R2.8b

Post 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
Be sure to check out our Knowledgebase for helpful articles and solutions!
User avatar
mikew
Posts: 243
Joined: Sun Feb 05, 2012 7:05 pm

Re: MRTG Fails to Create .rrd in 2012R2.8b

Post 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
Mike Weber

Nagios Training/Consulting
rmfaria
Posts: 19
Joined: Tue Aug 27, 2013 12:38 pm

Re: MRTG Fails to Create .rrd in 2012R2.8b

Post 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.
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: MRTG Fails to Create .rrd in 2012R2.8b

Post 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 ?

Code: Select all

LogFormat: rrdtool
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
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
Locked