{"id":13434103,"url":"https://github.com/fzaninotto/uptime","last_synced_at":"2025-04-11T04:58:55.815Z","repository":{"id":2155203,"uuid":"3100494","full_name":"fzaninotto/uptime","owner":"fzaninotto","description":"A remote monitoring application using Node.js, MongoDB, and Twitter Bootstrap.","archived":true,"fork":false,"pushed_at":"2021-10-01T11:20:04.000Z","size":4334,"stargazers_count":3612,"open_issues_count":147,"forks_count":704,"subscribers_count":177,"default_branch":"master","last_synced_at":"2025-04-11T04:58:31.399Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://fzaninotto.github.com/uptime/","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fzaninotto.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2012-01-04T07:56:18.000Z","updated_at":"2025-04-10T08:37:42.000Z","dependencies_parsed_at":"2022-07-17T09:30:35.532Z","dependency_job_id":null,"html_url":"https://github.com/fzaninotto/uptime","commit_stats":{"total_commits":465,"total_committers":29,"mean_commits":16.03448275862069,"dds":"0.20430107526881724","last_synced_commit":"e2f6bfe42da7b9e8e1416cf9e0668fd9fb5e4294"},"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fzaninotto%2Fuptime","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fzaninotto%2Fuptime/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fzaninotto%2Fuptime/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fzaninotto%2Fuptime/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fzaninotto","download_url":"https://codeload.github.com/fzaninotto/uptime/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248345273,"owners_count":21088244,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-07-31T02:01:45.964Z","updated_at":"2025-04-11T04:58:55.772Z","avatar_url":"https://github.com/fzaninotto.png","language":"JavaScript","funding_links":[],"categories":["JavaScript","Applications","others","Monitoring"],"sub_categories":["Web","Kubernetes Storage"],"readme":"uptime\n======\n\nA remote monitoring application using Node.js, MongoDB, and Twitter Bootstrap.\n\n\u003cimg src=\"https://raw.github.com/fzaninotto/uptime/downloads/check_details.png\" title=\"Visualizing the availability of an HTTP check in Uptime\" width=\"50%\" valign=\"top\" /\u003e\n\u003cimg src=\"https://raw.github.com/fzaninotto/uptime/downloads/check_form.png\" title=\"Editing check attributes (polling interval, slow threshold, alert threshold, pattern to match, tags) in Uptime\" width=\"50%\" valign=\"top\" /\u003e\n\nYou can watch a [demo screencast on Vimeo](https://vimeo.com/39302164).\n\n**Warning**: This application isn't actively maintained anymore. You can find many alternatives, from completely free to very cheap, in [this list of website monitoring services](http://www.supermonitoring.com/blog/the-updated-list-of-website-monitoring-services/).\n\nFeatures\n--------\n\n* Monitor thousands of websites (powered by [Node.js asynchronous programming](http://redotheweb.com/2012/01/23/nodejs-for-php-programmers-1-event-driven-programming-and-pasta.html))\n* Tweak frequency of monitoring on a per-check basis, up to the second\n* Check the presence of a pattern in the response body\n* Receive notifications whenever a check goes down\n  * On screen (powered by [socket.io](http://socket.io/))\n  * By email\n  * On the console\n* Record availability statistics for further reporting (powered by [MongoDB](http://www.mongodb.org/))\n* Detailed uptime reports with animated charts (powered by [Flotr2](http://www.humblesoftware.com/flotr2/))\n* Monitor availability, responsiveness, average response time, and total uptime/downtime\n* Get details about failed checks (HTTP error code, etc.)\n* Group checks by tags and get reports by tag\n* Familiar web interface (powered by [Twitter Bootstrap 2.0](http://twitter.github.com/bootstrap/index.html))\n* Complete API for integration with third-party monitoring services\n* Powerful plugin system to ease extension and customization\n* Easy installation and zero administration\n\nInstalling Uptime\n-----------------\n\nUptime 3.2 requires Node.js 0.10 and MongoDB 2.1. Older versions provide compatibility with Node 0.8 (Uptime v3.1) and 0.6 (Uptime v1.4).\n\nTo install from GitHub, clone the repository and install dependencies using `npm`:\n\n```sh\n$ git clone git://github.com/fzaninotto/uptime.git\n$ cd uptime\n$ npm install\n```\n\nLastly, start the application with:\n\n```sh\n$ node app\n```\n\nIf you want a production environment:\n\n```sh\n$ NODE_ENV=production node app\n```\n\nUpgrading From a 2.0 Install\n----------------------------\n\nIf you have been using uptime 1.0 or 2.0, you have to execute the migration script before using the new release.\n\n```sh\n$ node models/migrations/upgrade2to3\n```\n\nAdding Checks\n-------------\n\nBy default, the web UI runs on port 8082, so just browse to \n\n    http://localhost:8082/\n\nAnd you're ready to begin. Create your first check by entering an URL, wait for the first ping, and you'll soon see data flowing through your charts!\n\nConfiguring\n-----------\n\nUptime uses [node-config](https://github.com/lorenwest/node-config) to allow YAML configuration and environment support. Here is the default configuration, taken from `config/default.yaml`:\n\n```yaml\nurl:        'http://localhost:8082'\n\nmongodb:\n  server:   localhost\n  database: uptime\n  user:     root \n  password:\n  connectionString:       # alternative to setting server, database, user and password separately\n\nmonitor:\n  name:                   origin\n  apiUrl:                 'http://localhost:8082/api' # must be accessible without a proxy\n  pollingInterval:        10000      # ten seconds\n  timeout:                5000       # five seconds\n  userAgent:              NodeUptime/2.0 (https://github.com/fzaninotto/uptime)\n\nanalyzer:\n  updateInterval:         60000      # one minute\n  qosAggregationInterval: 600000     # ten minutes\n  pingHistory:            8035200000 # three months\n\nautoStartMonitor: true\n\nplugins:\n  - ./plugins/console\n  - ./plugins/patternMatcher\n  - ./plugins/httpOptions\n  # - ./plugins/email\n```\n\nTo modify this configuration, create a `development.yaml` or a `production.yaml` file in the same directory, and override just the settings you need. For instance, to run Uptime on port 80 in production, create a `production.yaml` file as follows:\n\n```yaml\nurl: 'http://myDomain.com'\n```\n\nNode that Uptime works great behind a proxy - it uses the `http_proxy` environment variable transparently.\n\nArchitecture\n------------\n\nUptime is composed of two services: a webapp (in `app.js`), and a polling monitor (in `monitor.js)`. For your convenience, the two services start together when you call `node app`.\n\n\u003cimg src=\"https://raw.github.com/fzaninotto/uptime/downloads/architecture.png\" title=\"Uptime architecture\" /\u003e\n\nHowever, heavily browsing the webapp may slow down the whole server - including the polling monitor. In other terms, using the application can influence the uptime measurements. To avoid this effect, it is recommended to run the polling monitor in a separate process.\n\nTo that extent, set the `autoStartMonitor` setting to `false` in the `production.yaml`, and launch the monitor by hand:\n\n```sh\n$ node monitor \u0026\n$ node app\n```\n\nDon't forget to set `NODE_ENV=production` if you want to run the app in production environment.\n\nYou can also run the monitor in a different server. This second server must be able to reach the API of the webapp server: set the `monitor.apiUrl` setting accordingly in the `production.yaml` file of the monitor server.\n\nMonitoring From Various Locations\n---------------------------------\n\nYou can even run several monitor servers in several datacenters to get average response time. In that case, make sure you set a different `monitor.name` setting for all monitor servers to be able to tell which server make a particular ping.\n\nUsing Plugins\n-------------\n\nPlugins can add more notification types, more poller types, new routes to the webapp, etc. Uptime currently bundles three plugins:\n\n * [`console`](https://github.com/fzaninotto/uptime/blob/master/plugins/console/index.js): log pings and events in the console in real time\n * [`email`](https://github.com/fzaninotto/uptime/blob/master/plugins/email/index.js): notify events (up, down pause) by email\n * [`patternMatcher`](https://github.com/fzaninotto/uptime/blob/master/plugins/patternMatcher/index.js): allow HTTP \u0026 HTTPS pollers to test the response body against a pattern\n * [`httpOptions`](https://github.com/fzaninotto/uptime/blob/master/plugins/httpOptions/index.js): add custom HTTP options and headers to HTTP and HTTPS checks (e.g. to allow self-signed certificate on HTTPS, custom headers, custom HTTP methods, ...)\n * [`basicAuth`](https://github.com/fzaninotto/uptime/blob/master/plugins/basicAuth/index.js): add HTTP Basic Access Authentication to the dashboard and API applications\n\nTo enable plugins, just add a line to the `plugins:` section of the configuration file.\nThree of the bundled plugins are already enabled by default:\n\n```yaml\n# in config/default.yaml\nplugins:\n  - ./plugins/console\n  - ./plugins/patternMatcher\n  - ./plugins/httpOptions\n  # - ./plugins/email\n  # - ./plugins/basicAuth\n```\n\nYou can override these settings in your environment configuration, for instance:\n\n```yaml\n# in config/production.yaml\n# disable the console plugin and enable the email plugin\nplugins:\n  # - ./plugins/console\n  - ./plugins/patternMatcher\n  - ./plugins/httpOptions\n  - ./plugins/email\n  # - ./plugins/basicAuth\n```\n\nThird-party plugins:\n\n * [`webhooks`](https://github.com/mintbridge/uptime-webhooks): notify events to an URL by sending an HTTP POST request \n * [`campfire`](https://gist.github.com/dmathieu/5592418): notify events to Campfire\n * [`pushover`](https://gist.github.com/xphyr/5994345): Notify events to mobile devices\n\nWriting Plugins\n---------------\n\nA plugin is a simple Node.js module which hooks into predefined extension points. Uptime automatically requires plugin modules when starting the webapp and the monitor, and tries to call the two following functions:\n\n* `initWebApp(options)` when starting the webapp\n* `initMonitor(options)` when starting the monitor\n\nCheck the [app.js](https://github.com/fzaninotto/uptime/blob/master/app.js#L97) and [monitor.js](https://github.com/fzaninotto/uptime/blob/master/monitor.js#L8) to see a detail of the options passed to each hook. Also, check the code of existing plugins to understand how they can add new pollers, new notification types, etc.\n\nFor instance, if you had to recreate a simple version of the `console` plugin, you could write it as follows:\n\n```js\n// in plugins/console/index.js\nvar CheckEvent = require('../../models/checkEvent');\nexports.initWebapp = function() {\n  CheckEvent.on('afterInsert', function(checkEvent) {\n    checkEvent.findCheck(function(err, check) {\n      console.log(new Date() + check.name + checkEvent.isGoDown ? ' goes down' : ' goes back up');\n    });\n  });\n}\n```\nAll Uptime entities emit lifecycle events that you can listen to on the Model class. These events are `beforeInsert`, `afterInsert`, `beforeUpdate`, `afterUpdate`, `beforeSave` (called for both inserts and updates), `afterSave` (called for both inserts and updates), `beforeRemove`, and `afterRemove`. For more information about these events, check the [mongoose-lifecycle](https://github.com/fzaninotto/mongoose-lifecycle) plugin.\n\nAPI\n---------------\n\nAll API requests should be prefixed with `api`.\nThe API response always uses the `application/json` mimetype.\nAPI requests do not require authentication.\n\nExample of a valid API request:\n\n`GET http://example.com/api/checks`\n\nExample for a valid API request using curl :\n\n`curl -i -H \"Accept: application/json\" -X PUT -d \"name=example\" -d \"url=http://mysite.com\" -d \"interval=120\" http://example.com/api/checks`\n\n### Status codes\n\nThe API is designed to return different status codes :\n\n* `200 Ok` : The request was successful, the resource(s) itself is returned as JSON\n* `400 Bad Request` : An attribute of the API request is invalid or missing (e.g. the url of a check is missing)\n* `404 Not Found` : A resource could not be accessed (e.g. a check ID could not be found)\n* `500 Server Error` : Something went wrong on the server side (e.g. a check could not be saved in database)\n\n### CRUD routes\n\n#### `GET /checks`\n\nReturn a list of all checks\n\n#### `GET /checks/needingPoll`\n\nReturn a list of checks that need a poll (i.e. not paused, plus new or last tested \u003e interval set between tests)\n\n#### `GET /checks/:id`\n\nReturn a single check\n\nParameter :\n\n* `id` : (required) Id of the check\n\nEx: `http://localhost:8082/api/checks/527a25bdc9de6e0000000004`\n\n#### `GET /checks/:id/pause`\n\nToggle the status (isPaused) of a check\n\nParameter :\n\n* `id` : (required) Id of the check\n\nEx: `http://localhost:8082/api/checks/527a25bdc9de6e0000000004/pause`\n\n#### `PUT /check/:id/test`\n\nUpdates the last checked date for a check. Used to avoid double check when a target is slow.\nReturn the number of affected records in the database (1 or 0).\n\nParameter :\n\n* `id` : (required) Id of the check\n\nEx: `http://localhost:8082/api/checks/527a25bdc9de6e0000000004/test`\n\n#### `GET /pings`\n\nReturn a list of all pings\n\nParameters :\n\n* `?page=1` : (optional) Paginate results by 50\n* `?check=:id` : (optional) Return only the pings for a given check\n\nEx: `http://localhost:8082/api/pings?check=527a25bdc9de6e0000000004`\n\n#### `GET /pings/events`\n\nReturn a list of events (CheckEvent) aggregated by day, limited to the latest week, and to 100 results\n\n#### `POST /pings`\n\nCreate a ping for a check, if the check exists and is not already polled\n\nParameters :\n\n* `checkId` : (required) Id of the check\n* `status` : (required)  Status\n* `timestamp` : (optional) Date of polling\n* `time` : (required) Response time\n* `name` : (optional) Monitor name\n* `error` : (optional)\n* `details` : (optional)\n\n#### `GET /tags`\n\nReturn list of all tags\n\n#### `GET /tags/:name`\n\nReturn a single tag\n\nParameter :\n\n* `name` : (required) name of the tag\n\nEx: `http://localhost:8082/tags/good`\n\n#### `PUT /checks`\n\nCreate a new check and return it\n\nParameters :\n\n* `url` : (required) Url of the check\n* `name` : (optional) Name of the check - if empty, url will be set as check name\n* `interval` : (optional) Interval of polling\n* `maxTime` : (optional) Slow threshold\n* `isPaused` : (optional) Status of polling\n* `alertTreshold` : (optional) set the threshold of failed pings that will create an alert\n* `tags` : (optional) list of tags (comma-separated values)\n* `type` : (optional) type of check (auto|http|https|udp)\n\n#### `POST /checks/:id`\n\nUpdate a check and return it\n\nParameters :\n\n* `id` : (required) Id of the check\n* `url` : (optional) Url of the check\n* `name` : (optional) Name of the check - if empty, url will be set as check name\n* `interval` : (optional) Interval of polling\n* `maxTime` : (optional) Slow threshold\n* `isPaused` : (optional) Status of polling\n* `alertTreshold` : (optional) set the threshold of failed pings that will create an alert\n* `tags` : (optional) list of tags (comma-separated values)\n* `type` : (optional) type of check - values : `auto`|`http`|`https`|`udp`\n\nEx: `http://localhost:8082/api/checks/527a25bdc9de6e0000000004`\n\n#### `DELETE /checks/:id`\n\nDelete a check\n\nParameters :\n\n* `id` : (required) Id of the check\n\nEx: `http://localhost:8082/api/checks/527a25bdc9de6e0000000004`\n\n### Statistics routes\n\n#### `GET /checks/:id/stat/:period/:timestamp`\n\nReturn check stats for a period\n\nParameters :\n\n   * `id` : (required) Id of the check\n   * `period` : (required) Period - values :  `hour`|`day`|`month`|`year`\n   * `timestamp` : (required) Start date (timestamp)\n\nEx: `http://localhost:8082/api/checks/527a25bdc9de6e0000000004/stat/day/1383260400000`\n\n#### `GET /checks/:id/stats/:type`\n\nReturn check stats for a period\n\nParameters :\n\n* `id` : (required) Id of the check\n* `type` : (required) Period - values :  `hour`|`day`|`month`|`year`\n* `?begin=` : (required) Start date (timestamp)\n* `?end=` : (required) End date (timestamp)\n\nEx: `http://localhost:8082/api/checks/527a25bdc9de6e0000000004/stats/month?begin=1383260400000\u0026end=1385852399999`\n\n#### `GET /tags/:name/checks/:period/:timestamp`\n\nReturn tag stats for a period, joined by checks\n\nParameters :\n\n* `name` : (required) Name of the tag\n* `period` : (required) Period - values :  `hour`|`day`|`month`|`year`\n* `timestamp` : (required) Start date (timestamp)\n\nEx: `http://localhost:8082/api/tags/good/checks/month/1384816432099`\n\n#### `GET /tags/:name/stat/:period/:timestamp`\n\nReturn tag stats for a period\n\nParameters :\n\n* `name` : (required) Name of the tag\n* `period` : (required) Period - values :  `hour`|`day`|`month`|`year`\n* `timestamp` : (required) Start date (timestamp)\n\nEx: `http://localhost:8082/api/tags/good/stat/month/1383260400000`\n\n#### `GET /tags/:name/stats/:type`\n\nReturn tag stats for a period\n\nParameters :\n\n* `name` : (required) Name of the tag\n* `type` : (required) Period - values :  `day`|`month`|`year`\n* `?begin=` : (required) Start date (timestamp)\n* `?end=` : (required) End date (timestamp)\n\nEx: `http://localhost:8082/api/tags/good/stats/month?begin=1383260400000\u0026end=1385852399999`\n\n### Event routes\n\n#### `GET /checks/:id/events`\n\nReturn the list of all events for the check\n\nParameter :\n\n* `id` : (required) Id of the check\n\nEx: `http://localhost:8082/api/checks/527a25bdc9de6e0000000004/events`\n\n#### `GET /tags/:name/events`\n\nReturn the list of all events associated to the tag\n\nParameter :\n\n* `name` : (required) Name of the tag\n* `?begin=` : (optional) Start date (timestamp)\n* `?end=` : (optional) End date (timestamp)\n\nEx: `http://localhost:8082/api/tags/good/events?begin=1383260400000\u0026end=1385852399999`\n\nSupport and Discussion\n----------------------\n\nJoin the [node-uptime](https://groups.google.com/d/forum/node-uptime) Google Group to discuss features, bugs and use cases related to Uptime.\n\nLicense\n-------\n\nThe Uptime code is free to use and distribute, under the [MIT license](https://raw.github.com/fzaninotto/uptime/master/LICENSE).\n\nUptime uses third-party libraries:\n\n* [NodeJS](http://nodejs.org/), licensed under the [MIT License](https://github.com/joyent/node/blob/master/LICENSE#L5-22),\n* [Socket.io](http://socket.io/), licensed under the [MIT License](https://github.com/LearnBoost/socket.io/blob/master/Readme.md),\n* [MongooseJS](http://mongoosejs.com/), licensed under the [MIT License](https://github.com/LearnBoost/mongoose/blob/master/README.md),\n* [jQuery](http://jquery.com/), licensed under the [MIT License](http://jquery.org/license),\n* [TwitterBootstrap](http://twitter.github.com/bootstrap/), licensed under the [Apache License v2.0](http://www.apache.org/licenses/LICENSE-2.0),\n* [Flotr2](http://www.humblesoftware.com/flotr2/), licensed under the [MIT License](https://github.com/HumbleSoftware/Flotr2/blob/master/LICENSE).\n* [Favicon](http://www.alexpeattie.com/projects/justvector_icons/), distributed under the [Free Art License](http://artlibre.org/licence/lal/en).\n\nIf you like the software, please help improving it by contributing PRs on the [GitHub project](https://github.com/fzaninotto/uptime)!\n\nTODO\n----\n\n* Account for scheduled maintenance (and provide two QoS calculations: with and without scheduled maintenance)\n* Allow for JavaScript execution in the monitored resources by using a headless browser (probably zombie.js)\n* Unit tests\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffzaninotto%2Fuptime","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffzaninotto%2Fuptime","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffzaninotto%2Fuptime/lists"}