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/

5 (1)
Article Rating (1 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 - Log Locations and Descriptions
Viewed 8736 times since Thu, Jan 28, 2016
Nagios XI - Special Characters
Viewed 22008 times since Tue, Apr 25, 2017
Nagios XI - Offloading MySQL to Remote Server
Viewed 6704 times since Thu, Jan 28, 2016
Nagios XI - Advanced Features of Nagios XI - NWC14
Viewed 4233 times since Thu, Feb 4, 2016
Database Storage Engine and High CPU usage in Nagios XI
Viewed 3821 times since Thu, Mar 4, 2021
Nagios XI - Introduction to Event Handlers
Viewed 7354 times since Thu, Jan 28, 2016
Nagios XI Wizards Achitecture
Viewed 3669 times since Thu, Jan 29, 2015
Nagios XI - 10,000 Services and growing - NWC14
Viewed 6690 times since Mon, Feb 8, 2016
Nagios XI - Create "Actions URL" Link In Quick Actions Menu
Viewed 23058 times since Tue, Feb 2, 2016
Nagios XI - Adding Services To Pre-existing Switch or Router
Viewed 8306 times since Wed, Jan 27, 2016