# Client handler?

**URL:** <https://discourse.sensu.io/t/client-handler/698>\
**Category:** Sensu Classic (EOL)\
**Created:** [October 16, 2016, 6:05am UTC](https://discourse.sensu.io/t/client-handler/698 "2016-10-16T06:05:40Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Charles\_DiMaggio](https://avatars.discourse-cdn.com/v4/letter/c/d6d6ee/32.png) [@Charles\_DiMaggio](https://discourse.sensu.io/u/Charles_DiMaggio)\
**Post date:** [October 16, 2016, 6:05am UTC](https://discourse.sensu.io/t/client-handler/698/1 "2016-10-16T06:05:40Z")

</div>

Hey folks,

I’m wondering if there’s a built in way of executing handlers on the client itself, rather than the server. So for instance, right now I have a simple check to make sure that a NAS is correctly mounted on a couple of machines. As of right now if I want to try to resolve this relatively simple error without any human intervention it seems like my only choice is to write a handler that ssh’s into the client and tries to run the mount command; however as we’re working in a multi-tenant situation, giving the Sensu server ssh access to every machine we want to monitor isn’t something I’m incredibly keen on nor very feasible (for instance right now we have a traveling exhibit working off of 4g with no real public ip address from which to SSH into barring an unreliable reverse tunnel), and on top of that a handful of machines are running Windows which means we would need some kind of ssh/winrm wrapper. It would be _much_ simpler if the client already running on each machine had a local event handler triggered from which I could just run the command locally. Does there exist a function from which I can do something like this? Is it something other’s possibly have run across that might warrant me trying my hand at a PR? Or am I maybe just trying to get Sensu to do something outside of its scope?

---

<div class="post-metadata">

**Author:** ![Oded\_Ben\_Ozer](https://avatars.discourse-cdn.com/v4/letter/o/da6949/32.png) [@Oded\_Ben\_Ozer](https://discourse.sensu.io/u/Oded_Ben_Ozer)\
**Post date:** [October 16, 2016, 9:44am UTC](https://discourse.sensu.io/t/client-handler/698/2 "2016-10-16T09:44:37Z")

</div>

There’s a slightly complex but working solution that doesn’t require ssh key exchange, it works by using Sensu remote check scheduling mechanism, usually refer to as “Sesnu Remediation”

This is the handler I use:

> <https://github.com/sensu-plugins/sensu-plugins-sensu/blob/master/bin/handler-sensu.rb>

One of the guides I just googled:

[http://thesoftjaguar.com/posts/2015/06/14/sensu-remediation/](http://thesoftjaguar.com/posts/2015/06/14/sensu-remediation/)

> **···**
>
> On Sunday, October 16, 2016 at 9:05:40 AM UTC+3, [charles...@localprojects.com](mailto:charles...@localprojects.com) wrote:
> 
> > Hey folks,
> 
> > I’m wondering if there’s a built in way of executing handlers on the client itself, rather than the server. So for instance, right now I have a simple check to make sure that a NAS is correctly mounted on a couple of machines. As of right now if I want to try to resolve this relatively simple error without any human intervention it seems like my only choice is to write a handler that ssh’s into the client and tries to run the mount command; however as we’re working in a multi-tenant situation, giving the Sensu server ssh access to every machine we want to monitor isn’t something I’m incredibly keen on nor very feasible (for instance right now we have a traveling exhibit working off of 4g with no real public ip address from which to SSH into barring an unreliable reverse tunnel), and on top of that a handful of machines are running Windows which means we would need some kind of ssh/winrm wrapper. It would be _much_ simpler if the client already running on each machine had a local event handler triggered from which I could just run the command locally. Does there exist a function from which I can do something like this? Is it something other’s possibly have run across that might warrant me trying my hand at a PR? Or am I maybe just trying to get Sensu to do something outside of its scope?
