# How can I discard a sensu check?

**URL:** <https://discourse.sensu.io/t/how-can-i-discard-a-sensu-check/1096>\
**Category:** Sensu Plugins\
**Created:** [February 14, 2019, 1:48pm UTC](https://discourse.sensu.io/t/how-can-i-discard-a-sensu-check/1096 "2019-02-14T13:48:53Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![MBruz](https://avatars.discourse-cdn.com/v4/letter/m/aeb1de/32.png) [@MBruz](https://discourse.sensu.io/u/MBruz)\
**Post date:** [February 14, 2019, 1:48pm UTC](https://discourse.sensu.io/t/how-can-i-discard-a-sensu-check/1096/1 "2019-02-14T13:48:53Z")

</div>

We want to discard the message if the severity is unknown.

case severity  
when /ok/  
ok msg  
when /warning/  
warning msg  
when /critical/  
critical msg  
when /unknown/  
unknown msg  
end

How do I not send any message at all from a sensu check in the run proc?

---

<div class="post-metadata">

**Author:** ![majormoses](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.sensu.io/majormoses/32/62_2.png) [@majormoses](https://discourse.sensu.io/u/majormoses)\
**Post date:** [February 16, 2019, 12:13am UTC](https://discourse.sensu.io/t/how-can-i-discard-a-sensu-check/1096/2 "2019-02-16T00:13:47Z")

</div>

Can I get a bit more context on what you are trying to accomplish? Is this in the context of writing a handler? What is the reason you do not want to send anything in the case of an `unknown`? You probably want to send something so that the server logs the error. If you are wanting to prevent a particular handler from being executed when the check/metric result was an `unknown` you can accomplish this on a per handler basis via config as described below.

In your [handler configuration](https://docs.sensu.io/sensu-core/1.6/reference/handlers/#handler-attributes) you can specify an array of severities for your handler to action on. You can use `warning`, `critical`, and `unknown`. `ok` events are always sent to it and the handler decides what to do with it as on an `ok` in the case of pagerduty would automatically resolve the incident. By removing `unknown` from your handler config you can avoid being alerted for an `unknown` severity. Alternatively you could write a `filter` that prevents the handler from being called as well.

---

<div class="post-metadata">

**Author:** ![MBruz](https://avatars.discourse-cdn.com/v4/letter/m/aeb1de/32.png) [@MBruz](https://discourse.sensu.io/u/MBruz)\
**Post date:** [February 19, 2019, 1:36pm UTC](https://discourse.sensu.io/t/how-can-i-discard-a-sensu-check/1096/3 "2019-02-19T13:36:15Z")

</div>

we have a bit of a unique situation here. A very big company in which I have no access to the sensu server. Now if I am understanding sensu the server is the place to filter messages. Not the client. Is this correct?

We are being asked to throttle and exclude messages on the client. That works fine for messages that flow from nxlog to sensu but for checks from sensu we do not have that option. The unknown status is one that they want to exclude from the output and handle the problem in another manner.

---

<div class="post-metadata">

**Author:** ![majormoses](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.sensu.io/majormoses/32/62_2.png) [@majormoses](https://discourse.sensu.io/u/majormoses)\
**Post date:** [May 4, 2019, 2:28am UTC](https://discourse.sensu.io/t/how-can-i-discard-a-sensu-check/1096/4 "2019-05-04T02:28:10Z")

</div>

Filters and handlers are always run on the server side, if you have no access to the server the only thing you can do is remove the check from the client.
