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 - How To Write Custom Components
Viewed 692 times since Thu, Jan 28, 2016
Nagios XI - Plain Text Password Considerations
Viewed 1063 times since Mon, Jun 18, 2018
Nagios XI - Integrating autoIT With Nagios
Viewed 583 times since Wed, Jan 27, 2016
Converting PostgreSQL to MySQL for Nagios XI
Viewed 1284 times since Tue, Dec 6, 2016
Nagios XI - Group Deployment of Service Checks - NWC15
Viewed 644 times since Mon, Feb 8, 2016
Nagios XI - Scheduling Reports and Pages
Viewed 468 times since Thu, Jan 28, 2016
Nagios Core - Understanding retention.dat and modified_attributes
Viewed 1483 times since Fri, Jul 15, 2016
Nagios XI - Utilizing a RAM Disk in Nagios XI
Viewed 641 times since Thu, Jan 28, 2016
Nagios XI - Advanced Features of Nagios XI - NWC14
Viewed 484 times since Thu, Feb 4, 2016
Nagios XI - Profile Build Failed
Viewed 1049 times since Tue, Aug 2, 2016