Monitors.txt - lazy webapp monitoring
monitorstxt.org
monitorstxt.org
* Exposing a "monitors.txt" is a potential security hole that reveals more about your infrastructure than you meant to.
* Restricting monitors.txt to a given service (by htaccess IP restriction?) is brittle and gets you out of "write feature"-land and into "do sysadmin"-land, which you're trying to avoid anyhow.
* Cucumber is an unnecessary extra layer that doesn't do much besides just frustrate the user who has to write just the right English syntax to get what he wants. See also: Monit config definitions. The files read nicely once you get them configured, but it can be a downright bear to find out what just the right magic combination of keywords and phrases is to get it to do what you want.
* If you want client-side managed monitoring, why not have some interface to your chosen monitoring service that you invoke via your Cap deploy? That's something that you can make reality today, rather than waiting on service providers to implement it.
The concept of being able to define your monitoring as a part of your application and then just deploying it with the rest of the package is really appealing, but you still have to go tell monitoring services where to find your monitoring file, you still have to wait on monitoring services to implement support for it, and monitoring just isn't that difficult of a problem. How often do you change your monitoring rules?
Everything you put in monitors.txt has to be publicly accessibly anyhow. What could is reveal that the actual website doesn't?
Passwords are security by obscurity, sure, but putting them in a world-readable file at a common known location is the height of ridiculous.
Seems to me this just gives potentials hackers a map to the public end points of my most important areas.
Monitoring is a very difficult problem when you consider false positives, notifications (repetition, escalation etc), and reporting.
Monitoring isn't just about whether a service is up or down. It's about the quality of that service right now and over time.
The problem is when people think "Hey, I have a computer science problem. I know, I'll express that problem in English!" and now they have two problems
Something like Steak (https://github.com/cavalle/steak) feels far more comfortable and readable to me.
but seriously, does nobody else see a problem with your monitoring configuration being hosted on the site being monitored? It is a bit like asking a hospital patient to keep an eye on his own charts and to let you know if anything goes wrong ..
do people really switch monitoring companies often enough to justify having a standard configuration format?
ps. cucumber syntax is horrible because it perpetuates a 'everybody speaks english' view of the world
My thoughts are the monitoring provider would keep a copy of monitors.txt and work from that, and check for changes regularly. If they can't get to monitors.txt that would trigger an alert.
So, if the file is unreachable, something is probably very very wrong.
Malicious changing of the file could be addressed by firing an alarm when the file changes.
> It is a bit like asking a hospital patient to keep an eye on his own charts and to let you know if anything goes wrong ..
No, it's a bit like leaving the chart with the patient, trusting that he won't destroy it.
> do people really switch monitoring companies often enough to justify having a standard configuration format?
Do people really switch monitoring companies rarely enough to justify keeping a myriad of incompatible configuration formats?
This also has the benefit of you owning all of your own data.
> ps. cucumber syntax is horrible because it perpetuates a 'everybody speaks english' view of the world
Cucumber syntax is great because a lot of people are already used to it. Oh, and it's completely language independent too. https://github.com/cucumber/cucumber/tree/master/examples/i1...
# monitors.txt - see http://monitorstxt.org for more info
GET:
http://monitors.txt
http://otherservice.monitors.txt
POST:
http://monitors.txt/service q:lalala user:trololol
http://monitors.txt/service2 id:250
RESOLVE:
monitorstxt.org 207.97.227.245
PERFORMANCE:
http://duckduckgo < 2s
http://duckduckgo/images < 3s
IMO feature testing should be part of your test suite pre-deploy, not the monitoring service.monitors.txt's purpose isn't to replace testing new features during development. Monitors.txt replaces the process of logging on to a 3rd party's app to configure the monitoring for the new feature.
Another bit of syntax that I think is missing is something like:
GUAGE:
http://domain/stats/logins 60s
COUNTER: http://domain/stats/logins 60s
AVG: http://domain/stats/logins 24h
Something like this would allow you to setup not only with simple external monitoring systems, but with internal systems like Nagios, Ganglia, ZenOSS, etc.Of course, I do have to agree with many people that I am a bit uneasy PUBLISHING all of this data for all to see.
1) Friends of the parent poster? 2) People thinking "dummy" might hurt one's feelings? 3) People willing to accept needless pedantry when what was meant is obvious? 4) People that also think that the original comment was against english keywords?
result = object.doSomething(someString.toUpper(), someInt);
and: with the instance named object, call the doSomething method
passing as parameters the result of calling the toUpper
method on someString and someInt storing the method return
value in the result variablefive times twenty divided by three to the power of twenty eight is a lot harder to understand, much less defined than:
(5*20/3)^28
Also, most imperative languages are crap because of the very tight name binding and difficulty in aliasing as well as insanely large number of unnecessary keywords.
In many functional languages if you speak spanish simply put:
let si = if
and voila you don't have silly keyword issues. (Yes, you can't redefine let easily, but it's a far better situation than the keyword smorgasbord that most imperative languages have)
Cucumber solves the problem of: "My manager with an MBA can't read my unit tests" and exchanges it for the problem of "Programmers don't know what the fuck the test does"
For example, I've not a clue yet on how to improve on this example:
Feature: DuckDuckGo Search
It should continue to kick ass
And I should be able to search
Scenario: Homepage performance
When I go to http://www.duckduckgo.com
Then I should see the page downloaded in less than 0.5 seconds
And I should see the page assets downloaded in less than 2 seconds
Scenario: Search over SSL
Given I go to https://www.duckduckgo.com
When I fill in "q" with "site:news.ycombinator.com"
And I press submit
Then I should be on https://duckduckgo.com/?q=site%3Anews.ycombinator.com
And I should see "Hacker News" within "h2" Then I should see the page downloaded in less than 0.5 seconds
to Then I want the page to download in under a second.
The natural English looks very tempting, but the actual terms you can use are very restrictive.Given the target audience, I think a more concise description language that pseudo natural language would work better. Regardless, such a service can bring basic alerting to the huge number of sites which currently have nothing.
• shoehorn a pointer to a varying URL inside an existing convention-dictated place – as for example with sitemap pointers inside robots.txt files.
• let the resource live anywhere but specify its location to consuming services via some out-of-band mechanism. That is, you still have to tell any monitoring provider where your particular monitoring-spec lives, probably via its signup interface, but you can still use the same format and unmoving file with multiple providers.
"For the more gung-ho, obfuscate the URL and use SSL (e.g. https://yoursite.tld/something-unguessable/monitors.txt) and tell your provider where to find your monitors.txt"
If you've got an idea of some psuedo code you could write that'd make the monitors.txt idea more attractive, please write some, I'm keen for feedback.
And is this presuming a headless browser? There are a lot of poorly-authored documents which blow up if their js can't get certain resources, even though the URLs don't appear in the markup where a scraper would see them. I'm all for having a pure-HTML mode that always works, because that's basic competence, but I'd want my progressive enhancements monitored as well at a lower priority.
Cucumber https://github.com/eliotsykes/monitorstxt/blob/gh-pages/moni...
YAML https://github.com/eliotsykes/monitorstxt/blob/gh-pages/moni...
JSON https://github.com/eliotsykes/monitorstxt/blob/gh-pages/moni...
XML https://github.com/eliotsykes/monitorstxt/blob/gh-pages/moni...
- Put some monitors.txt examples in JSON, YAML, Gherkin and XML up on http://monitorstxt.org to help get the syntax right and satisfy the majority of language preferences. Feedback/contributions welcome, fork on github here: https://github.com/eliotsykes/monitorstxt
- Continue work on prototype monitoring app, with support for the above formats
- Open up the prototype to interested devs
GET /
GET /login
POST /login
user={{CUSTID}}&pass={{PWORD}}
GET /search?q={{QUERY}}
The monitors.txt file could contain pointers to the definition files (one file per usecase), ideally with arbitrary metadata.If there's some kind of consensus, now or later on, I'll implement it in our monitoring service (blamestella.com).
I'm working on implementing monitors.txt for my own sites and will open it up to a few devs to get the API sculpted just right. After then I hope they'll be other monitoring services as keen as blamestella to have a go at it.
Especially if you want lots of providers to support it, pick something super easy to parse.. JSON is the obvious choice there:
[{ method: "GET",
url: "index.html",
tests: [ contains: "nyaruka",
response_in_ms: 500,
status: 200 ] },
{ method: "POST",
url: "login.html",
params: { foo: "bar" }
tests: [ "status": 200 ] }] - method: GET
url: index.html
tests:
- contains: nyaruka
- response_in_ms: 500
- status: 200
- method: POST
url: login.html
params:
foo: bar
tests:
- status: 200 Feature: Jobs should run on time
Scenario: Search Subscription Job ran on time
Given the job started and ended at:
| start | end |
| 2011-10-30 05:30:01 GMT | 2011-10-30 05:37:42 GMT |
| 2011-10-29 05:30:01 GMT | 2011-10-29 05:37:42 GMT |
Then I should see the job took less than 10 minutes
And I should see the job started every day at "05:30 GMT"
The rails plugin generates the text above and start/end run times with something like this: class SearchSubscriptionJob
def perform
# Fire off the search subscription emails
...
end
add_job_monitor :job_method => :perform,
:should_run => [:daily, "05:30 GMT"],
:max_duration => 10.minutes,
:alerts => {:email => 'admin@yoursite.tld',
:sms => '+441234567890',
:twitter => 'twitteruser'}Virtually every web app in the world relies on a similar security system. You just don't notice, because we call the "key" in those systems a "cookie", not a "dynamic URL path component".
There are reasons why the URL key is inferior to other keys used by web applications, but they are fiddley. If monitors are unlikely to have extremely sensitive information in them (and you'd hope they wouldn't given their intent), it's fine to use URL keys.