check_mrtgtraf

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
ViaNagios
Posts: 5
Joined: Mon Jan 09, 2012 12:07 pm

check_mrtgtraf

Post by ViaNagios »

I am trying to monitor a Cisco 2960g switch and I am getting this error:

Port 1 Bandwidth Usage UNKNOWN 02-09-2012 16:51:03 148d 7h 41m 28s 3/3 check_mrtgtraf: Unable to open MRTG log file

Can anyone give me a clue as to what to check? I searched online and found things like, check directory permissions, etc. Nothing worked.
If I'm not posting to the correct place, please let me know where I can post.

Thanks, Thomy
User avatar
nscott
Posts: 1040
Joined: Wed May 11, 2011 8:54 am

Re: check_mrtgtraf

Post by nscott »

Does the rrd file exist? What are the permissions on it? Do you have SELinux disabled?
Nicholas Scott
Former Nagios employee
ViaNagios
Posts: 5
Joined: Mon Jan 09, 2012 12:07 pm

Re: check_mrtgtraf

Post by ViaNagios »

Thanks so much for the quick reply!

In /var/nagios/ I have:
perfdata.log -rw-rw-r-- (664)
rrd drwxr-xr-x (755) (nothing in that directory)

Not sure about SELinux

FYI - I have installed:
Ubuntu server 8.04.4 LTS
Nagios 3.3.1
Nagios-Plugins 1.4.15
mrtg 2.17.4
nagiosgraph 1.4.4
ViaNagios
Posts: 5
Joined: Mon Jan 09, 2012 12:07 pm

Re: check_mrtgtraf

Post by ViaNagios »

Oh, and the nagios directory /var/nagios itself has drwxr-xr-x
user nagios, group nagios
User avatar
nscott
Posts: 1040
Joined: Wed May 11, 2011 8:54 am

Re: check_mrtgtraf

Post by nscott »

So you've edited your mrtg.cfg? Is there a WorkDir and LogDir specified in the mrtg.cfg? That where mrtg is going to try and put the log files, so if they aren't being created by MRTG then thats where the troubleshooting should probably start.

Also I was mistaken about SELinux, Ubuntu using AppArmor.
Nicholas Scott
Former Nagios employee
ViaNagios
Posts: 5
Joined: Mon Jan 09, 2012 12:07 pm

Re: check_mrtgtraf

Post by ViaNagios »

Yeah, no SELinux here.

Now I'm confused. I thought I did edit the mrtg.cfg . Upon searching I found I have 2.
One at /etc/ and the other at /etc/mrtg/ .

The one at /etc/ says:
######################################################################
# Multi Router Traffic Grapher -- Sample Configuration File
######################################################################
# This file is for use with mrtg-2.5.4c

# Global configuration
WorkDir: /var/www/mrtg
WriteExpires: Yes

Title[^]: Traffic Analysis for

# 128K leased line
# ----------------
#Title[leased]: a 128K leased line
#PageTop[leased]: <H1>Our 128K link to the outside world</H1>
#Target[leased]: 1:[email protected]
#MaxBytes[leased]: 16000


The one at /etc/mrtg/ says:
######################################################################
# Multi Router Traffic Grapher -- Sample Configuration File
######################################################################
# This file is for use with mrtg-2.5.4c

# Global configuration
RunAsDaemon: Yes
Interval: 5
Options[_]: growright, bits
WorkDir: /var/www/mrtg
Logdir: /var/log/
EnableIPv6: No
WriteExpires: Yes

Title[^]: Traffic Analysis for

# 128K leased line
# ----------------
#Title[leased]: a 128K leased line
#PageTop[leased]: <H1>Our 128K link to the outside world</H1>
#Target[leased]: 1:[email protected]
#MaxBytes[leased]: 16000

Which is the right one to configure? Where should WorkDir point? Where should Logdir point? In my instance. Sorry, noob with Nagios, and kinda noob with Linux in general.
They both say # This file is for use with mrtg-2.5.4c . Does it matter I have mrtg-2.14.7 (after running dpkg --list)?
ViaNagios
Posts: 5
Joined: Mon Jan 09, 2012 12:07 pm

Re: check_mrtgtraf

Post by ViaNagios »

When searching for mrtg I get:

/var/lock/mrtg
/var/www/mrtg
/var/log/mrtg
/var/lib/mrtg
/usr/share/doc/mrtg
/usr/bin/mrtg
/etc/mrtg
/etc/logrotate.d/mrtg
/etc/cron.d/mrtg

Thanks,
Thomy
User avatar
nscott
Posts: 1040
Joined: Wed May 11, 2011 8:54 am

Re: check_mrtgtraf

Post by nscott »

I don't think it matters where the mrtg.cfg is just as long as the mrtg command gets executed with the proper address for the config file. The Dir's indicated whichever config file you are launching mrtg with better exist. However I'm unsure if you're running mrtg as a daemon or hae the mrtg on some sort of cron job.
Nicholas Scott
Former Nagios employee
Locked