Comments (5)
sharing the alertmanagert YAML and the snmp_notifier deployment manifest files again as they might not be clear in the above issue opening page
global:
resolve_timeout: 5m
route:
group_by: ['...']
group_wait: 3s
group_interval: 1m
repeat_interval: 15m
receiver: 'snmp_notifier'
receivers:
- name: 'snmp_notifier'
webhook_configs:- send_resolved: true
url: http://10.140.15.246:9464/alerts
- send_resolved: true
apiVersion: apps/v1
kind: Deployment
metadata:
name: snmp-notifier-deployment
namespace: pf9-monitoring
labels:
component: snmp-notifier
spec:
replicas: 1
selector:
matchLabels:
app: snmp-notifier
template:
metadata:
labels:
app: snmp-notifier
spec:
containers:
- image: maxwo/snmp-notifier:v1.2.1
name: snmp-notifier
ports:
- containerPort: 9464
name: web-endpoint
protocol: TCP
resources:
limits:
cpu: 500m
memory: 512Mi
requests:
cpu: 500m
memory: 256Mi
apiVersion: v1
kind: Service
metadata:
name: snmp-notifier-service
namespace: pf9-monitoring
spec:
type: ClusterIP
ports:
- name: web-endpoint
port: 9464
targetPort: 9464
protocol: TCP
selector:
app: snmp-notifier
from snmp_notifier.
Hi @snimje,
I have a similar case of yours and got it working, so I have some tips for you:
- In alertmanager, use service domain address instead service IP address:
Usually in a cluster your local domain is cluster.local, so you can refer to your to service like this:
name-of-your-service.namescapece-of-your-service.svc.cluster.local, so In my case the name of the service is "snmp-notifier". In alertmanager I have this config:
receivers:
- name: snmp_notifier
webhook_configs:
- send_resolved: true
url: http://snmp-notifier.my-namespace.svc.cluster.local:9464/alerts
`
- In your deployment you need to change the snmp server destination (--snmp.destination), by default is "localhost(127.0.0.1)", so in my case here's what I changed:
spec:
containers:
- image: maxwo/snmp-notifier
imagePullPolicy: Always
command: ["/bin/snmp_notifier"]
args: ["--snmp.trap-description-template=/etc/snmp_notifier/description-template.tpl", "--snmp.community=$(SNMP_NOTIFIER_COMMUNITY)", "--snmp.destination=$(SNMP_NOTIFIER_SERVER):$(SNMP_NOTIFIER_SERVER_PORT)"]
env:
- name: SNMP_NOTIFIER_COMMUNITY
value: "public"
- name: SNMP_NOTIFIER_SERVER
value: "IP_OF_YOUR_DEST_SERVER"
- name: SNMP_NOTIFIER_SERVER_PORT
value: "162"
You may change as many paremeters as you want. You have other ways to inject data/variables in kubernetes, I just gave you
a simple example, please refer to: https://kubernetes.io/docs/tasks/inject-data-application/define-environment-variable-container/
@maxwo,
May be it's a good idea to provide an example file to deploy snmp_notifier on kubernetes, I can help to provide it if you want.
Hope that's helps.
Cheers,
Alberto Viana
from snmp_notifier.
I am considering providing a Helm chart to help deploy on Kubernetes clusters.
There is already an issue on this: #22
from snmp_notifier.
@albertocrj Here is a Helm chart to deploy on Kubernetes: https://github.com/maxwo/snmp-notifier-helm-chart
I will create a PR to add it the the Prometheus community charts, so that deployment next to an already up Prometheus instance will be even easier.
from snmp_notifier.
Hi @maxwo,
Great news man, I will give a try on it.
Thanks
from snmp_notifier.
Related Issues (20)
- How to get instance IP when the status is OK HOT 2
- How to get label when the alert is resolved ? HOT 1
- Multiple destinations to send traps to
- Using varbinds with common OID HOT 3
- level=error msg="400 Bad Request HOT 2
- Alarm description when it is cleared
- Alerts not receiving in snmp receiver end HOT 9
- SNMP Notifier "Error":true,"Status":422 HOT 7
- Use exporter toolkit to use the same security as standard exporter
- Use a default severity on unknown severity instead of 400 error
- Editing the description-template.tpl file for more fields HOT 1
- If I want to use different oids for alarm and recovery, how can I set it up? HOT 1
- Does it support TLS? How to enable it? HOT 1
- How to configure the SNMP destination during runtime? Is there any REST API provided by SNMP Notifier? HOT 1
- Switch build system to Github Actions
- Try all SNMP destinations before failing
- Configure the docker image to set the SNMP destination via environment variable HOT 5
- Is an IPv6 target supported? HOT 2
- 422 Unprocessable Entity: HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from snmp_notifier.