Ignore Checks Based on Dependencies on Uchiwa using Sensu

265 Views Asked by At

I'm currently using sensu and Uchiwa in an attempt to get rid of Zabbix, the problem is some checks persist even though they're dependent on other check. For example: I have a check that checks if the vpn process is active:

    "vpn-process": {
  "command": "check-process.rb -f /var/run/openvpn/client.pid",
  "subscribers": [
    "uni"
  ],
  "interval": 60,
  "dependencies": [
    "http-url1",
    "http-url2",
    "http-url3"
  ]
},

And I also have a check for http response, but this shouldn't work if the vpn is down.

    "http-url1": {
  "command": "python /etc/sensu/plugins/check-http.py https://url",
  "subscribers": [
    "uni" 
  ],
  "interval": 60
}, 

Still, Uchiwa warns about the VPN check and the HTTP checks. Uchiwa showing VPN and HTTP checks

I read about the dependency check filters, but as far as I could understand, it only works for handlers and Uchiwa is not a handler?

2

There are 2 best solutions below

0
On BEST ANSWER

It seems you can't use Uchiwa as a handler (I checked with the maintainers), I had to write my own in python to call the API everytime the VPN is down and silence the checks I don't want to be shown in the dashboard. This way I created my own dependency.

1
On

Uchiwa displays the current state of events in the system -- it is a passive view of checks/events, whereas handlers are active. The HTTP check will execute on-schedule even if VPN is down, and it will be considered CRITICAL regardless of whether you have a dependency filter.

The only way to have the HTTP check not result in a CRITICAL value if VPN is down is if you're somehow able to check for that case within the HTTP check and return a different value instead of CRITICAL. However, VPN being down might look very similar to other network-related issues, so it's probably best to avoid this scenario.

Maybe try making the VPN and HTTP checks into a check aggregate?