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
ICAART
Posts: 3
Joined: Mon Mar 21, 2011 5:43 pm

check_mrtgtraf

Post by ICAART »

Hello,

I am trying to get the check_mrtgtraf plugin to work but keep getting the following error message: "check_mrtgtraf: Unable to open MRTG log file"

My environment is as follows. MRTG is running on a Windows 2000 box. I have shared the MRTG directory where the logs are stored as MRTGDATA and have given EVERYONE read access. from my Nagios box I can type "smb://server/mrtgdata" and the directory opens and I am able to open the MRTG log file that I
want to access.

I am using the following command to run the check_mrtgtraf: check_mrtgtraf -F \\serverrname\mrgtdata\10.10.13.14_1.log -a AVG -w "188900,1889500" -c "188998,188999"

What should I do to allow nagios to access the MRTG log on the windows server? Is this even possible?

All suggestions are welcome.

Thanks in advance,

PT
tonyyarusso
Posts: 1128
Joined: Wed Mar 03, 2010 12:38 pm
Location: St. Paul, MN, USA
Contact:

Re: check_mrtgtraf

Post by tonyyarusso »

Shell utilities can't speak Windows share directly. When you open a location like that in a file browser like Nautilus, it's passed through Samba on the backend to do something intelligent with it - that "\\servername\mrtgdata" path isn't "real" in Linux terms. So, you would need to somehow make a wrapper around Samba to get the file and then run check_mrtgtraf on it. One option for doing this would be to mount it with GVFS (Gnome), and then access the "local" directory location from that.
Tony Yarusso
Technical Services
___
TIES
Web: http://ties.k12.mn.us/
ICAART
Posts: 3
Joined: Mon Mar 21, 2011 5:43 pm

Re: check_mrtgtraf

Post by ICAART »

Thank you for the info. I have mounted the windows share and can now run the following command from the command line successfully:

check_mrtgtraf -F /mnt/mrtgdata/10.10.16.14_1.log -a AVG -w "188900,1889500" -c "188998,188999"

However, when I put the following in the Windows.cfg file:

define service{
use generic-service
host_name Router
service_description Check internet bandwidth
check_command check_mrtgtraf -F /mnt/mrtgdata/10.10.16.14_1.log -a AVG -w "188900,1889500" -c "188998,188999"
}

I get a CONFIG ERROR! when trying to start nagios. If i comment the service out Nagios starts fine. I cannot find anything wrong with the Define Service statement that would cause a Config Error. The check command portion runs fine from the command prompt so I am at a loss as to what is causing this.

Any ideas?

Thanks!
tonyyarusso
Posts: 1128
Joined: Wed Mar 03, 2010 12:38 pm
Location: St. Paul, MN, USA
Contact:

Re: check_mrtgtraf

Post by tonyyarusso »

Your check_command line is wrong. You should be referring to a check command defined within nagios, with arguments separated by exclamation points. See the documentation on object definitions for an example of this as well as how to define your command with placeholders for the arguments you need.
Tony Yarusso
Technical Services
___
TIES
Web: http://ties.k12.mn.us/
Locked