Page 2 of 7

Re: check_mrtgtraf

Posted: Wed Apr 26, 2017 11:53 am
by jmac727
Still getting a similar error.

Re: check_mrtgtraf

Posted: Wed Apr 26, 2017 12:14 pm
by jmac727
Update: Following the guide you linked me to, I was able to unzip and got to:

cfgmaker --global 'WorkDir: /var/www/html/mrtg' --global 'Options[_]: bits,growright' --output /etc/httpd/conf/mrtg.cfg [email protected]

and I don't have an /etc/httpd/ folder. What should have made that folder?

Re: check_mrtgtraf

Posted: Wed Apr 26, 2017 1:54 pm
by tgriep
Instead of using of having to setup MRTG, the Apache Web server, the plugin, it would be easier to use this plugin that does not need all of those running.
https://exchange.nagios.org/directory/P ... 64/details
One plugin, one command, worst case, you will need to install some Perl Modules but it should work for you.

Re: check_mrtgtraf

Posted: Thu Apr 27, 2017 11:44 am
by jmac727
I really want to get it running with this setup. I have MRTG functioning. If I go to http://localhost/mrtg I get the graphs, but I still get the error in Nagios that it can't open the log file.

Is there any thing else I can do?

Re: check_mrtgtraf

Posted: Thu Apr 27, 2017 11:59 am
by jmac727
Also in my switch.cfg the command its using is check_local_mrtgraf and not just check_mrtgraf. I don't have a _local_ one, only check_mrtgraf. Should I change that?

Re: check_mrtgtraf

Posted: Thu Apr 27, 2017 12:14 pm
by jmac727
Another update, there are no log files being created in /var/lib/mrtg. I feel like this shouldn't be that difficult. What am I missing?

Re: check_mrtgtraf

Posted: Thu Apr 27, 2017 1:38 pm
by tgriep
There are 2 ways to setup MRTG, one for viewing graphs using the Web server, and one for the check_mrtgtraf.
You would have to reconfigure MRTG to create the rrd files in the /var/lib/mrtg folder.
An example /etc/mrtg/mrtg.cfg config file would look like this.

Code: Select all

######################################################################
# Multi Router Traffic Grapher -- Example Configuration File
######################################################################
# This file is for use with mrtg-2.0
#
# Note:
#
# * Keywords must start at the begin of a line.
#
# * Lines which follow a keyword line which do start 
#   with a blank are appended to the keyword line
#
# * Empty Lines are ignored
#
# * Lines starting with a # sign are comments.

# Where should the logfiles, and webpages be created?

# Minimal mrtg.cfg
#--------------------

HtmlDir: /var/www/mrtg
ImageDir: /var/www/mrtg
LogFormat: rrdtool
LogDir: /var/lib/mrtg
ThreshDir: /var/lib/mrtg
WorkDir: /var/lib/mrtg
Forks: 4
EnableSnmpV3: yes

Include: conf.d/*.cfg

EnableSNMPv3: yes
So make sure your system is changed to this setting and that the switch or router configs are in the /etc/mrtg/conf.d folder.
An example cfgmaker command you can use to create those config is below. Adjust the settings for your environment.

Code: Select all

/usr/bin/cfgmaker --show-op-down --noreversedns --zero-speed 100000000 [email protected]:161::::2 >/etc/mrtg/conf.d/192.168.1.1.cfg
Then if cron is running, within 15 minutes, the check_mrtgtraf should start to work and gather the bandwidth for you.
Try that and see if helps out.

Re: check_mrtgtraf

Posted: Thu Apr 27, 2017 2:32 pm
by jmac727
Thank you so much for all your help.

I added what you sent to the mrtg.cfg and attached a picture to make sure that was correct.

When I tried to use the cfgmaker to make the swtichip.cfg I was informed I don't have a /etc/mrtg/conf.d/ directory.

Thanks again for all your help.

Re: check_mrtgtraf

Posted: Thu Apr 27, 2017 2:49 pm
by dwhitfield
Please run tar -zcvf /tmp/supporttar.tar.gz /etc/mrtg and attach the zip file it creates.

Also, I wonder if Cacti is a better option for you. https://assets.nagios.com/downloads/nag ... ide_XI.pdf is written for XI and CentOS, but you can probably find ubuntu documentation on the web somewhere.

Re: check_mrtgtraf

Posted: Thu Apr 27, 2017 3:04 pm
by jmac727
Thanks for the quick response. Here is the file it created.