---
title: "Handler to receive Interface up/down traps from HP switches"
description: "The handler receives interface up/down SNMP traps from HP ProCurve switches in OP5 Trapper version 2.1. It provides a demo script for monitoring link status changes but is unsupported by ITRS support."
url: "https://docs.itrsgroup.com/docs/faq/op5/360020055854-op5-monitor-handler-to-receive-interface-up-down-traps-from-hp-switches/index.html"
---
## This procedure is unsupported

Articles in the "Unsupported Community Documents" space are not supported by ITRS support.

## Version

This article was written for version 2.1 of Trapper. It could work on both lower and higher versions if nothing else is stated.

Demo handler for snmp traps from HP switches. Tested with a ProCurve 2520G-8-Port / J9298A.

handler-hp-linkstatus.lua  Expand source

```
-- loglog("caught a trap from host: " .. result.host)
-- dump the trap into logs (to view it in SNMP traps gui) for debugging purposes
-- dump.trap()
-- update passive service check even if there is no state change (useful for keepalive traps)
-- result.notify = NOTIFY.ALWAYS
-- set the restresult.service = "Interface status"
for k, v in pairs(trap.fields) do
 if string.match(k,'^\.1\.3\.6\.1\.2\.1\.16\.9\.1\.1\.2\.76$') then
 local message = v
 local portname = string.match(message, "port [0-9]+")
 log('Trap severity is CRITICAL, port is ' .. portname)
 result.tag = portname
 result.message = "HP switch port " .. portname .. " is in CRITICAL state"
 result.state = STATE.CRITICAL
 elseif string.match(k,'^\.1\.3\.6\.1\.2\.1\.16\.9\.1\.1\.2\.75$') then
 local message = v
 local portname = string.match(message, "port [0-9]+")
 log('Trap severity is OK, port is ' .. portname)
 result.tag = portname
 result.message = "HP switch port " .. portname .. " is in OK state"
 result.state = STATE.OK
 else
 log('something else happened')
 local message = v
 result.message = message
 end
end
```


