iloire / watchmen

A simple node.js service monitor
MIT License
941 stars 195 forks source link

Etherpad Usage #34

Closed JohnMcLear closed 9 years ago

JohnMcLear commented 9 years ago

We're considering using WatchMen to monitor Etherpad instances.

One thing I can't see from the docs is how we'd go about building out our own client tests.

We use a client library (etherpad-cli-client) to test pad connectivity. This goes way beyond a simple HTTP or TCP test. https://www.npmjs.com/package/etherpad-cli-client

I could hack support into WatchMen specifically for our use case but it appears that having sort sort of support for this would be a globally required thing? I was thinking a config such as this would be ideal..

{
  name:'Etherpad Beta Test Instance',
  host: 'beta.etherpad.org',
  port:443,
  ping_interval: one_minute,
  ping_service_name: 'https', 
  failed_ping_interval: one_minute,
  enabled: true, //enables/disables this host
  alert_to: ['someone@somewhere.com'], 
  warning_if_takes_more_than: 2000,
  remove_events_older_than_seconds : 60 * 60 * 24 * 10, 
  services : [
    {
      name : 'Pad Contents',
      method: 'getEtherpad',
      url : '/p/lskdjflksjdflkjsdlkfj',
      expected: {contains: 'some pad contents'}
    } ,
    {
      name : 'home page',
      method: 'get',
      url : '/',
      expected: {statuscode: 200, contains: 'Contact page'}
    }
  ]
} 

So I'm either missing something in the docs or this isn't possible yet with WatchMen? Nagios has this support by leveraging scripts, it works pretty well. I'd possibly suggest a npm powered plugin approach though..

iloire commented 9 years ago

Hi John,

I am rewriting a few parts of WatchMen. I will definitely consider plugable ping services that can be just installed as npm modules with a certain prefix, and be picked up automatically by watchmen.

Cheers.

iloire commented 9 years ago

Hi John,

Since version 3 you can plug custom ping services, like the default http-head

JohnMcLear commented 9 years ago

Nice!