Nagios XI - ERROR: unable to open include file: /etc/mrtg/conf.d/xxxxxxx.cfg


Problem Description

Bandwidth graphs in Nagios XI are showing no bandwidth.

When manually executing MRTG you see the following output:

MRTG Manual Command:

LANG=C LC_ALL=C /usr/bin/mrtg /etc/mrtg/mrtg.cfg

This error is produced:

ERROR: unable to open include file: /etc/mrtg/conf.d/xxxxxxx.cfg

 

The source of the problem is that you have 1000+ cfg files in the /etc/mrtg/conf.d/ directory. When MRTG runs it has to open all the files and it hits the open file limits in Linux.

 

 

Editing Files

In this article you will be required to edit files. This documentation will use the vi text editor. When using the vi
editor:

 

 

Resolution

These steps will increase the open file limits from the default of 1024 to 4096.

Establish an SSH session to your Nagios XI server and edit the file /etc/security/limits.conf

Add the following lines to the end of the file:

* soft nofile 10000
* hard nofile 10000

Save the file.

 

Now try running MRTG manually should no longer produce the "ERROR: unable to open include file: /etc/mrtg/conf.d/xxxxxxx.cfg" message:

LANG=C LC_ALL=C /usr/bin/mrtg /etc/mrtg/mrtg.cfg

 

If you still experience the error, please reboot the server and try running MRTG again.

 

It will take at least 15 minutes for the bandwidth graphs to start showing data.

 

Final Thoughts

For any support related questions please visit the Nagios Support Forums at:

http://support.nagios.com/forum/



Article ID: 512
Created On: Wed, Jun 1, 2016 at 6:09 PM
Last Updated On: Tue, Dec 4, 2018 at 6:35 PM
Authored by: tlea

Online URL: https://support.nagios.com/kb/article/nagios-xi-error-unable-to-open-include-file-etc-mrtg-conf-d-xxxxxxx-cfg-512.html