Page 1 of 7

check_mrtgtraf

Posted: Tue Apr 25, 2017 4:40 pm
by jmac727
Hi. I've just installed Nagios Core 4.3.1 on Unbuntu 16.04 and am having a hard time tracking the bandwidth on the port of my switch.

check_mrtgtraf: Unable to open MRTG log file

Is the error it's giving me. This is my first venture into Linux so I'm not very savvy with how everything works.

Also, is there a way to add the other ports of the switch to this without adding each port 1 by 1?

Please let me know if you need any other information.

Thanks!

Re: check_mrtgtraf

Posted: Tue Apr 25, 2017 4:48 pm
by tgriep
The check_mrtgtraf plugin requires MRTG to be installed and running on the server as the plugin uses the data gathered by MRTG for it's calculations.
I found this link for installing Nagios Core and graphing on Ubuntu. You could take a look at it for help.
https://raymii.org/s/tutorials/Nagios_C ... 12.04.html

Re: check_mrtgtraf

Posted: Tue Apr 25, 2017 4:58 pm
by jmac727
Thanks for the quick response. I was following that guide earlier and got to the

Code: Select all

env LANG=C /usr/bin/mrtg /usr/local/nagios/etc/mrtg.cfg
and it gave me an error attached.

Thanks!

Re: check_mrtgtraf

Posted: Tue Apr 25, 2017 10:31 pm
by tacolover101
what are the contents of the file you're running against mrtg? my guess is there may be an issue with it.

Code: Select all

/usr/local/nagios/etc/mrtg.cfg

Re: check_mrtgtraf

Posted: Wed Apr 26, 2017 8:17 am
by jmac727
As I state before, I'm brand new to Linux. I tried to navigate to the file in /usr/local/nagios/etc/mrtg.cfg and it says I don't have permission. I also can't copy/paste between the two machines even though I've enabled bidriectional in virtual box settings.

Any help is greatly appreciated.

Re: check_mrtgtraf

Posted: Wed Apr 26, 2017 8:38 am
by tgriep
Can you login to that system using the root account so you can view the mrtg.cfg file?
You may want to try using this guide I found and see if it helps you getting MRTG setup and how the check works.
http://bigunix.blogspot.com/2009/07/how ... g-and.html
Another option is to go to another plugin that doesn't require MRTG like the one in this link below.
https://exchange.nagios.org/directory/P ... 64/details

Re: check_mrtgtraf

Posted: Wed Apr 26, 2017 9:42 am
by jmac727
I've uploaded the mrtg.cfg into a .txt file in Windows for you to view.

I was following that first guide before and was unable to successfully complete it.

gunzip -c mrtg-2.16.2.tar.gz | tar xvf -
cd mrtg-2.16.2

was the part that it wouldn't do for me.

Re: check_mrtgtraf

Posted: Wed Apr 26, 2017 10:50 am
by tgriep
What was the error generated when you tried to go through the guide?

Re: check_mrtgtraf

Posted: Wed Apr 26, 2017 11:29 am
by jmac727
This is the error I get.

Re: check_mrtgtraf

Posted: Wed Apr 26, 2017 11:38 am
by tgriep
Run this command to extract MRTG tar zip file instead of the gunzip command.

Code: Select all

tar xvfz mrtg-2.17.4.tar.gz