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 - Migrating From Nagios Core
Viewed 805 times since Thu, Jan 28, 2016
Nagios XI - Understanding Notification Variables
Viewed 987 times since Thu, Jan 28, 2016
Nagios XI - Using The Config Import Prep Tool
Viewed 804 times since Thu, Jan 28, 2016
Nagios XI - High Availability and Failover Solutions for Nagios XI - NWC14
Viewed 1062 times since Thu, Feb 4, 2016
Nagios XI - Redundancy And Security Planning
Viewed 537 times since Sun, Mar 25, 2018
Nagios XI - Mass Delete Old RRD Files
Viewed 185 times since Tue, Sep 10, 2019
Nagios XI - Plain Text Password Considerations
Viewed 1464 times since Mon, Jun 18, 2018
SNMP Traps - Standard Handler vs Embedded Handler
Viewed 2247 times since Mon, Oct 24, 2016
Nagios XI - Upgrading To PHP 7
Viewed 228 times since Tue, Oct 22, 2019
Nagios XI - Understanding Notification Escalations
Viewed 778 times since Thu, Jan 28, 2016