---
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 <span class="nodinite-product-name" title="The node that unites different systems. Or as we call it Nodinite">Nodinite</span> 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][].

<h2 id="at-a-glance"><i class="fal fa-table" aria-hidden="true"></i> At a Glance</h2>

| 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 |

## <i class="fal fa-gears" aria-hidden="true"></i> How It Works

Every time a [Resource][Resources] changes its evaluated state (for example, from OK to Error), <span class="nodinite-product-name" title="The node that unites different systems. Or as we call it Nodinite">Nodinite</span> 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.

## <i class="fal fa-lightbulb" aria-hidden="true"></i> 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.

## <i class="fal fa-question" aria-hidden="true"></i> 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.

## <i class="fal fa-hand-point-right" aria-hidden="true"></i> Next Steps

* <i class="fal fa-clock-rotate-left" aria-hidden="true"></i> [Resource State History][]  
* <i class="fal fa-pen-to-square" aria-hidden="true"></i> [Manage System Parameters][]  

## <i class="fal fa-link-horizontal" aria-hidden="true"></i> Related Topics

* <i class="fal fa-compress" aria-hidden="true"></i> [DaysToKeepMonitorAgentBackups][]  
* <i class="fal fa-display" aria-hidden="true"></i> [Monitor Views][]  
* <i class="fal fa-watch-fitness" aria-hidden="true"></i> [Monitoring Service][]  
* <i class="fal fa-screwdriver-wrench" aria-hidden="true"></i> [Managing Monitoring Service][]  
* <i class="fal fa-sliders" aria-hidden="true"></i> [System Parameters][]  

[DaysToKeepMonitorAgentBackups]:https://docs.nodinite.com/administration/settings/system-parameters/daystokeepmonitoragentbackups/
[Log Databases]:https://docs.nodinite.com/core-services/log-databases/overview/
[Manage System Parameters]:https://docs.nodinite.com/administration/settings/system-parameters/manage-system-parameters/
[Managing Monitoring Service]:https://docs.nodinite.com/core-services/monitoring-service/features/managing-monitoring-service/
[Monitor Views]:https://docs.nodinite.com/administration/monitor-management/monitor-views/features/what-is-a-monitor-view/
[Monitoring Events]:https://docs.nodinite.com/core-services/monitoring-service/features/what-is-a-monitoring-event/
[Monitoring Service]:https://docs.nodinite.com/core-services/monitoring-service/overview/
[Permission Set for Monitor Views]:https://docs.nodinite.com/administration/access-management/roles/features/permission-set-for-monitor-views/
[Reports]:https://docs.nodinite.com/core-services/web-api/features/reports/overview/
[Resource State History]:https://docs.nodinite.com/getting-started/monitor/resource-state-history/
[Resources]:https://docs.nodinite.com/administration/monitor-management/resources/features/what-is-a-resource/
[Roles]:https://docs.nodinite.com/administration/access-management/roles/features/what-is-a-role/
[System Parameters]:https://docs.nodinite.com/administration/settings/system-parameters/overview/