Dynamic webapp monitoring through check-http


#1

Hi all,

I’m a new prospective user of Sensu, wondering about its API possibilities.

I am developing an app which creates more webapp on-demand on a PaaS (OpenShift), and I’d like to start with simple web monitoring of my apps from an external server so the main app knows if something went wrong with an OpS instance (I could also use internal metrics using a sensu-client cartiridge but this is for later developments).

My idea was to have a side configuration of Sensu Server+Client colocated on a server, then install the check-http plugin there. Then I wanted to exploit Sensu’s API to create my checks… unfortunately I’m not sure if it’s actually possible.

Checks are written statically on a JSON file on the client as far as I understand, with static parameters (as per the doc, for instance a specific command line script). If I had only one static webapp to monitor, it would be easy, but it’s not my case.

It seems I would have to actually write a json file on the client in conf.d for each new webapp I create, so that check-http does the GET request on the specified url. It seems a bit heavyweight (esp. since it might also require a service restart, not sure about that)…

Is there a way to create one sample parameterizable check on the client, then through a POST create an instance of this check with the URL I want as parameter?

Thanks!


#2

Could you just shoot dynamic json at local sensu socket listening on 3030?

http://sensuapp.org/docs/0.16/external_result_input

···

On Dec 10, 2014 9:13 AM, “Florian” florian.dudouet@gmail.com wrote:

Hi all,

I’m a new prospective user of Sensu, wondering about its API possibilities.

I am developing an app which creates more webapp on-demand on a PaaS (OpenShift), and I’d like to start with simple web monitoring of my apps from an external server so the main app knows if something went wrong with an OpS instance (I could also use internal metrics using a sensu-client cartiridge but this is for later developments).

My idea was to have a side configuration of Sensu Server+Client colocated on a server, then install the check-http plugin there. Then I wanted to exploit Sensu’s API to create my checks… unfortunately I’m not sure if it’s actually possible.

Checks are written statically on a JSON file on the client as far as I understand, with static parameters (as per the doc, for instance a specific command line script). If I had only one static webapp to monitor, it would be easy, but it’s not my case.

It seems I would have to actually write a json file on the client in conf.d for each new webapp I create, so that check-http does the GET request on the specified url. It seems a bit heavyweight (esp. since it might also require a service restart, not sure about that)…

Is there a way to create one sample parameterizable check on the client, then through a POST create an instance of this check with the URL I want as parameter?

Thanks!


#3

Doc is not too clear to me, but it seems it can only be used to send event results? I need to setup a once per minute check for each of my new webapp, though I guess I could use an internal thread which does the check and then sends results to Sensu but that almost defeats the point of having Sensu for me, I want it to handle the checks!

Also my app is not located on the server+client side, so access to the local socket is complicated afaik.

If this socket actually allows me to write custom checks on demand then maybe, but I couldn’t find any evidence of this (will have a further look just in case)

···

On Wednesday, December 10, 2014 3:17:41 PM UTC+1, Alexander York wrote:

Could you just shoot dynamic json at local sensu socket listening on 3030?

http://sensuapp.org/docs/0.16/external_result_input

On Dec 10, 2014 9:13 AM, “Florian” florian...@gmail.com wrote:

Hi all,

I’m a new prospective user of Sensu, wondering about its API possibilities.

I am developing an app which creates more webapp on-demand on a PaaS (OpenShift), and I’d like to start with simple web monitoring of my apps from an external server so the main app knows if something went wrong with an OpS instance (I could also use internal metrics using a sensu-client cartiridge but this is for later developments).

My idea was to have a side configuration of Sensu Server+Client colocated on a server, then install the check-http plugin there. Then I wanted to exploit Sensu’s API to create my checks… unfortunately I’m not sure if it’s actually possible.

Checks are written statically on a JSON file on the client as far as I understand, with static parameters (as per the doc, for instance a specific command line script). If I had only one static webapp to monitor, it would be easy, but it’s not my case.

It seems I would have to actually write a json file on the client in conf.d for each new webapp I create, so that check-http does the GET request on the specified url. It seems a bit heavyweight (esp. since it might also require a service restart, not sure about that)…

Is there a way to create one sample parameterizable check on the client, then through a POST create an instance of this check with the URL I want as parameter?

Thanks!


#4

Sensu will not be a turn-key solution for you.

- Server defined checks (json files on disk): must be deployed via
*some* mechanism, there is no api for this. Usually this is a
configuration management tool, but if you wanted dynamic app
monitoring, you would have to build some tooling to add and remove
these (and restart the sensu client/server)
- External result input (:3030 socket): You still need *something* to
execute the check and send the input to this socket. You can configure
the socket to listen on any ip, so you don't *have* to be local?

You are correct, there is no api to setup on-demand checks like this.

···

On Wed, Dec 10, 2014 at 6:35 AM, Florian <florian.dudouet@gmail.com> wrote:

Doc is not too clear to me, but it seems it can only be used to send event
results? I need to setup a once per minute check for each of my new webapp,
though I guess I could use an internal thread which does the check and then
sends results to Sensu but that almost defeats the point of having Sensu for
me, I want it to handle the checks!

Also my app is not located on the server+client side, so access to the local
socket is complicated afaik.

If this socket actually allows me to write custom checks on demand then
maybe, but I couldn't find any evidence of this (will have a further look
just in case)

On Wednesday, December 10, 2014 3:17:41 PM UTC+1, Alexander York wrote:

Could you just shoot dynamic json at local sensu socket listening on 3030?

http://sensuapp.org/docs/0.16/external_result_input

On Dec 10, 2014 9:13 AM, "Florian" <florian...@gmail.com> wrote:

Hi all,

I'm a new prospective user of Sensu, wondering about its API
possibilities.

I am developing an app which creates more webapp on-demand on a PaaS
(OpenShift), and I'd like to start with simple web monitoring of my apps
from an external server so the main app knows if something went wrong with
an OpS instance (I could also use internal metrics using a sensu-client
cartiridge but this is for later developments).

My idea was to have a side configuration of Sensu Server+Client colocated
on a server, then install the check-http plugin there. Then I wanted to
exploit Sensu's API to create my checks... unfortunately I'm not sure if
it's actually possible.

Checks are written statically on a JSON file on the client as far as I
understand, with static parameters (as per the doc, for instance a specific
command line script). If I had only one static webapp to monitor, it would
be easy, but it's not my case.

It seems I would have to actually write a json file on the client in
conf.d for each new webapp I create, so that check-http does the GET request
on the specified url. It seems a bit heavyweight (esp. since it might also
require a service restart, not sure about that)...

Is there a way to create one sample parameterizable check on the client,
then through a POST create an instance of this check with the URL I want as
parameter?

Thanks!


#5

If its possible, you could instantiate a client along with the newly created webapp. This client could have a default ip and port of the master client preset, for sending the health check data of the webapp. This way you do not have to modify sensu for addition or creation of a webapp.

···

On Wednesday, December 10, 2014 5:49:52 PM UTC+1, Kyle Anderson wrote:

Sensu will not be a turn-key solution for you.

  • Server defined checks (json files on disk): must be deployed via

some mechanism, there is no api for this. Usually this is a

configuration management tool, but if you wanted dynamic app

monitoring, you would have to build some tooling to add and remove

these (and restart the sensu client/server)

  • External result input (:3030 socket): You still need something to

execute the check and send the input to this socket. You can configure

the socket to listen on any ip, so you don’t have to be local?

You are correct, there is no api to setup on-demand checks like this.

On Wed, Dec 10, 2014 at 6:35 AM, Florian florian...@gmail.com wrote:

Doc is not too clear to me, but it seems it can only be used to send event

results? I need to setup a once per minute check for each of my new webapp,

though I guess I could use an internal thread which does the check and then

sends results to Sensu but that almost defeats the point of having Sensu for

me, I want it to handle the checks!

Also my app is not located on the server+client side, so access to the local

socket is complicated afaik.

If this socket actually allows me to write custom checks on demand then

maybe, but I couldn’t find any evidence of this (will have a further look

just in case)

On Wednesday, December 10, 2014 3:17:41 PM UTC+1, Alexander York wrote:

Could you just shoot dynamic json at local sensu socket listening on 3030?

http://sensuapp.org/docs/0.16/external_result_input

On Dec 10, 2014 9:13 AM, “Florian” florian...@gmail.com wrote:

Hi all,

I’m a new prospective user of Sensu, wondering about its API

possibilities.

I am developing an app which creates more webapp on-demand on a PaaS

(OpenShift), and I’d like to start with simple web monitoring of my apps

from an external server so the main app knows if something went wrong with

an OpS instance (I could also use internal metrics using a sensu-client

cartiridge but this is for later developments).

My idea was to have a side configuration of Sensu Server+Client colocated

on a server, then install the check-http plugin there. Then I wanted to

exploit Sensu’s API to create my checks… unfortunately I’m not sure if

it’s actually possible.

Checks are written statically on a JSON file on the client as far as I

understand, with static parameters (as per the doc, for instance a specific

command line script). If I had only one static webapp to monitor, it would

be easy, but it’s not my case.

It seems I would have to actually write a json file on the client in

conf.d for each new webapp I create, so that check-http does the GET request

on the specified url. It seems a bit heavyweight (esp. since it might also

require a service restart, not sure about that)…

Is there a way to create one sample parameterizable check on the client,

then through a POST create an instance of this check with the URL I want as

parameter?

Thanks!