hyperglass
hyperglass copied to clipboard
HTTP logging(slack) is not working
Deployment Type
Docker
Version
v2.0.4
Steps to Reproduce
- follow this slack example :https://hyperglass.dev/configuration/config/logging
Expected Behavior
log to slack
Observed Behavior
2024-08-10 16:24:02.161 | ERROR | hyperglass.external._base:aexit:102 - 'dict' object has no attribute 'source' 2024-08-10 16:24:02.161 | ERROR | hyperglass.api.tasks:send_webhook:68 - Failed to send webhook
Configuration
No response
Devices
No response
Logs
No response
I can confirm that I am seeing the same issue on a manual installation, also using Hyperglass 2.0.4 on Ubuntu 22.04.5 LTS when connecting to a VyOS router.
@symysak Not sure if you managed to resolve this or not, however I worked out what the issue was and a fix.
The problem was with the way Hyperglass was trying to access a dictionary as an attribute. To access it as a key (which is what it is), you need to encapsulate it in square brackets.
To apply the fix, go to hyperglass/models/webhook.py and replace L63 with if model['source'] in ("127.0.0.1", "::1"):.
https://github.com/thatmattlove/hyperglass/blob/0b2fbb1b4d81a7042a4208aa708ac72e5ef2323d/hyperglass/models/webhook.py#L63
@thesysadmindev Thanks for your patch! I am finally using the slack notification!