Giter Site home page Giter Site logo

Comments (5)

snimje avatar snimje commented on May 20, 2024

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:


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.

albertocrj avatar albertocrj commented on May 20, 2024

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.

maxwo avatar maxwo commented on May 20, 2024

I am considering providing a Helm chart to help deploy on Kubernetes clusters.

There is already an issue on this: #22

from snmp_notifier.

maxwo avatar maxwo commented on May 20, 2024

@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.

albertocrj avatar albertocrj commented on May 20, 2024

Hi @maxwo,
Great news man, I will give a try on it.

Thanks

from snmp_notifier.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.