sensu delete a check from clients

Solution 1:

So recently encountered an issue where we deployed some sensu checks via ansible and they recreated existing checks with incorrect names. There would be nothing wrong with letting this go except it looks bad in the uchiwa interface. I followed steps above, but they must have been from an outdated version of sensu. Here are the modified steps I did to remove these checks.

  • Log in to Redis CLI redis-cli
  • Execute keys *server_name* to list all checks related to the server in question
  • type smembers result:server_name
  • srem result:server_name check_to_remove
  • del history:server_name:check_to_remove result:server_name:check_to_remove

This should remove the check completely from Redis, and then from sensu.

Solution 2:

Latest Uchiwa can do that itself http://docs.uchiwa.io/en/latest/features/deleting-check-results/

Solution 3:

In case anyone comes to this and wants to do the same WITHOUT flushing the entire Redis DB, you can do the following:

  • Log into redis (redis-cli from the command line)
  • Execute "keys *" to list all the keys
  • Locate both the history key and the execution key for the server / check combination that you want to delete

Example: Client: SomeServer, check: check_nginx

Commands to run:

del execution:SomeServer:check_nginx
del history:SomeServer:check_nginx