Bobcares

Export config database in Nagios

by | May 19, 2021

Wondering how to export config database in Nagios? We can help you.

As part of our Server Management Services, we assist our customers with several Nagios queries.

Today, let us see how our Support Techs manually export the database.

 

Export config database in Nagios

 

Today, let us see how to manually export the Nagios XI configuration database.

1. Accessing The Configuration Database

First and foremost, we can access the configuration database by navigating to Configure > Config > Core Config Manager.

2. Exporting The Configuration

In CCM, expand Tools and select Config File Management.

Firstly, click the Write Configs option to export:

  • Hosts
  • Services
  • Hostgroups
  • Servicegroups
  • Host and service templates
  • Timeperiods
  • Commands
  • Contacts
  • Contactgroups
  • Escalations
  • Dependencies

Then, check the output for any error messages.

Basically, error messages will indicate if there are permissions problems that are encountered when exporting the configuration database entries to disk.

It is worth mentioning that CCM will not write any host or service configuration files if they have not been updated in the database.

3. Delete Config Files

Firstly, click the Delete Files option to delete all the host (/usr/local/nagios/etc/hosts/) and service (/usr/local/nagios/etc/services/) configuration files on the disk.

While this sounds destructive, it does not delete any of the configurations in the database, all it does is delete the files on the disk.

The purpose for this is to troubleshoot issues that can sometimes arise when old configuration files are left behind on the disk which in turn can cause unexpected issues when applying configuration.

After deleting the files, Write Configs so that all the host and service definitions are re-create.

When you click the delete or write buttons, make sure that any configuration files in /usr/local/nagios/etc/static/ are not touch.

4. Verifying the Configuration

Next, click Verify Files to verify the exported configuration files with Nagios Core.

Usually, warning messages will alert us to important configuration issues that may need to be address.

5. Restart Nagios Core

Then, click Restart Nagios Core to restart the Nagios Core monitoring engine.

This can be helpful if we want to test the written config files without performing an Apply Configuration.

6. Apply Configuration

Once we have successfully exported and verified the configuration, it is recommended that we use the Apply Configuration function to restart Nagios core with the new configuration.

Then, we can access this option by selecting the Apply Configuration menu item.

The apply configuration features will perform the following steps:

  •  Firstly, export the database configuration to disk
  •  Secondly, verify the configuration files
  •  Then, restart Nagios Core
  • Finally, create a new configuration snapshot

It is important to use Apply Configuration after making changes, it performs the additional steps described above to ensure Nagios XI has a stable monitoring configuration.

 

[Need help with the procedures with Nagios? We are here for you]

Conclusion

In short, Manual exports are useful when debugging configuration problems, including failures of Nagios XI to apply new configuration changes. Today, we saw how our Support Techs export config database.

PREVENT YOUR SERVER FROM CRASHING!

Never again lose customers to poor server speed! Let us help you.

Our server experts will monitor & maintain your server 24/7 so that it remains lightning fast and secure.

GET STARTED

var google_conversion_label = "owonCMyG5nEQ0aD71QM";

2 Comments

  1. Asiansuntrading

    Dear sir/Madam,
    I have a question about mass updating. In CCM when I update a host and add a contact to it, I will see a record in tbl_lnkHostToContact table in nagiosql database that idMaster is the id of the host and the idSlave is the id of the contact but when I remove the contact via CCM and apply that, then I add the same record from the nagiosql database, it is not added to CCM. I mean I can not add a contact to a host via nagiosql database.
    With my many thanks and best wishes,

    Asiansuntrading Team

    Reply
    • Hiba Razak

      Hi,
      Please contact our support team via live chat(click on the icon at right-bottom).

      Reply

Submit a Comment

Your email address will not be published. Required fields are marked *

Never again lose customers to poor
server speed! Let us help you.

Privacy Preference Center

Necessary

Necessary cookies help make a website usable by enabling basic functions like page navigation and access to secure areas of the website. The website cannot function properly without these cookies.

PHPSESSID - Preserves user session state across page requests.

gdpr[consent_types] - Used to store user consents.

gdpr[allowed_cookies] - Used to store user allowed cookies.

PHPSESSID, gdpr[consent_types], gdpr[allowed_cookies]
PHPSESSID
WHMCSpKDlPzh2chML

Statistics

Statistic cookies help website owners to understand how visitors interact with websites by collecting and reporting information anonymously.

_ga - Preserves user session state across page requests.

_gat - Used by Google Analytics to throttle request rate

_gid - Registers a unique ID that is used to generate statistical data on how you use the website.

smartlookCookie - Used to collect user device and location information of the site visitors to improve the websites User Experience.

_ga, _gat, _gid
_ga, _gat, _gid
smartlookCookie
_clck, _clsk, CLID, ANONCHK, MR, MUID, SM

Marketing

Marketing cookies are used to track visitors across websites. The intention is to display ads that are relevant and engaging for the individual user and thereby more valuable for publishers and third party advertisers.

IDE - Used by Google DoubleClick to register and report the website user's actions after viewing or clicking one of the advertiser's ads with the purpose of measuring the efficacy of an ad and to present targeted ads to the user.

test_cookie - Used to check if the user's browser supports cookies.

1P_JAR - Google cookie. These cookies are used to collect website statistics and track conversion rates.

NID - Registers a unique ID that identifies a returning user's device. The ID is used for serving ads that are most relevant to the user.

DV - Google ad personalisation

_reb2bgeo - The visitor's geographical location

_reb2bloaded - Whether or not the script loaded for the visitor

_reb2bref - The referring URL for the visit

_reb2bsessionID - The visitor's RB2B session ID

_reb2buid - The visitor's RB2B user ID

IDE, test_cookie, 1P_JAR, NID, DV, NID
IDE, test_cookie
1P_JAR, NID, DV
NID
hblid
_reb2bgeo, _reb2bloaded, _reb2bref, _reb2bsessionID, _reb2buid

Security

These are essential site cookies, used by the google reCAPTCHA. These cookies use an unique identifier to verify if a visitor is human or a bot.

SID, APISID, HSID, NID, PREF
SID, APISID, HSID, NID, PREF