# chronica-active

> monitor urls with email alerts

Latest version **0.1.2** (published 2015-04-04) · ISC license · 0 weekly downloads

## Install

```sh
npm install chronica-active
pnpm add chronica-active
yarn add chronica-active
bun add chronica-active
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.2 |
| Published | 2015-04-04 |
| First published | 2015-04-04 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 4 |
| Known vulnerabilities | 0 (+21 in 3 direct dependencies) |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Evan Summers |
| Maintainers | evanx |

## Links

- npm: https://www.npmjs.com/package/chronica-active
- Repository: https://github.com/evanx/chronica-active
- Issues: https://github.com/evanx/chronica-active/issues
- npm.io page: https://npm.io/package/chronica-active

## Dependencies (4)

- [babel](https://npm.io/package/babel.md) ^5.0.8
- [lodash](https://npm.io/package/lodash.md) ^3.5.0
- [request](https://npm.io/package/request.md) ^2.54.0
- [nodemailer](https://npm.io/package/nodemailer.md) ^1.3.2

## Recent versions

- 0.1.2 (latest) — 2015-04-04
- 0.1.1 — 2015-04-04
- 0.1.0 — 2015-04-04

## README

## Chronica Active - a microservice to monitor urls

See: https://github.com/evanx/chronica-active/blob/master/lib/checkUrls.js


### Background: Chronica suite

Chronica is envisaged as suite of components and microservices to assist with centralized logging, analytics and monitoring.

The technology stack includes Node, Redis and ReactJS.

This is inspired by an earlier effort which used Java, SQL and AngularJS, namely <a href="https://github.com/evanx/chronic">Chronic</a>, which has been abandoned.

See: https://github.com/evanx/chronica


### Sample config file

The initial trivial implementation checks URLs and alerts admins via email when the site goes down or the HTTP response code changes e.g. from 200 to an error response e.g. 500 or 404.

```json
{
   "alerts": {
      "fromEmail": "chronica-alerts@ngena.com",
      "admins": [
          {
             "email": "...@gmail.com"
          }
       ]
   },
   "checkUrls": {
      "period": 60000,
      "alertCount": 2
   },
   "services": [
      {
         "url": "github.com/evanx",
      }
   ]
}
```

Currently the application is hardcoded to load the config file from `/var/chronica/active.json` unless it is specified in the environment variable `CONFIG_FILE.`

See: https://github.com/evanx/chronica-active/blob/master/lib/app-active-chronica.js

We start the app as follows using `pm2.`

```shell
$ cd ~/chronica-active
$ pm2 start lib/app-active-chronica.js
```

### Triggering alerts

The URLs are checked every `period` e.g. 60 seconds, and the nonzero `alertCount` is used for debouncing status changes.

If the status changes, then only upon a subsequent recheck, is the alert triggered e.g. 2 minutes later.

See: https://github.com/evanx/chronica-active/blob/master/lib/Services.js


### Sending alerts

We use `nodemailer` which works out the box for `@gmail.com` addresses.

See: https://github.com/evanx/chronica-active/blob/master/lib/Alerts.js


### Other resources

Chronica overview: https://github.com/evanx/chronica

Wiki home: https://github.com/evanx/vellum/wiki

---
_Source: https://npm.io/package/chronica-active · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
