1

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?

Rebeca Maia
  • 438
  • 4
  • 16

2 Answers2

1

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.

Rebeca Maia
  • 438
  • 4
  • 16
0

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?

vase
  • 339
  • 1
  • 6
  • Thank you for your reply, vase! Unlesse I got it wrong, the aggregate feature makes it possible to send one check to several clients and receive several results. In my case, I want to have checks that will only be performed if a first check is ok (sensu will only perform the http check if the vpn check is ok). – Rebeca Maia Nov 29 '17 at 17:25