Skip to content
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

Send trap as format #704

Merged
merged 4 commits into from
May 1, 2024
Merged

Send trap as format #704

merged 4 commits into from
May 1, 2024

Conversation

i3149
Copy link
Contributor

@i3149 i3149 commented Apr 29, 2024

First pass on code to send any inputs ktrans gets out again as a snmp trap. Uses the generic trap value of .1.3.6.1.4.1.41263.6169 where 6169 comes from Kentik's AS number.

Tested with

./bin/ktranslate -snmp trap-v2.yaml \
  -format snmp \
  -snmp.format.conf trap-v2.yaml

Where trap-v2.yaml is

trap:
    listen: 127.0.0.1:1620
    community: public
    drop_undefined: false
    version: v2c
    transport: ""
    trap_only: true
    endpoint: 127.0.0.1
    endpoint_port: 1620
global:
  mib_profile_dir: ./config/profiles
  timeout_ms: 3000

Supports sending v1, v2c or v3.

@i3149 i3149 requested a review from jryburn April 29, 2024 05:50
@i3149
Copy link
Contributor Author

i3149 commented May 1, 2024

Tested this with the webhook from kentik and things are good to go.

Copy link

@jryburn jryburn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Only comment is does it make sense to hard-code the OID or should we make that an option that can be fed in on the CLI or pulled in via an env file? It's been a LOOONG time since I messed with traps so I'm not sure what the best practices are there.

@i3149
Copy link
Contributor Author

i3149 commented May 1, 2024

Generally I've seen OIDs hard coded to be specific things. But I'd argue its too early to make a Kentik mib so we can use this as a stepping stone.

@i3149 i3149 merged commit 024f1fb into main May 1, 2024
1 check passed
@i3149 i3149 deleted the send-trap-as-format branch May 1, 2024 21:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants