Products
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.logretention.datobjects.cache/usr/local/nagios/var/archives/*
/usr/local/nagios/share/perfdata/*
/var/lib/mrtg/*
/usr/local/nagiosxi/var/
*.log*.lock*.data*.diff/usr/local/nagiosxi/var/components/*.log/usr/local/nagiosxi/var/upgrades/*
/usr/local/nagiosxi/tmp/*
nagios) tables
nagios_acknowledgementsnagios_commenthistorynagios_commentsnagios_downtimehistorynagios_flappinghistorynagios_logentriesnagios_objectsnagios_notificationsnagios_processeventsnagios_statehistorynagios_timedeventsnagiosxi) tables [PostgreSQL or MySQL/MariaDB]
xi_auditlogxi_commandsxi_eventqueuexi_eventsxi_metaWarning
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.
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.
For any support related questions please visit the Nagios Support Forums at:
© All rights reserved. 2026