# vermont

> serVER MONiTor

Latest version **0.0.1** (published 2015-12-29) · WTFPL license · 0 weekly downloads

## Install

```sh
npm install vermont
pnpm add vermont
yarn add vermont
bun add vermont
```

Provides the command `vermont`.

## 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.0.1 |
| Published | 2015-12-29 |
| First published | 2015-12-29 |
| Weekly downloads | 0 |
| License | WTFPL |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 4 |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 1 |
| Author | frux |
| Maintainers | frux |
| Keywords | monitor |

## Links

- npm: https://www.npmjs.com/package/vermont
- Repository: https://github.com/frux/vermont
- Homepage: https://github.com/frux/vermont#readme
- Issues: https://github.com/frux/vermont/issues
- npm.io page: https://npm.io/package/vermont

## Dependencies (4)

- [got](https://npm.io/package/got.md) ^5.3.0
- [chalk](https://npm.io/package/chalk.md) ^1.1.1
- [seenk](https://npm.io/package/seenk.md) ^0.2.2
- [minimist](https://npm.io/package/minimist.md) ^1.2.0

## Recent versions

- 0.0.1 (latest) — 2015-12-29

## README

# vermont
[![Build Status](https://travis-ci.org/frux/vermont.svg?branch=master)](https://travis-ci.org/frux/vermont)
[![Coverage Status](https://coveralls.io/repos/frux/vermont/badge.svg?branch=master&service=github)](https://coveralls.io/github/frux/vermont?branch=master)

Ser**ver** **mon**i**t**oring tool

Vermont allow you to check your server's state. It can ping urls and exec shell commands.

## Usage
Vermont available to use right in [JS code](#usage) and as a [CLI application](#cli). The both checks (ping and exec) require parameter `expected` to be specified. It may be a number or a string. Vermont compares different values in order to `expected` type.

|expected|ping                  |exec          |
|--------|----------------------|--------------|
|number  |response status code  |exit code     |
|string  |response body         |command stdout|

For example: if you need to check that url answers 200 status code you should set `expected` to 200. But if you want to know that url answers 'ok' in its body you may set `expected` to `'ok'`. The `exec` method works just as well.

**NOTE**: If type of `expected` is a string it will be used as a **regular expression**.

**NOTE**: If `expected` parameter is not specified Vermont will use `200` for `ping` or `0` for `exec` as default.

## JS code
### Install
`npm i vermont`

### Usage
```js
var vermont = require('vermont');

vermont.ping('http://mysite.com', 200)
  .then(function(){ console.log('OK'); })
  .catch(function(error){ console.log('fail'); });
```

### Error object format
For ping method:
```js
{
  action: 'ping',
  url: 'http://mysite.com',
  expected: 200,
  received: 502,
  status: 'error'
}
```

For exec method:
```js
{
  action: 'exec',
  url: 'echo 2+2',
  expected: 5,
  received: 4,
  status: 'error'
}
```

## CLI
### Install
`npm i -g vermont`

### Usage
```vermont [OPTIONS] -f <CONFIG_FILE>```

### Available options
```
  -f, --file  Path to the config file
  -s, --sync  Run checks synchronously
  -h, --help  Show help
```

### Config file
Vermont config file contains checks. So far Vermont can only check different urls. Here is the example of config that checks some urls:
```json
[
  {
    "name": "test-1",
    "ping": "https://yandex.ru"
  },
  {
    "name": "test-2",
    "ping": "https://google.com"
  },
  {
    "name": "test-3",
    "ping": "https://facebook.com"
  }
]
```

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