Would be possible to give some examples how to send alerts directly to web lisenting address?
gitxbillhub opened this issue · 4 comments
Do you mind to give some examples how to send alert to snmp_notifier web interface directly for testing purpose?
Thanks.
Personally, I use postman.
Send a POST to your webhook http://ip:9464/alerts
, in body, you can use the following json body to get started.
{"receiver": "webhook", "status": "firing", "severity": "major", "alerts": [{"status": "firing", "value": "23", "labels": {"alertname": "Test", "type": "service", "value": "31", "oid": "2.3.6.1.6.3.1.1.4.1.0", "severity": "major", "dc": "eu", "instance": "localhost", "job": "prometheus", "alertName": "my alert"}, "startsAt": "2018-08-03T09:52:26.739266876+02:00", "endsAt": "0001-01-01T00:00:00Z"}]}
Maybe I am misunderstanding something, after I get a 200 in this post, how would I see my alert in the SNMP server ? Basically I am sending, getting a 200 in the post to. But I can not "get" its alerts in snmpd server.
Follow my try:
[root@centos8labmonitor snmp_notifier-1.0.0.linux-amd64]# snmpget -v2c -c public centos8labmonitor 2.3.6.1.6.3.1.1.4.1.0
joint-iso-ccitt.3.6.1.6.3.1.1.4.1.0 = No Such Object available on this agent at this OID
[root@centos8labmonitor snmp_notifier-1.0.0.linux-amd64]#
Maybe I am misunderstanding something, after I get a 200 in this post, how would I see my alert in the SNMP server ? Basically I am sending, getting a 200 in the post to. But I can not "get" its alerts in snmpd server.
Follow my try:
[root@centos8labmonitor snmp_notifier-1.0.0.linux-amd64]# snmpget -v2c -c public centos8labmonitor 2.3.6.1.6.3.1.1.4.1.0
joint-iso-ccitt.3.6.1.6.3.1.1.4.1.0 = No Such Object available on this agent at this OID
[root@centos8labmonitor snmp_notifier-1.0.0.linux-amd64]#
Basically I was trying to see a trap using the wrong command (snmpwalk / snmpget), the right command for reading/debugging the traps sent by notifier is this one in linux:
snmptrapd -Dusm -d -f -Le
You may also use the ./listen.sh
in the script folder to see the incoming traps, for testing purposes.