This is a cache of https://support.nagios.com/kb/article/nagios-xi-removing-all-historical-data-812.html. It is a snapshot of the page at 2025-05-14T00:09:54.049+0000.
Nagios <strong>xi</strong> - Removing All Historical Data
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/



Special Offer For Knowledgebase Visitors! Get a huge discount on Nagios Log Server by clicking below.

Get 60% Off Nagios Log Server!

Did you know? Nagios provides complete monitoring of: Windows, Linux, UNIX, Servers, Websites, SNMP, DHCP, DNS, Email, Storage, Files, Apache, IIS, EC2, and more!

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 - Nagios Rapid Deployment Options - NWC14
Viewed 4935 times since Tue, Feb 9, 2016
Nagios xi - Configuring Core Contacts to Use xi’s phpmailer SMTP Settings
Viewed 7721 times since Wed, Jan 27, 2016
Nagios xi - Importing Config Files From Nagios Core into Nagios xi
Viewed 16721 times since Wed, Jan 27, 2016
Nagios xi - Understanding Notification Variables
Viewed 8801 times since Thu, Jan 28, 2016
Nagios xi - High Availability and Failover Solutions for Nagios xi - NWC14
Viewed 8667 times since Thu, Feb 4, 2016
Nagios xi - Database Optimization
Viewed 7917 times since Thu, Jan 28, 2016
Nagios xi - Mod-Gearman Queues and Workers
Viewed 49289 times since Fri, Mar 4, 2016
Nagios xi - Custom Wizards, Components and Dashlets - NWC12
Viewed 9555 times since Thu, Feb 4, 2016
Database Storage Engine and High CPU usage in Nagios xi
Viewed 5397 times since Thu, Mar 4, 2021
Nagios xi - Integrating autoIT With Nagios
Viewed 5788 times since Wed, Jan 27, 2016