check_mrtgtraf: Unable to process MRTG log file

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
happy
Posts: 20
Joined: Wed Nov 28, 2012 4:37 pm

check_mrtgtraf: Unable to process MRTG log file

Post by happy »

Hello Everyone

I continue to explore Nagios and its plugins. I am trying to get a network switch port monitored for bandwidth using check_mrtgtraf. I am working off of this tutorial:

http://www.thegeekstuff.com/2008/11/how ... ng-nagios/

define service{
use generic-service
host_name core-switch
service_description Port 1 Bandwidth Usage
check_command check_local_mrtgtraf!/var/lib/mrtg/192.168.1.11_1.log!AVG!1000000,2000000!5000000,5000000!10
}

I ran into the issue mentioned in the tutorial

Issue1: Nagios GUI displays “check_mrtgtraf: Unable to open MRTG log file” error message for the Port bandwidth usage

Solution1: make sure the *.log file defined in the check_local_mrtgtraf service is pointing to the correct location.

I did not have MRTG installed and used another howto to install and configure it. I also created the log file by touch <ipaddress>_1.log command and for testing purposes have given 777 permissions on the file. With that the error message changed from 'Unable to open MRTG log file' I now that 'check_mrtgtraf: Unable to process MRTG log file'.

I continue to read online but can't seem to find a solution. Does anyone here know what might be the issue and a possible solution?

Many thanks for your time.
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: check_mrtgtraf: Unable to process MRTG log file

Post by scottwilkerson »

This will only work if your cron you setup looks something like this

Code: Select all

*/5 * * * * /usr/bin/env LANG=C /usr/bin/mrtg /etc/mrtg/mymrtg.cfg –logging /var/lib/mrtg/192.168.1.11_1.log
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
happy
Posts: 20
Joined: Wed Nov 28, 2012 4:37 pm

Re: check_mrtgtraf: Unable to process MRTG log file

Post by happy »

Hi scottwilkerson

Thank you for replying.

I have run:
crontab -e

and have added the code you provided with my own ip ... however, I still see the same error.

I am a bit confused as to why it needs to run as a cron job for monitoring bandwidth through Nagios, whereas for the rest of uptime, ping test, etc are done through Nagios without setting up a cron job.

Do you know?

Thanks.
happy
Posts: 20
Joined: Wed Nov 28, 2012 4:37 pm

Re: check_mrtgtraf: Unable to process MRTG log file

Post by happy »

Anyone with any ideas on this? Many Thanks!
User avatar
gshergill
Posts: 231
Joined: Tue Aug 07, 2012 5:08 am

Re: check_mrtgtraf: Unable to process MRTG log file

Post by gshergill »

Hi happy,

I had the same issue.

When I set this up I used the post 10 or so on the following link - http://www.howtoforge.com/forums/archiv ... 48484.html

There were a few things I changed when running the command to create the config directory (/var/www/mrtg/ instead of /var/www/html/mymrtg) but whatever changes you make, ensure to change the rest of the post accordingly.

Hope this helps.

Kind Regards,

Gary Shergill
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: check_mrtgtraf: Unable to process MRTG log file

Post by slansing »

Thank you for the insight gshergill! We will see what happens.
Locked