fzaninotto / uptime

A remote monitoring application using Node.js, MongoDB, and Twitter Bootstrap.
http://fzaninotto.github.com/uptime/
MIT License
3.62k stars 704 forks source link

Pattern matching crashes with bad Regex. (created in #150) #157

Closed brettswift closed 11 years ago

brettswift commented 11 years ago

This is broken for me, although I may have a different use case. (At least regex validation would be nice.. as it crashes the app and you can't restart it if you give a bad regex).

_to reproduce_ To test, merge in my dummyTarget from: https://github.com/brettswift/uptime/tree/statusCheck --> ./fixtures/dummyTargetJsonPath.js

_create check using_ URL: http://localhost:8888/90/1 regex: (?<=build>)[\S\s]*?(?=<\/build)

I'm guessing that this feature is just supposed to check for the existence of text in the output.

The approach of my statusCheck branch is specifically to report on numbers. I have pings created with version numbers.

The current statusCheck branch I have isn't ready for this code.. but it works on it's own.

The problem I have is dynamically adding a column "version" in the "checks" page, as it wouldn't make sense to most of the consumers of this code.

Thoughts / suggestions / contributions welcome to my statusCheck branch so this can be submitted back to the main repository.

fzaninotto commented 11 years ago

I don't know yet how to really enable new measures on pings. The aggregation phase is not easily extendable by a plugin, therefore all you can do for now (and that's what you did) is to add the new measure as a column on pings.

As for the poller choice, I think that there should be an event launched by the app when poller types are registered, where plugins could hook to add their own poller types. As for the check editing form, I think that a "poller type" dropdown should be added, containing all the available pollers, and set to "auto-detect" by default to keep the current behavior.