https://github.com/ondras/smon
simple service monitoring
https://github.com/ondras/smon
old
Last synced: 8 months ago
JSON representation
simple service monitoring
- Host: GitHub
- URL: https://github.com/ondras/smon
- Owner: ondras
- Created: 2017-01-04T12:17:46.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2017-09-21T12:41:08.000Z (almost 9 years ago)
- Last Synced: 2025-02-25T03:15:12.658Z (over 1 year ago)
- Topics: old
- Language: JavaScript
- Homepage:
- Size: 21.5 KB
- Stars: 8
- Watchers: 3
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# smon
Simple MONitoring tool
## Features
`smon` includes these probes:
- **TCP** for testing TCP connections;
- **HTTP** for testing HTTP responses, status codes and response lengths;
- **PING** for testing ICMP replies;
- **CERT** for validating X.509 certificates and days until their expiration.
The following reporting methods are available:
- setting an **exit code**;
- logging to a **standard output**;
- mailing via **sendmail**;
- writing to a **syslog**;
- making an **HTTP request** (chat bots and other external tools).
## Installation
```
git clone https://github.com/ondras/smon.git
```
## Configuration
1. Create the `conf/` subdirectory
1. Put all your configuration inside:
1. Configuration files are CommonJS modules (i.e. JavaScript files)
1. All files in `conf/` are used; you can either create one-file-per-configuration-element or use one file for all configuration
1. The `conf-example/` directory shows several examples for probes and reporters
The configuration API has these methods:
```js
require("..").addProbe({ /* probe configuration */ });
require("..").addReporter({ /* reporter configuration */ });
require("..").configure({ /* global options */ });
```
A very simple configuration might look like this:
```js
var app = require("..");
// make sure this web is reachable
app.addProbe({
type: "http",
url: "http://www.example.com/",
status: 200
});
// if not, send me an e-mail
app.addReporter({
type: "sendmail",
to: "user@example.com",
subject: "smon probe failure"
});
```
## Running
```
node .
```
If you have a recent node (6.2+) and your symlinked conffiles are broken, try:
```
node --preserve-symlinks .
```
## Why?
I needed something trivial, easy-to-configure, easy-to-hack. `smon` is written in less than 9kB of JS. Also, I needed a new pet project for my *start learning vim again* chore.