---
type: Guide
title: "How to Set Up SNMP Alerts: A Worked Example"
description: "Build a working SNMP disk-space alert end to end — poll the OID, compute a percentage, apply hysteresis, fire a notification, and add a trap path with snmptrapd."
resource: "https://snmp-monitoring.info/guides/alerts/"
tags: [guides]
timestamp: 2026-07-11T00:00:00Z
---

# How to Set Up SNMP Alerts: A Worked Example

Build a working SNMP disk-space alert end to end — poll the OID, compute a percentage, apply hysteresis, fire a notification, and add a trap path with snmptrapd.

## Related concepts

- Up: [SNMP Guides & Use Cases: Real-World Walkthroughs](/guides/index.md)

## Frequently asked questions

### How do I set up an SNMP alert?

Poll the metric's OID on a schedule (e.g. snmpget from cron), convert it to a meaningful value like a percentage, compare it to a threshold with hysteresis so it doesn't flap, and fire a notification on each state change. For urgent events, add a trap path with snmptrapd listening on UDP 162. This guide builds exactly that for disk space, step by step.

### What is hysteresis in alerting?

Hysteresis uses two thresholds instead of one — a higher trigger level and a lower clear level — so an alert fires when the metric rises past the trigger and only clears when it falls back below the clear level. The gap between them (say 90% to trigger, 80% to clear) stops a value hovering near one line from firing and clearing repeatedly. It's the single most effective cure for alert flapping.

### How do I receive SNMP traps?

Run snmptrapd, the Net-SNMP trap receiver, listening on UDP 162. Configure snmptrapd.conf with an authCommunity line and a traphandle that runs a script on each incoming trap, then point your devices at the receiver's address. Traps let devices push urgent events instantly instead of waiting for the next poll, complementing your scheduled polling.

### Should I alert on totals or rate?

For counters — interface octets, error counts, packet totals — alert on the rate of change, not the raw total. A counter like ifInErrors only ever climbs, so the total is meaningless; what matters is how fast it's increasing (errors per minute). Compute the delta between two polls over the time between them. Gauges like disk-used percentage or temperature are already point-in-time, so you alert on the value directly.

## Source

Concept generated from https://snmp-monitoring.info/guides/alerts/ — the SNMP Monitoring vendor-neutral knowledge base. Content is limited to what that page states (no external claims added here).
