---
title: DaysToKeepMonitorEvents - System Parameter for Monitoring Event Retention
description: DaysToKeepMonitorEvents sets how many days Nodinite keeps Monitoring Events, the history of Resource state changes used by Monitor View history and reports. Default 32; purged hourly by the Monitoring Service.
---

# DaysToKeepMonitorEvents - System Parameter

**DaysToKeepMonitorEvents** sets how many days :Nodinite: keeps [Monitoring Events][], the history of state changes on your [Resources][]. The [Monitoring Service][] reads it when it purges old Monitoring Events from the [Log Databases][].

## :fa-table: At a Glance {#at-a-glance}

| Property | Value |
| --- | --- |
| Key | `DaysToKeepMonitorEvents` |
| Data type | integer (days) |
| Default | `32` on a new installation; an update keeps the existing value |
| Read by | [Monitoring Service][] |
| Takes effect | At the next hourly Monitoring Service cleanup, within the hour (the cleanup caches the value for up to 15 minutes). No restart needed. |
| Status | ✅ Active |
| Since | Nodinite 4 |

## :fa-gears: How It Works

Every time a [Resource][Resources] changes its evaluated state (for example, from OK to Error), :Nodinite: writes a [Monitoring Event][Monitoring Events] to the active [Log Database][Log Databases]. These events are the state change history behind:

* The history in [Monitor Views][] for users whose [Role][Roles] has the [View History][Permission Set for Monitor Views] permission.
* The [Resource State History][] view.
* Custom [Reports][] that count faults or calculate availability.

This retention applies to all Monitoring Events. Once an hour, the [Monitoring Service][] deletes Monitoring Events older than **DaysToKeepMonitorEvents** days. Purged events are gone from the Resource State History and from Monitor View history.

## :fa-lightbulb: Choosing a Value

* The default `32` days covers about a month. In production, consider at least `90` days, so you can compare incidents across a quarter.
* Raise the value when your reports or audits need a longer state change history; the [Log Databases][] grow accordingly.
* Lower it in large environments with many Resources that change state often, if Log Database size matters more than history.

## :fa-question: Frequently Asked Questions

### Can I get purged Monitoring Events back?

No. Once the Monitoring Service has purged them, they are gone. Raise the value **before** you need the longer history.

## :fa-hand-point-right: Next Steps

* :fa-clock-rotate-left: [Resource State History][]  
* :fa-pen-to-square: [Manage System Parameters][]  

## :fa-link-horizontal: Related Topics

* :fa-compress: [DaysToKeepMonitorAgentBackups][]  
* :fa-display: [Monitor Views][]  
* :fa-watch-fitness: [Monitoring Service][]  
* :fa-screwdriver-wrench: [Managing Monitoring Service][]  
* :fa-sliders: [System Parameters][]  

[DaysToKeepMonitorAgentBackups]:{ndr}/Administration/5.%20Settings/5.%20System%20Parameters/DaysToKeepMonitorAgentBackups.md
[Log Databases]:{ndr}/Core%20Services/Log%20Databases/Overview.md
[Manage System Parameters]:{ndr}/Administration/5.%20Settings/5.%20System%20Parameters/Manage%20System%20Parameters.md
[Managing Monitoring Service]:{ndr}/Core%20Services/Monitoring%20Service/Features/Managing%20Monitoring%20Service.md
[Monitor Views]:{ndr}/Administration/2.%20Monitor%20Management/1.%20Monitor%20Views/Features/What%20is%20a%20Monitor%20View.md
[Monitoring Events]:{ndr}/Core%20Services/Monitoring%20Service/Features/What%20is%20a%20Monitoring%20Event.md
[Monitoring Service]:{ndr}/Core%20Services/Monitoring%20Service/Overview.md
[Permission Set for Monitor Views]:{ndr}/Administration/3.%20Access%20Management/1.%20Roles/Features/Permission%20Set%20for%20Monitor%20Views.md
[Reports]:{ndr}/Core%20Services/Web%20API/Features/Reports/Overview.md
[Resource State History]:{ndr}/Getting%20Started/3.%20Monitor/Resource%20State%20History.md
[Resources]:{ndr}/Administration/2.%20Monitor%20Management/3.%20Resources/Features/What%20is%20a%20Resource.md
[Roles]:{ndr}/Administration/3.%20Access%20Management/1.%20Roles/Features/What%20is%20a%20Role.md
[System Parameters]:{ndr}/Administration/5.%20Settings/5.%20System%20Parameters/Overview.md