Cleaning up lost resources in Zabbix discovery

Zabbix low-level discovery can disable and delete items, triggers and hosts for resources that have disappeared, but only if the delete and disable settings are planned around your update intervals and manual changes.

On this page

Why stale Zabbix discovery resources pile up and how to stop them

Disks, network interfaces and virtual machines disappear all the time, and when they do, the items, triggers and hosts that Zabbix created for them stay behind unless something removes them. The Delete lost resources and Disable lost resources settings on a low-level discovery rule control that cleanup. Each setting takes one of three values: Never, Immediately or After a period. Together they decide whether a resource that no longer appears in discovery is disabled, deleted, or left alone, and how long Zabbix waits before acting. Teams need these settings as soon as their monitored estate changes faster than someone can tidy the configuration by hand, such as hypervisors with frequent VM churn, hosts with hot-swapped disks, or cloud accounts where instances are created and destroyed every day.

The settings have clear limits. They act only on resources that a discovery rule created, so items, triggers and hosts you added by hand are outside their reach. They also do not fix the cause of the churn, such as a discovery filter that is too broad or a template that discovers resources you never intended to monitor. Before you set a period, confirm the discovery rule's update interval, because the Zabbix documentation requires the delete period to be longer than the disable period and expects the disable period to exceed the update interval. Check the exact rules for your version in the Zabbix low-level discovery documentation before you change production rules.

How a lost resource moves from discovered to disabled to deleted

The lifecycle starts when a discovery rule finds a resource and creates its items, triggers and hosts. On each rule update, a resource that is still returned stays active. When it is no longer returned, the rule first disables it after the disable lost resources period, then deletes it after the delete lost resources period. A resource that comes back before deletion is re-enabled only if LLD disabled it. A resource disabled by hand stays disabled and LLD never deletes it, so check each branch before changing either period.

Automatic and manual paths for a resource that disappears from discovery.

Lost resource settings and when each fits

This table compares the Delete lost resources and Disable lost resources settings on a discovery rule, with Never, Immediately or After a period for each. Read each row as a resource type or situation, and use the cell to pick the setting that matches how long a missing resource should stay visible. The main takeaway is that the delete period must be longer than the disable period, so a delayed delete only works when both timers are set in that order.

Setting or situationChoose this valueWhy it fitsCheck before you set it
Disable lost resourcesAfter a periodHides items that stop returning data while keeping them available if the resource comes backPeriod should exceed the rule's update interval
Disable lost resourcesImmediatelySuits resources that never flap, such as fixed hardware whose removal is always deliberateShort network or agent gaps will disable items right away
Disable lost resourcesNeverSuits resources that come and go on purpose and must stay visible for audit or historyStale items will accumulate until someone removes them
Delete lost resourcesAfter a periodRemoves items, triggers and hosts only after a grace window, so a briefly missing disk is not lostDelete period must be longer than the disable period
Delete lost resourcesImmediatelySuits short-lived resources such as containers or ephemeral VMs with no history worth keepingHistorical data for the removed items goes with them
Delete lost resourcesNeverSuits resources where history and manual configuration must survive for yearsLists will grow and need periodic review
Disk or interface with planned replacementAfter a period for delete, Never for disableKeeps history while the resource is swapped, then removes it laterConfirm the replacement reuses or creates new keys
Manually disabled resourceNot affected by either settingManual disables stay in place and LLD does not delete themRe-enable or remove by hand when the resource is decommissioned

Configuring lost resource cleanup on a discovery rule

This sequence sets the delete and disable lost resources settings on one discovery rule so that stale items, triggers and hosts are removed on a predictable schedule. It ends with confirmed behavior on a test host and a clean frontend view before the settings reach production.

  1. Record the rule's update interval

    Open the discovery rule in the frontend under Data collection, then Hosts, and note the Update interval value. This interval is the reference point for every later setting, so write it down with the rule name and the host or template that owns it. Check that the value matches what the rule actually runs on, including any custom schedule set on the rule. You are done when the interval is recorded alongside a screenshot or export of the rule's settings.

  2. Choose the disable lost resources period

    Set Disable lost resources to After a period and enter a value longer than the rule's update interval. Zabbix needs the disable period to exceed the interval so that one missed discovery run does not disable a resource that still exists. Agree the value with the team that owns the monitored platform, since a short period can hide resources during a temporary network or API outage. You are done when the value is saved and the rule's update interval check passes on review.

  3. Set a longer delete lost resources period

    Set Delete lost resources to After a period with a value greater than the disable period you chose. Zabbix requires the delete period to be longer than the disable period, so resources have a window to return before they are removed. Confirm the saved values in the rule form before leaving it, because an invalid pair blocks the save. You are done when both settings are stored and the delete value is visibly larger than the disable value.

  4. Test the behavior on one host

    Pick one host that the rule discovers, and simulate a lost resource by removing a disk, interface or VM from it in a test environment, or by waiting for a real change on a non-critical host. Let the rule run past the disable period and check that the affected items and triggers become disabled. Then restore the resource and confirm that the automatically disabled items are re-enabled on rediscovery. You are done when both transitions are observed and recorded in the change ticket.

  5. Confirm a manually disabled resource stays disabled

    On the same test host, disable one discovered item by hand and let the rule run through a full cycle. Zabbix re-enables resources it disabled itself, but manually disabled resources remain disabled and LLD does not delete them. Confirm that the manual item still shows as disabled after the cycle, and note this behavior in the runbook so operators know which disables LLD will not reverse. You are done when the manual item is still disabled and the note is filed.

  6. Verify the frontend shows the expected state

    In the frontend, check the host's Items, Triggers and Discovery rule lists for the test host. Disabled resources should appear with a disabled status, and deleted resources should no longer appear once the delete period has passed. Also check the discovered resource list on the rule itself to confirm that counts match what the test produced. You are done when the item, trigger and discovery views agree with the expected result for each scenario.

  7. Roll the settings out to the production rule

    Apply the tested values to the production discovery rule, using the same disable and delete periods checked on the test host. If the rule is inherited from a template, make the change in the template and confirm the change reaches linked hosts. Record the final values, the date of the change and the owner, then schedule a review of stale-resource counts after the first full delete period has passed. You are done when the production rule shows the approved values and the review is on the team's calendar.

Choosing settings for disks, interfaces and VMs

Filesystems and disks usually disappear for planned reasons: a volume is unmounted for maintenance, a disk is replaced, or a mount point is retired during a storage change. Such events are infrequent on a stable host, but they can be long-lived when a volume stays unmounted for days. A short disable period makes sense for the filesystem discovery rule so that a briefly unmounted volume stops generating noise, while a longer delete period keeps history intact for volumes that are expected to return.

  • Planned maintenance: A volume unmounted for a patch window should be disabled quickly and re-enabled automatically when it returns.
  • Retired mount points: A decommissioned filesystem should be deleted after a period long enough to rule out a temporary mount problem.
  • Mount options and pseudo filesystems: Filter out transient or container-managed mounts in the rule itself, so they never become lost resources.
  • Trigger impact: Disk space triggers on a disabled item stop evaluating, so confirm that no capacity alert depends on a volume that is expected to be absent.
  • Rule interval: The disable period must exceed the rule's update interval, so set it after you have confirmed the interval in your environment.

Confirm the expected unmount and replacement frequency with your storage team before you choose values for each host group.

How re-discovered items come back and why manual disables stay disabled

The rule that matters most here is simple: automatically disabled resources come back when LLD finds them again, but manually disabled resources stay disabled. Discovery treats the two states differently. If a disk, interface or VM disappears, the disable step turns its items, triggers and related objects off, and the next discovery run that sees the resource re-enables them. Those re-enabled items keep their original item IDs, so the history and trend data collected before the disappearance remain attached to them. Nothing is created from scratch unless the delete step has already removed the objects.

That behavior has a practical consequence for anyone who disables an item by hand to silence noise. LLD does not treat that manual disable as a lost resource, so it never re-enables the item and never deletes it, even when the resource is rediscovered. A manual disable that was meant to be temporary can therefore hide a monitored resource for months. Review manually disabled items on a schedule, and confirm in your own environment that the discovery rule's filters and prototypes still produce the items you expect.

After a host is replaced, rebuilt or renamed, check the history and trend graphs before you trust them. A replacement VM usually gets new discovered objects, so the old history stays on the old items and the new items start empty. A rename of a discovered key or interface can produce the same split. Confirm the retention settings with your Zabbix administrator, since history older than the housekeeping period is gone, and document which host or item carries the continuous series for capacity reviews and audits.

Operational risks of aggressive cleanup

Lost resource settings remove items, triggers and hosts automatically, so a wrong period or a wrong assumption can delete monitoring you still need. The cards below cover the failure modes to test before you pick Delete and Disable periods, and the control that prevents each one.

Deleted resources return after maintenance

A host or disk that is offline for a planned outage can look lost to discovery. If the delete period is too short, LLD removes its items and triggers, and the history stored against them stops being visible in the same form when the resource comes back. Check how long your longest maintenance windows and patch cycles last, and set the delete period longer than that, then confirm the rediscovered items reappear as expected on a test host.

LLD docs

History lost for capacity and audits

Deleting an item removes the data that capacity reviews and audit evidence depend on, such as disk growth trends or interface traffic over a quarter. Cleanup that runs immediately after a resource disappears can erase this history before anyone reviews it. Before enabling Delete lost resources, list which reports and audit requests rely on discovered items, decide how long their history must remain available, and export or archive what you need first.

Short intervals cause flapping

If the disable period is shorter than the update interval, a resource that is only briefly unreachable between two discovery runs gets disabled, then re-enabled, then disabled again. Items and triggers toggle state, and alerts and dashboards show noise instead of real change. Set the disable period longer than the rule's update interval, and review the interval itself when a discovery source is slow or intermittently available.

Manual changes block cleanup

Items you disabled by hand stay disabled and are never deleted by LLD. Over time these manual states accumulate, so the list of stale objects keeps growing even with cleanup turned on, and the cleanup rule looks broken. Audit manually disabled items on a schedule, decide which should be removed or re-enabled, and document why each exception exists so the next administrator does not treat it as a fault.

Period settings applied in the wrong order

The delete period must be longer than the disable period. A reversed pair, or a delete period set equal to the disable period, changes the outcome you expect for each resource and can remove objects sooner than intended. Write both values down together, check the ordering in the discovery rule before saving, and verify the result on one discovery rule in a staging copy before applying the same values to production.

Questions teams ask before cleaning up lost resources

How much does cleaning up lost resources in Zabbix discovery cost?

The cost depends on how many discovery rules, templates and hosts need review, and on how many of them carry local changes that must be kept. Zabbix open source has no license fee, so the cost is the labor to plan the settings, test them on a staging copy and roll them out. Ask a partner for a quote built from a written scope that lists the rules in question, the hosts behind them and the environments to test. Work that recurs includes checking the settings after each template or rule change, which is usually small once the policy is set. Ask whether the quote includes the staging test and the handover notes.

How long does a rollout take for many discovery rules and hosts?

Duration grows with the number of rules, the number of hosts each rule touches and the number of environments that must be tested first. Each rule needs a decision on its delete and disable periods, and those periods must follow the ordering Zabbix documents: the delete period must be longer than the disable period, and the disable period should exceed the rule's update interval. Rules with long update intervals need longer disable periods, which adds review time. Ask a partner to break the timeline into rule groups so you can see which groups need staging tests before production changes.

Can our own team clean up lost resources without a partner?

Yes, if your team already administers Zabbix and understands how its discovery rules work. The settings are configured per discovery rule, and the core logic is documented in Zabbix's low-level discovery guide. The work that usually takes the most care is sorting out manual disables and local template changes, because LLD never removes manually disabled resources and a careless bulk change can hide real problems. Confirm that your team has a staging copy to test on and an owner for each rule before starting.

What does the team need to provide for this work?

You need to provide a list of discovery rules in scope, access to the Zabbix frontend or API with an account that can edit those rules, and a staging environment that resembles production. Your team should also name an owner who can decide how long a missing disk, interface or VM should stay visible before it is disabled or deleted. Share your monitoring retention needs, because deleting a resource also removes its history. Confirm with your monitoring owner how long historical data must be kept before any delete setting is applied.

What happens to items when a disk or VM comes back?

Resources disabled automatically are re-enabled when discovery finds them again, so a disk that returns after a short outage comes back into monitoring. Resources that were disabled by hand stay disabled, and LLD does not delete them. This is why the disable period should be chosen with the outage pattern in mind. Ask your engineers to verify the behavior on a test host by removing and restoring a resource, then checking the item state and history in the staging environment.

What are the main risks of changing delete and disable settings?

The main risks are deleting history you still need, disabling resources that are only temporarily absent, and leaving manual disables in place that hide real faults. Setting the delete period too short can remove items and triggers that a short outage would have restored. Setting the disable period shorter than the update interval can cause resources to flap. Review each rule with its owner, record the chosen periods and test a removal and return on a staging host before applying the change to production.

What does a partner deliver for this cleanup?

A fixed-scope engagement typically delivers a written inventory of the discovery rules in scope, a proposed delete and disable setting for each rule with the reasoning, staging test results, the production change plan and handover notes for your team. DeployOpen plans, implements, documents and supports self-hosted open-source platforms in your infrastructure, so the deliverables are agreed in writing before work starts. Ask for the exact list of deliverables and the acceptance tests in the quote. DeployOpen does not publish a price list, and a quote follows from the written scope.

How DeployOpen scopes Zabbix discovery cleanup

DeployOpen plans and implements lost resource settings on your Zabbix discovery rules inside your own infrastructure, starting from a written scope of which rules, prototypes and hosts need cleanup. We test the delete and disable behavior against your real disappearance patterns before anything goes to production, then document the result for your operations team.

How we scope

  • We list every discovery rule that creates items, triggers or hosts for disks, interfaces or VMs that can disappear.
  • The written scope states the lost resource setting chosen for each rule and the reason for it.
  • We agree in writing which manually disabled resources must be kept and which stale objects may be removed.

How we build

  • We configure delete and disable periods so the delete period is longer than the disable period, and the disable period exceeds each rule's update interval.
  • We test a disappearing and returning resource on a staging copy to confirm items re-enable and manual disables stay in place.
  • We review trigger counts and host prototype behavior so cleanup does not leave orphaned problems behind.

How we hand over

  • You receive a settings register listing each discovery rule, its lost resource periods and the owner of each decision.
  • The handover includes test records showing the disappearance and re-discovery scenarios that were run.
  • Runbook notes explain how to find and clear manually disabled resources and how to review stale objects after changes.

How we support

  • Fixed-scope engagements have deliverables and timelines agreed in writing before work starts.
  • Ongoing support, upgrades and re-testing after template or discovery changes are available as a retainer.
  • Quotes follow from the written scope, so ask for each cleanup change, test and document to be itemized.

Sources and further reading

Talk to our team.

Tell us what you're working on, whether it's a deployment, an audit, a security test or a cyber range. You'll speak with an engineer who can help you scope it.

  • 30-minute call: free, with no obligation.
  • NDA on request: we can sign before you share details.
  • Clear next steps: a scope and plan after the call.