# Dynamic webapp monitoring through check-http

**URL:** <https://discourse.sensu.io/t/dynamic-webapp-monitoring-through-check-http/321>\
**Category:** Sensu Classic (EOL)\
**Created:** [December 10, 2014, 2:13pm UTC](https://discourse.sensu.io/t/dynamic-webapp-monitoring-through-check-http/321 "2014-12-10T14:13:23Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Florian](https://avatars.discourse-cdn.com/v4/letter/f/898d66/32.png) [@Florian](https://discourse.sensu.io/u/Florian)\
**Post date:** [December 10, 2014, 2:13pm UTC](https://discourse.sensu.io/t/dynamic-webapp-monitoring-through-check-http/321/1 "2014-12-10T14:13:23Z")

</div>

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!

---

<div class="post-metadata">

**Author:** ![Alexander\_York](https://avatars.discourse-cdn.com/v4/letter/a/eb9ed0/32.png) [@Alexander\_York](https://discourse.sensu.io/u/Alexander_York)\
**Post date:** [December 10, 2014, 2:17pm UTC](https://discourse.sensu.io/t/dynamic-webapp-monitoring-through-check-http/321/2 "2014-12-10T14:17:41Z")

</div>

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

[http://sensuapp.org/docs/0.16/external\_result\_input](http://sensuapp.org/docs/0.16/external_result_input)

> **···**
>
> On Dec 10, 2014 9:13 AM, “Florian” [florian.dudouet@gmail.com](mailto: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!

---

<div class="post-metadata">

**Author:** ![Florian](https://avatars.discourse-cdn.com/v4/letter/f/898d66/32.png) [@Florian](https://discourse.sensu.io/u/Florian)\
**Post date:** [December 10, 2014, 2:35pm UTC](https://discourse.sensu.io/t/dynamic-webapp-monitoring-through-check-http/321/3 "2014-12-10T14:35:20Z")

</div>

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](http://sensuapp.org/docs/0.16/external_result_input)
> 
> > On Dec 10, 2014 9:13 AM, “Florian” [florian...@gmail.com](mailto: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!

---

<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:** [December 10, 2014, 4:49pm UTC](https://discourse.sensu.io/t/dynamic-webapp-monitoring-through-check-http/321/4 "2014-12-10T16:49:50Z")

</div>

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](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!

---

<div class="post-metadata">

**Author:** ![Srikanta\_Patanjali](https://avatars.discourse-cdn.com/v4/letter/s/d07c76/32.png) [@Srikanta\_Patanjali](https://discourse.sensu.io/u/Srikanta_Patanjali)\
**Post date:** [December 11, 2014, 9:43am UTC](https://discourse.sensu.io/t/dynamic-webapp-monitoring-through-check-http/321/5 "2014-12-11T09:43:41Z")

</div>

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](mailto: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](http://sensuapp.org/docs/0.16/external_result_input)
> > 
> > > >
> > 
> > > > On Dec 10, 2014 9:13 AM, “Florian” [florian...@gmail.com](mailto: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!
