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.
jmac727
Posts: 35
Joined: Tue Apr 25, 2017 4:37 pm

Re: check_mrtgtraf

Post by jmac727 »

Still getting a similar error.
Attachments
tarerror.png
jmac727
Posts: 35
Joined: Tue Apr 25, 2017 4:37 pm

Re: check_mrtgtraf

Post 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 public@172.17.42.22

and I don't have an /etc/httpd/ folder. What should have made that folder?
User avatar
tgriep
Madmin
Posts: 9177
Joined: Thu Oct 30, 2014 9:02 am

Re: check_mrtgtraf

Post 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.
Be sure to check out our Knowledgebase for helpful articles and solutions!
jmac727
Posts: 35
Joined: Tue Apr 25, 2017 4:37 pm

Re: check_mrtgtraf

Post 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?
jmac727
Posts: 35
Joined: Tue Apr 25, 2017 4:37 pm

Re: check_mrtgtraf

Post 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?
jmac727
Posts: 35
Joined: Tue Apr 25, 2017 4:37 pm

Re: check_mrtgtraf

Post 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?
User avatar
tgriep
Madmin
Posts: 9177
Joined: Thu Oct 30, 2014 9:02 am

Re: check_mrtgtraf

Post 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 public@192.168.1.1: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.
Be sure to check out our Knowledgebase for helpful articles and solutions!
jmac727
Posts: 35
Joined: Tue Apr 25, 2017 4:37 pm

Re: check_mrtgtraf

Post 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.
Attachments
mrtg.png
cfgmaker.png
dwhitfield
Former Nagios Staff
Posts: 4583
Joined: Wed Sep 21, 2016 10:29 am
Location: NoLo, Minneapolis, MN
Contact:

Re: check_mrtgtraf

Post 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.
jmac727
Posts: 35
Joined: Tue Apr 25, 2017 4:37 pm

Re: check_mrtgtraf

Post by jmac727 »

Thanks for the quick response. Here is the file it created.
Attachments
supporttar.tar.gz
(8.14 KiB) Downloaded 261 times
Locked