# Passive checks in sensu

**URL:** <https://discourse.sensu.io/t/passive-checks-in-sensu/581>\
**Category:** Sensu Classic (EOL)\
**Created:** [April 26, 2016, 1:09pm UTC](https://discourse.sensu.io/t/passive-checks-in-sensu/581 "2016-04-26T13:09:12Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Smith\_Joel\_HEALTH\_AN](https://avatars.discourse-cdn.com/v4/letter/s/8797f3/32.png) [@Smith\_Joel\_HEALTH\_AN](https://discourse.sensu.io/u/Smith_Joel_HEALTH_AN)\
**Post date:** [April 26, 2016, 1:09pm UTC](https://discourse.sensu.io/t/passive-checks-in-sensu/581/1 "2016-04-26T13:09:12Z")

</div>

How would I go about replicating the Nagios functionality whereby I can issue a passive check response to generate an alert for a particular check?

Essentially I want to generate a series of dummy alerts from checks to verify that the handling is done correctly. It would be useful if this could be done through uchiwa, but a command line option would be fine.

Cheers,

Joel

---

<div class="post-metadata">

**Author:** ![Kyle\_Anderson](https://avatars.discourse-cdn.com/v4/letter/k/e5b9ba/32.png) [@Kyle\_Anderson](https://discourse.sensu.io/u/Kyle_Anderson)\
**Post date:** [April 26, 2016, 2:56pm UTC](https://discourse.sensu.io/t/passive-checks-in-sensu/581/2 "2016-04-26T14:56:13Z")

</div>

[https://sensuapp.org/docs/latest/clients#client-socket-input](https://sensuapp.org/docs/latest/clients#client-socket-input)

At work we have special hosts too that listen on more than localhost  
to serve as remote endpoints for those servers that don't run sensu so  
they can still report their checks.

> **···**
>
> On Tue, Apr 26, 2016 at 6:09 AM, Smith Joel (HEALTH AND SOCIAL CARE INFORMATION CENTRE) \<joel.smith1@hscic.gov.uk\> wrote:
> 
> > How would I go about replicating the Nagios functionality whereby I can  
> > issue a passive check response to generate an alert for a particular check?
> > 
> > Essentially I want to generate a series of dummy alerts from checks to  
> > verify that the handling is done correctly. It would be useful if this could  
> > be done through uchiwa, but a command line option would be fine.
> > 
> > Cheers,
> > 
> > Joel
> > 
> > \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
> > 
> > This message may contain confidential information. If you are not the  
> > intended recipient please inform the  
> > sender that you have received the message in error before deleting it.  
> > Please do not disclose, copy or distribute information in this e-mail or  
> > take any action in reliance on its contents:  
> > to do so is strictly prohibited and may be unlawful.
> > 
> > Thank you for your co-operation.
> > 
> > NHSmail is the secure email and directory service available for all NHS  
> > staff in England and Scotland  
> > NHSmail is approved for exchanging patient data and other sensitive  
> > information with NHSmail and GSi recipients  
> > NHSmail provides an email address for your career in the NHS and can be  
> > accessed anywhere
> > 
> > \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*

---

<div class="post-metadata">

**Author:** ![Smith\_Joel\_HEALTH\_AN](https://avatars.discourse-cdn.com/v4/letter/s/8797f3/32.png) [@Smith\_Joel\_HEALTH\_AN](https://discourse.sensu.io/u/Smith_Joel_HEALTH_AN)\
**Post date:** [April 26, 2016, 3:48pm UTC](https://discourse.sensu.io/t/passive-checks-in-sensu/581/3 "2016-04-26T15:48:13Z")

</div>

Hadn’t thought of using that for this usage - as long as I match the name appropriately, it should turn the check red until such time as the next scheduled check runs.

Would be a useful addition to uchiwa (perhaps as a test alert option), but this works fine for me.

Cheers,

Joel

> **···**
>
> On Tuesday, 26 April 2016 15:56:14 UTC+1, Kyle Anderson wrote:
> 
> > [https://sensuapp.org/docs/latest/clients#client-socket-input](https://sensuapp.org/docs/latest/clients#client-socket-input)
> > 
> > At work we have special hosts too that listen on more than localhost  
> > to serve as remote endpoints for those servers that don’t run sensu so  
> > they can still report their checks.

---

<div class="post-metadata">

**Author:** ![Smith\_Joel\_HEALTH\_AN](https://avatars.discourse-cdn.com/v4/letter/s/8797f3/32.png) [@Smith\_Joel\_HEALTH\_AN](https://discourse.sensu.io/u/Smith_Joel_HEALTH_AN)\
**Post date:** [June 2, 2016, 3:42pm UTC](https://discourse.sensu.io/t/passive-checks-in-sensu/581/4 "2016-06-02T15:42:18Z")

</div>

Anyone got ideas of how to do the same on windows hosts? For linux boxes I would ssh onto the box and run  
echo ‘{“name”: “diskusage”, “output”: “Dummy diskusage check”, “status”: 1}’ \> /dev/tcp/localhost/3030

``

but the windows boxes don’t support ssh (without installing a server) or have /dev/tcp/localhost/3030.

Could I do this on a linux server but have it send the message as the windows server? Kyle seemed to suggest they do something which allows one server to submit a check result on behalf of another…

---

<div class="post-metadata">

**Author:** ![Kyle\_Anderson](https://avatars.discourse-cdn.com/v4/letter/k/e5b9ba/32.png) [@Kyle\_Anderson](https://discourse.sensu.io/u/Kyle_Anderson)\
**Post date:** [June 3, 2016, 2:57pm UTC](https://discourse.sensu.io/t/passive-checks-in-sensu/581/5 "2016-06-03T14:57:43Z")

</div>

You could use the API:  
[https://sensuapp.org/docs/0.23/api/results-api.html#results-post](https://sensuapp.org/docs/0.23/api/results-api.html#results-post)

> **···**
>
> On Thu, Jun 2, 2016 at 8:42 AM, \<joel.smith1@hscic.gov.uk\> wrote:
> 
> > Anyone got ideas of how to do the same on windows hosts? For linux boxes I  
> > would ssh onto the box and run  
> > echo '{\"name\": \"diskusage\", \"output\": \"Dummy diskusage check\",  
> > \"status\": 1}' \> /dev/tcp/localhost/3030
> > 
> > but the windows boxes don't support ssh (without installing a server) or  
> > have /dev/tcp/localhost/3030.
> > 
> > Could I do this on a linux server but have it send the message as the  
> > windows server? Kyle seemed to suggest they do something which allows one  
> > server to submit a check result on behalf of another...

---

<div class="post-metadata">

**Author:** ![Smith\_Joel\_HEALTH\_AN](https://avatars.discourse-cdn.com/v4/letter/s/8797f3/32.png) [@Smith\_Joel\_HEALTH\_AN](https://discourse.sensu.io/u/Smith_Joel_HEALTH_AN)\
**Post date:** [June 8, 2016, 8:27am UTC](https://discourse.sensu.io/t/passive-checks-in-sensu/581/6 "2016-06-08T08:27:30Z")

</div>

Many thanks - that’s the solution. On the server:

curl -s -i -X POST -H ‘Content-Type: application/json’ -d ‘{“source”: “[sensu-client.example.com](http://sensu-client.example.com)”, “name”: “check-ram-windows”, “output”: “Dummy Windows RAM check”, “status”: 1}’ [http://127.0.0.1:4567/results](http://127.0.0.1:4567/results)

``

which will create a warning for the check  
check-ram-windows

``

on the host [sensu-client.example.com](http://sensu-client.example.com).

Might be a useful feature request for Uchiwa, to have a way to issue a dummy alert for a check from the GUI.

Cheers,

Joel

> **···**
>
> On Friday, 3 June 2016 15:57:46 UTC+1, Kyle Anderson wrote:
> 
> > You could use the API:  
> > [https://sensuapp.org/docs/0.23/api/results-api.html#results-post](https://sensuapp.org/docs/0.23/api/results-api.html#results-post)
> > 
> > On Thu, Jun 2, 2016 at 8:42 AM, [joel....@hscic.gov.uk](mailto:joel....@hscic.gov.uk) wrote:
> > 
> > > Anyone got ideas of how to do the same on windows hosts? For linux boxes I  
> > > would ssh onto the box and run  
> > > echo ‘{"name": "diskusage", "output": "Dummy diskusage check",  
> > > "status": 1}’ \> /dev/tcp/localhost/3030
> > > 
> > > but the windows boxes don’t support ssh (without installing a server) or  
> > > have /dev/tcp/localhost/3030.
> > > 
> > > Could I do this on a linux server but have it send the message as the  
> > > windows server? Kyle seemed to suggest they do something which allows one  
> > > server to submit a check result on behalf of another…
