Passive checks in sensu

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

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

********************************************************************************************************************

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

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.

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…

You could use the API:
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...

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”, “name”: “check-ram-windows”, “output”: “Dummy Windows RAM check”, “status”: 1}’ 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.

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

On Thu, Jun 2, 2016 at 8:42 AM, 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…