Home » Categories » Products » Nagios XI » Documentation » Advanced Topics

Nagios XI - Removing All Historical Data

Overview

This KB article explains how you can execute a script in Nagios XI to remove all historical data on the Nagios XI server. This functionality was introduced as of Nagios XI 5.5.

The data removed by the script is outlined as follows:

  • /usr/local/nagios/var/
    • nagios.log
    • retention.dat
    • objects.cache
  • /usr/local/nagios/var/archives/*
    • All files and sub-folders
  • /usr/local/nagios/share/perfdata/*
    • All files and sub-folders
  • /var/lib/mrtg/*
    • All files and sub-folders
  • /usr/local/nagiosxi/var/
    • *.log
    • *.lock
    • *.data
    • *.diff
  • /usr/local/nagiosxi/var/components/*.log
  • /usr/local/nagiosxi/var/upgrades/*
    • All files and sub-folders
  • /usr/local/nagiosxi/tmp/*
    • All files and sub-folders
  • NDO Database (nagios) tables
    • nagios_acknowledgements
    • nagios_commenthistory
    • nagios_comments
    • nagios_downtimehistory
    • nagios_flappinghistory
    • nagios_logentries
    • nagios_objects
    • nagios_notifications
    • nagios_processevents
    • nagios_statehistory
    • nagios_timedevents
  • Nagios XI Database (nagiosxi) tables [PostgreSQL or MySQL/MariaDB]
    • xi_auditlog
    • xi_commands
    • xi_eventqueue
    • xi_events
    • xi_meta
 
Warning

By executing this script you will lose all historical data explained above, the only way to restore the data is from a backup. It is advised that you create a backup before proceeding as per the Backing Up And Restoring Your Nagios XI System documentation.

 

 

Executing The Script

Establish a terminal session to your Nagios XI server as the root user and execute the following command:

/usr/local/nagiosxi/scripts/remove_historical_data.sh

 

You will first be warned and asked if you want to proceed:

========================
        WARNING!
========================

This script will remove ALL historical perfdata on your system. This action is permanent.
We recommend running the backup script before proceeding.

Do you want to continue? [Y/n]

 

Once you answer y the script will remove all the existing historical data, the output will be similar to:

Proceeding...
Stopping nagios: done.
Stopping ndo2db: done.
Removing historical data from disk...
Removing historical data in Nagios XI database...
Starting ndo2db: done.
Starting nagios: done.
Done.

 

After the script has completed Nagios XI will be operational again without all of the existing historical data.

 

 

Final Thoughts

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

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

0 (0)
Article Rating (No Votes)
Rate this article
  • Icon PDFExport to PDF
  • Icon MS-WordExport to MS Word
Attachments Attachments
There are no attachments for this article.
Related Articles RSS Feed
Nagios XI - Restarting A Linux Service With NRPE
Viewed 423 times since Thu, Jan 28, 2016
Nagios XI - Distributed Monitoring With NRDP
Viewed 362 times since Thu, Aug 17, 2017
Nagios XI - Offloading NDO2DB To Remote Server
Viewed 229 times since Tue, Dec 18, 2018
Nagios XI - Integrating Mod-Gearman With Nagios XI
Viewed 517 times since Thu, Jan 28, 2016
Nagios XI - Configuring Core Contacts to Use XI’s phpmailer SMTP Settings
Viewed 388 times since Wed, Jan 27, 2016
Nagios XI - Plain Text Password Considerations
Viewed 496 times since Mon, Jun 18, 2018
Nagios XI - Configuring Global Event Handlers
Viewed 355 times since Wed, Jan 27, 2016
Nagios XI - Monitoring Using the Full Power of Nagios XI Enterprise - NWC15
Viewed 355 times since Mon, Feb 8, 2016
Nagios XI - Special Characters
Viewed 1300 times since Tue, Apr 25, 2017
Nagios XI - BPI XML Cache
Viewed 271 times since Thu, Mar 9, 2017