Page 1 of 1

Quick question re: Adding Service Switch or Router

Posted: Tue Apr 12, 2016 1:34 pm
by CarlWedu
Following along with these:

https://assets.nagios.com/downloads/nag ... Router.pdf


and this file: /etc/mrtg/mrtg.cfg contains essentially nothing. Is that a problem?

[root@nagiosxi /]# cd /etc/mrtg
[root@nagiosxi mrtg]# more mrtg.cfg
######################################################################
# 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

Include: conf.d/*.cfg
Forks: 4
[root@nagiosxi mrtg]#

Re: Quick question re: Adding Service Switch or Router

Posted: Tue Apr 12, 2016 1:41 pm
by CarlWedu
Looks like that Include: conf.d/*.cfg references a large list of .cfg files that contain information similar to what was expected in the mrtg.cfg file. Would I:

1 - Edit the mrtg.cfg to remove the include line, delete hosts and services with CCM and then re-add my devices with the wizard?
2 - Remove the contents of the conf.d directory, delete hosts and services with CCM and then re-add my devices with the wizard?
3 - Other idea?


in order to remove as much of the previous network device hosts and services as possible to establish a clean slate to rebuild?

Historical data is of no consequence here for network devices; am trying to keep the server data for the time being.

Re: Quick question re: Adding Service Switch or Router

Posted: Tue Apr 12, 2016 2:23 pm
by bheden
We have a release coming in the not-too-distant future that will handle the removal of all the .cfg files in the /etc/mrtg/conf.d/ directory, but until then, you'll have to manually remove them.

You don't have to comment out anything in the main mrtg.cfg file, you are safe to just remove whatever you no longer want MRTG to monitor via its corresponding *.cfg file. I'd make a backup first, but thats just me. You can restore it to MRTG by simply placing it back in that directory.

If you want all the historical data (from MRTG) gone, you need to delete the corresponding files from /var/lib/mrtg. If you remove files that correlate to each other in both places, AND have a service set up in Nagios XI that checks the values of the RRD file that was present in the /var/lib/mrtg directory, it WILL error - so you'll need to remove the service from XI as well.

If you just remove the bandwidth services from XI, as of right now, that is literally all it does - MRTG is still probing that device on the backend.

I hope I understood your question well enough!

Re: Quick question re: Adding Service Switch or Router

Posted: Tue Apr 12, 2016 2:35 pm
by CarlWedu
Yes, thank you! If a particular sequence is better for the order of the removal steps, please advise and/or this can be resolved.

Re: Quick question re: Adding Service Switch or Router

Posted: Tue Apr 12, 2016 2:45 pm
by bheden
My preference is to remove the services from XI first - that way you don't get any nasty errors when you go messin around in the MRTG configuration.

Other than that, you need to remove the /etc/mrtg/conf.d/*.cfg file before you remove its corresponding /var/lib/mrtg/*.rrd file, otherwise the rrd file will just be recreated the next time MRTG runs.

So there you have it:

Remove XI Service -> Remove MRTG Configuration -> Remove MRTG RRD

Re: Quick question re: Adding Service Switch or Router

Posted: Tue Apr 12, 2016 2:53 pm
by CarlWedu
Perfect. Thank you!!

/resolved