-
Notifications
You must be signed in to change notification settings - Fork 515
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Trap SNMP events in riemann #613
Comments
Traps... Dunno if anyone has done that yet. Google reports several SNMP pollers though. —Reply to this email directly or view it on GitHub. |
@qnick Haven't seen anything like that published, but I suspect you could build a snmp4j trap listener, something like this, and wrap it with a bit of clojure that converts the trap into a Riemann event. The graphite transport has an example of creating and event. Edit: herark by @c-garcia might be a better starting point for Riemann integration than native snmp4j. |
The collectd snmp plugin will emit events on traps (and will also poll if you want) On October 9, 2015 5:41:43 PM CEST, Kyle Kingsbury notifications@github.com wrote:
Sent from my Android device with K-9 Mail. Please excuse my brevity. |
Other idea: using snmptrapd and syslog-ng |
Yes, that would be the most elegant and low-maintenance way. On October 9, 2015 9:05:51 PM CEST, Fabien Wernli notifications@github.com wrote:
Sent from my Android device with K-9 Mail. Please excuse my brevity. |
Ok, thank you. I decide to write python script for redirecting events from snmptrapd to riemann. #!/usr/bin/env python
import sys
import logging
from riemann_client.transport import UDPTransport
from riemann_client.client import QueuedClient
logging.basicConfig(filename='/tmp/snmp.log', level=logging.INFO)
tags = ["snmp"]
ttl = 120
host = raw_input()
ip = raw_input()
with QueuedClient(UDPTransport("localhost", 5555)) as client:
for line in sys.stdin:
logging.debug(line)
oid , val = line.split(None,1)
try:
val = val.strip().strip('"')
client.event(service = oid, metric_f = float(val), host = host, tags = tags, ttl = ttl)
except ValueError:
logging.warn("Cannot convert %s to float", val)
client.flush() It seems to work well. |
@pyr how do you configure collectd-snmp to listen for traps? |
@faxm0dem turns out you can't |
At 2013 @aphyr wrote "there could be an snmp server". Is there any chance to see it?
What should I do to send snmp traps into riemann server?
The text was updated successfully, but these errors were encountered: