# openshift-hearbeat-monitor-generator

> A tool to dynamically generate configuration files to be used with [Heartbeat](https://www.elastic.co/beats/heartbeat) to monitor OpenShift routes.

Latest version **1.0.5** (published 2020-11-11) · MIT license · 0 weekly downloads

## Install

```sh
npm install openshift-hearbeat-monitor-generator
pnpm add openshift-hearbeat-monitor-generator
yarn add openshift-hearbeat-monitor-generator
bun add openshift-hearbeat-monitor-generator
```

Provides the command `openshift-hearbeat-monitor-generator`.

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.5 |
| Published | 2020-11-11 |
| First published | 2020-11-10 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 4.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Gabriel Rimes |
| Maintainers | victorhugo.pmartins, kaerimichi, dotgroup |

## Links

- npm: https://www.npmjs.com/package/openshift-hearbeat-monitor-generator
- npm.io page: https://npm.io/package/openshift-hearbeat-monitor-generator

## Dependencies (2)

- [commander](https://npm.io/package/commander.md) ^6.2.0
- [openshift-api-client](https://npm.io/package/openshift-api-client.md) ^0.1.10

## Recent versions

- 1.0.5 (latest) — 2020-11-11
- 1.0.4 — 2020-11-11
- 1.0.3 — 2020-11-11
- 1.0.2 — 2020-11-10

## README

# OpenShift Heartbeat Monitor Generator

A tool to dynamically generate configuration files to be used with [Heartbeat](https://www.elastic.co/beats/heartbeat) to monitor OpenShift routes.

## Installation

```
$  npm i -g openshift-hearbeat-monitor-generator
```

## Usage

First, you need to add a label to your route. The default label name is "uptime-monitor" and will take the monitoring interval as a value (values can be in **h**ours, **m**inutes or **s**econds), for example:

```
apiVersion: route.openshift.io/v1
kind: Route
metadata:
  labels:
    app: my-app
    uptime-monitor: 1h
  name: my-public-route
spec:
  host: my-app.com
  tls:
...
```

And then you'll need to execute the `generate-monitor` subcommand with your cluster URL and access token.

```
$ openshift-hearbeat-monitor-generator generate-monitor \
  --cluster-url https://url-to-your-openshift-cluster:8443 \
  --token 'your-access-token'
```

The routes containing the label will be scanned in your cluster and the output (stdout) will be something like this:

```
- type: http
  name: my-public-route
  urls: ["https://my-app.com"]
  schedule: "@every 1h"
```

You can easily use bash redirection (or by piping with `tee`) to write this configuration into a file that will be read by the Heartbeat daemon (e.g., `/etc/heartbeat/conf.d/openshift-routes.yml`).

### Status Code

Some routes will not return a 200 HTTP status code while still indicating that the application is online. Although Heartbeat is not a tool to perform healthchecks in your applications, you can use the label "uptime-status-code" to get around this.

**Note:** You can override the names of the labels with the enviroment variables `MONITOR_LABEL` and `MONITOR_STATUS_CODE_LABEL`.

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