diff --git a/404.html b/404.html index db23549a7..bddc9ce41 100644 --- a/404.html +++ b/404.html @@ -17,4 +17,4 @@ gtag('config', 'G-W999ZM71FP', { page_path: window.location.pathname, }); -

PT Artha Rajamas Mandiri (Hyperjump) is an open-source-first company providing engineering excellence service. We aim to build and commercialize open-source tools to help companies streamline, simplify, and secure the most important aspects of its modern DevOps practices.

Copyright © 2024 Hyperjump Tech. All Rights Reserved.

\ No newline at end of file +

PT Artha Rajamas Mandiri (Hyperjump) is an open-source-first company providing engineering excellence service. We aim to build and commercialize open-source tools to help companies streamline, simplify, and secure the most important aspects of its modern DevOps practices.

Copyright © 2024 Hyperjump Tech. All Rights Reserved.

\ No newline at end of file diff --git a/_next/data/AN642a-UCV83IhN5juWrn/articles.json b/_next/data/_sD9KsbwzUhhP5BkvR_AL/articles.json similarity index 100% rename from _next/data/AN642a-UCV83IhN5juWrn/articles.json rename to _next/data/_sD9KsbwzUhhP5BkvR_AL/articles.json diff --git a/_next/static/AN642a-UCV83IhN5juWrn/_buildManifest.js b/_next/static/_sD9KsbwzUhhP5BkvR_AL/_buildManifest.js similarity index 100% rename from _next/static/AN642a-UCV83IhN5juWrn/_buildManifest.js rename to _next/static/_sD9KsbwzUhhP5BkvR_AL/_buildManifest.js diff --git a/_next/static/AN642a-UCV83IhN5juWrn/_middlewareManifest.js b/_next/static/_sD9KsbwzUhhP5BkvR_AL/_middlewareManifest.js similarity index 100% rename from _next/static/AN642a-UCV83IhN5juWrn/_middlewareManifest.js rename to _next/static/_sD9KsbwzUhhP5BkvR_AL/_middlewareManifest.js diff --git a/_next/static/AN642a-UCV83IhN5juWrn/_ssgManifest.js b/_next/static/_sD9KsbwzUhhP5BkvR_AL/_ssgManifest.js similarity index 100% rename from _next/static/AN642a-UCV83IhN5juWrn/_ssgManifest.js rename to _next/static/_sD9KsbwzUhhP5BkvR_AL/_ssgManifest.js diff --git a/articles.html b/articles.html index 26768942f..937ed8ee2 100644 --- a/articles.html +++ b/articles.html @@ -17,4 +17,4 @@ gtag('config', 'G-W999ZM71FP', { page_path: window.location.pathname, }); -

Articles

Published at Wed, 29 Mar 2023 01:42:52 GMT
Published at Wed, 15 Mar 2023 00:24:30 GMT
Published at Wed, 08 Mar 2023 00:34:55 GMT
Published at Tue, 28 Feb 2023 13:13:24 GMT
Published at Wed, 15 Feb 2023 00:53:34 GMT
Published at Wed, 08 Feb 2023 00:10:31 GMT
Published at Wed, 01 Feb 2023 01:35:55 GMT
Published at Wed, 25 Jan 2023 00:24:23 GMT

PT Artha Rajamas Mandiri (Hyperjump) is an open-source-first company providing engineering excellence service. We aim to build and commercialize open-source tools to help companies streamline, simplify, and secure the most important aspects of its modern DevOps practices.

Copyright © 2024 Hyperjump Tech. All Rights Reserved.

\ No newline at end of file +

Articles

Published at Wed, 29 Mar 2023 01:42:52 GMT
Published at Wed, 15 Mar 2023 00:24:30 GMT
Published at Wed, 08 Mar 2023 00:34:55 GMT
Published at Tue, 28 Feb 2023 13:13:24 GMT
Published at Wed, 15 Feb 2023 00:53:34 GMT
Published at Wed, 08 Feb 2023 00:10:31 GMT
Published at Wed, 01 Feb 2023 01:35:55 GMT
Published at Wed, 25 Jan 2023 00:24:23 GMT

PT Artha Rajamas Mandiri (Hyperjump) is an open-source-first company providing engineering excellence service. We aim to build and commercialize open-source tools to help companies streamline, simplify, and secure the most important aspects of its modern DevOps practices.

Copyright © 2024 Hyperjump Tech. All Rights Reserved.

\ No newline at end of file diff --git a/deployment/deploy-to-fly-io.html b/deployment/deploy-to-fly-io.html index 879f91286..a1418ab65 100644 --- a/deployment/deploy-to-fly-io.html +++ b/deployment/deploy-to-fly-io.html @@ -17,9 +17,9 @@ gtag('config', 'G-W999ZM71FP', { page_path: window.location.pathname, }); -

Deploy to Fly.io

Star (0)

This article covers how to deploy a Monika instance to Fly.io.

  1. Go to the Monika Github repository and download two files: Dockerfile.flyio and fly.toml.example

  2. Rename the fly.toml.example to fly.toml`.

  3. Edit the contents of the fly.toml:

    app = "monika" # Change the app name to the desired name
    +

    Deploy to Fly.io

    Star (0)

    This article covers how to deploy a Monika instance to Fly.io.

    1. Go to the Monika Github repository and download two files: Dockerfile.flyio and fly.toml.example

    2. Rename the fly.toml.example to fly.toml`.

    3. Edit the contents of the fly.toml:

      app = "monika" # Change the app name to the desired name
      kill_signal = "SIGINT"
      kill_timeout = 5
      [build]
      dockerfile = "Dockerfile.flyio"
      [build.args]
      PARAMS = "-v" # Change the parameters according to your needs
      [env]
      PARAMS = "-v" # Match the content of this PARAMS variable to the one in `build.args` block
      -
      [experimental]
      auto_rollback = true

      Refer to the Fly.io App Configuration Docs to customize the example TOML even further.

    4. Install Fly.io CLI tools (flyctl) in your computer

    5. a. Proceed to authenticate to Fly.io by running flyctl auth login in your terminal.

      b. If you haven't signed up to Fly.io yet, you can sign up by running flyctl auth signup in your terminal.

    6. Create a new Fly.io app by running flyctl apps create and enter the app name according to your fly.toml you have created before.

    7. Deploy Monika to your Fly.io by running flyctl deploy

    8. Wait until the deployment is finished, and check Monika logs from the Fly.io dashboard to confirm that your Monika instance is running.

    Was this page helpful?

    PT Artha Rajamas Mandiri (Hyperjump) is an open-source-first company providing engineering excellence service. We aim to build and commercialize open-source tools to help companies streamline, simplify, and secure the most important aspects of its modern DevOps practices.

    Copyright © 2024 Hyperjump Tech. All Rights Reserved.

    \ No newline at end of file +
    [experimental]
    auto_rollback = true

    Refer to the Fly.io App Configuration Docs to customize the example TOML even further.

  4. Install Fly.io CLI tools (flyctl) in your computer

  5. a. Proceed to authenticate to Fly.io by running flyctl auth login in your terminal.

    b. If you haven't signed up to Fly.io yet, you can sign up by running flyctl auth signup in your terminal.

  6. Create a new Fly.io app by running flyctl apps create and enter the app name according to your fly.toml you have created before.

  7. Deploy Monika to your Fly.io by running flyctl deploy

  8. Wait until the deployment is finished, and check Monika logs from the Fly.io dashboard to confirm that your Monika instance is running.

Was this page helpful?

PT Artha Rajamas Mandiri (Hyperjump) is an open-source-first company providing engineering excellence service. We aim to build and commercialize open-source tools to help companies streamline, simplify, and secure the most important aspects of its modern DevOps practices.

Copyright © 2024 Hyperjump Tech. All Rights Reserved.

\ No newline at end of file diff --git a/guides/alerts.html b/guides/alerts.html index 24f90dc71..ea31bf94f 100644 --- a/guides/alerts.html +++ b/guides/alerts.html @@ -17,4 +17,4 @@ gtag('config', 'G-W999ZM71FP', { page_path: window.location.pathname, }); -

Alerts

Star (0)

Alerts are the types of conditions that will trigger Monika to send notifications. It is an array defined in the config file monika.yml like so.

probes:
- id: '1'
name: Name of the probe
requests:
- method: GET
url: https://github.com
alerts:
- assertion: response.size >= 10000
message: Response size is {{ response.size }}, expecting less than 10000

You can define two types of alerts: request alerts and probe alerts

Request Alerts

Request alerts are alerts configurations that are scoped under the requests key. Alerts defined under a specific request will run for that specific request only. Take a look at the example below:

probes:
- id: '1'
name: Name of the probe
requests:
- method: GET
url: https://github.com
alerts:
- assertion: response.status != 200
message: Status not 2xx # (This alert is only triggered for the github.com request)
- method: GET
url: https://gitlab.com
alerts:
- assertion: response.status != 200
message: Status not 2xx # (This alert is only triggered for the gitlab.com request)

Probe Alerts

Probe alerts are alerts configurations that are defined under the probe key. Alerts scoped under the probe key will run for all requests for that probe. Take a look at the example below:

probes:
- id: '1'
name: Name of the probe
requests:
- method: GET
url: https://github.com
alerts:
- assertion: response.status != 200
message: Status not 2xx # (This alert is only triggered for the github.com request)
- method: GET
url: https://gitlab.com
alerts:
- assertion: response.status != 200
message: Status not 2xx # (This alert is only triggered for the gitlab.com request)
alerts:
- assertion: response.time > 10000 # in milliseconds
message: Response time is longer than 10 seconds # (This alert is triggered for all request)

Alert Timing

Probes are performed after every interval, and alerts are generated after a specified threshold. Monika can perform probes once a second, therefore a theoretical maximum rate of one alert a second. Please keep in mind that there may be some delays to your network, notification channels (slack, email, etc), so your result will vary.

In general it will be something like:

Alert resolution = interval period (s) x threshold + network_and_channel_latencies

From above, the theoretical maximum resolution is one second.

Alert Assertion

Assertion contains any arbitrary expression that will trigger alert when it returns a truthy value

alerts:
- assertion: response.status == 500

Inside the assertion expression you can get the response object.

These are values that are available:

  • response.status: HTTP status code of the response
  • response.time: the time it takes to perform a HTTP request
  • response.size: size of the response in bytes
  • response.headers: HTTP response headers
  • response.body: HTTP response body (if content-type is JSON, it will be parsed automatically)

The response.headers and response.body can be queried further with object access syntax.

For example, to trigger alert when content-type is not json you may use

alerts:
- assertion: response.headers['content-type'] != "application/json"

Or to assertion value inside the body

alerts:
- assertion: response.body.data.todos[0].title != "Drink water"

Additionally you can have processing done in your queries. For instance, to ensure case insensitivity, you might want to convert to lowercase. It might look something like this:

alerts:
- assertion: has(lowerCase(response.body.status), "success")

These operators are available:

Numeric arithmeticDescription
x + yAdd
x - ySubtract
x * yMultiply
x / yDivide
x % yModulo
x ^ yPower
ComparisonsDescription
x == yEquals
x != yDoes not equal
x < yLess than
x <= yLess than or equal to
x > yGreater than
x >= yGreater than or equal to
x ~= yRegular expression match
x in (a, b, c)Equivalent to (x == a or x == b or x == c)
x not in (a, b, c)Equivalent to (x != a and x != b and x != c)
Boolean logicDescription
x or yBoolean or
x and yBoolean and
not xBoolean not
x ? y : zIf boolean x, value y, else z
( x )Explicit operator precedence

There are also several helper functions available:

  • has(object, property): Checks whether an object has searched property.

    example: has(response.body, "data") checks if there is "data" property inside response.body

  • lowerCase(string): Converts string to lowercase

    example: lowerCase(response.body.message) converts message string value to lowercase

  • upperCase(string): Converts string to uppercase

    example: upperCase(response.body.message) converts message string value to uppercase

  • startsWith(string, target): Checks if string starts with the given target string

    example: startsWith(response.body.message, "Hello") checks if message string value starts with "Hello"

  • endsWith(string, target): Checks if string ends with the given target string

    example: startsWith(response.body.message, "world!") checks if message string value ends with "world!"

  • includes(collection, value): Checks if value is in collection. If collection is a string, it's checked for a substring of value

    example 1: includes(response.body.prizes, "gold") checks if "gold" exists in the prizes array.

    example 2: includes(response.body.message, "ello") checks if "ello" is a substring of the message string.

  • size(collection): Gets length of array or string values.

    example: size(response.body.data.items) gets the count of items.

  • isEmpty(value): Checks if value is an empty object, empty array, empty string, null, or undefined.

    example: isEmpty(response.body.data) checks whether the data property is empty or not

Alert Message

alerts:
- assertion: response.status != 200
message: HTTP Status code is different, expecting 200

This is the message that is used in the sent notification.

Inside the message string, you can also get the response object similar to assertion by surrounding the expression with double curly braces like the example above.

Built-in Alerts

Monika will automatically issue an alert when it detects a probe is inaccessible. An incident and recovery alert will be sent to all configured notification channels. Note that explicit connection assertion and customized message strings are not yet supported.

Further reading

  1. Probes
  2. Notifications
← PrevCLI Options
Was this page helpful?
Next →Notifications

PT Artha Rajamas Mandiri (Hyperjump) is an open-source-first company providing engineering excellence service. We aim to build and commercialize open-source tools to help companies streamline, simplify, and secure the most important aspects of its modern DevOps practices.

Copyright © 2024 Hyperjump Tech. All Rights Reserved.

\ No newline at end of file +

Alerts

Star (0)

Alerts are the types of conditions that will trigger Monika to send notifications. It is an array defined in the config file monika.yml like so.

probes:
- id: '1'
name: Name of the probe
requests:
- method: GET
url: https://github.com
alerts:
- assertion: response.size >= 10000
message: Response size is {{ response.size }}, expecting less than 10000

You can define two types of alerts: request alerts and probe alerts

Request Alerts

Request alerts are alerts configurations that are scoped under the requests key. Alerts defined under a specific request will run for that specific request only. Take a look at the example below:

probes:
- id: '1'
name: Name of the probe
requests:
- method: GET
url: https://github.com
alerts:
- assertion: response.status != 200
message: Status not 2xx # (This alert is only triggered for the github.com request)
- method: GET
url: https://gitlab.com
alerts:
- assertion: response.status != 200
message: Status not 2xx # (This alert is only triggered for the gitlab.com request)

Probe Alerts

Probe alerts are alerts configurations that are defined under the probe key. Alerts scoped under the probe key will run for all requests for that probe. Take a look at the example below:

probes:
- id: '1'
name: Name of the probe
requests:
- method: GET
url: https://github.com
alerts:
- assertion: response.status != 200
message: Status not 2xx # (This alert is only triggered for the github.com request)
- method: GET
url: https://gitlab.com
alerts:
- assertion: response.status != 200
message: Status not 2xx # (This alert is only triggered for the gitlab.com request)
alerts:
- assertion: response.time > 10000 # in milliseconds
message: Response time is longer than 10 seconds # (This alert is triggered for all request)

Alert Timing

Probes are performed after every interval, and alerts are generated after a specified threshold. Monika can perform probes once a second, therefore a theoretical maximum rate of one alert a second. Please keep in mind that there may be some delays to your network, notification channels (slack, email, etc), so your result will vary.

In general it will be something like:

Alert resolution = interval period (s) x threshold + network_and_channel_latencies

From above, the theoretical maximum resolution is one second.

Alert Assertion

Assertion contains any arbitrary expression that will trigger alert when it returns a truthy value

alerts:
- assertion: response.status == 500

Inside the assertion expression you can get the response object.

These are values that are available:

  • response.status: HTTP status code of the response
  • response.time: the time it takes to perform a HTTP request
  • response.size: size of the response in bytes
  • response.headers: HTTP response headers
  • response.body: HTTP response body (if content-type is JSON, it will be parsed automatically)

The response.headers and response.body can be queried further with object access syntax.

For example, to trigger alert when content-type is not json you may use

alerts:
- assertion: response.headers['content-type'] != "application/json"

Or to assertion value inside the body

alerts:
- assertion: response.body.data.todos[0].title != "Drink water"

Additionally you can have processing done in your queries. For instance, to ensure case insensitivity, you might want to convert to lowercase. It might look something like this:

alerts:
- assertion: has(lowerCase(response.body.status), "success")

These operators are available:

Numeric arithmeticDescription
x + yAdd
x - ySubtract
x * yMultiply
x / yDivide
x % yModulo
x ^ yPower
ComparisonsDescription
x == yEquals
x != yDoes not equal
x < yLess than
x <= yLess than or equal to
x > yGreater than
x >= yGreater than or equal to
x ~= yRegular expression match
x in (a, b, c)Equivalent to (x == a or x == b or x == c)
x not in (a, b, c)Equivalent to (x != a and x != b and x != c)
Boolean logicDescription
x or yBoolean or
x and yBoolean and
not xBoolean not
x ? y : zIf boolean x, value y, else z
( x )Explicit operator precedence

There are also several helper functions available:

  • has(object, property): Checks whether an object has searched property.

    example: has(response.body, "data") checks if there is "data" property inside response.body

  • lowerCase(string): Converts string to lowercase

    example: lowerCase(response.body.message) converts message string value to lowercase

  • upperCase(string): Converts string to uppercase

    example: upperCase(response.body.message) converts message string value to uppercase

  • startsWith(string, target): Checks if string starts with the given target string

    example: startsWith(response.body.message, "Hello") checks if message string value starts with "Hello"

  • endsWith(string, target): Checks if string ends with the given target string

    example: startsWith(response.body.message, "world!") checks if message string value ends with "world!"

  • includes(collection, value): Checks if value is in collection. If collection is a string, it's checked for a substring of value

    example 1: includes(response.body.prizes, "gold") checks if "gold" exists in the prizes array.

    example 2: includes(response.body.message, "ello") checks if "ello" is a substring of the message string.

  • size(collection): Gets length of array or string values.

    example: size(response.body.data.items) gets the count of items.

  • isEmpty(value): Checks if value is an empty object, empty array, empty string, null, or undefined.

    example: isEmpty(response.body.data) checks whether the data property is empty or not

Alert Message

alerts:
- assertion: response.status != 200
message: HTTP Status code is different, expecting 200

This is the message that is used in the sent notification.

Inside the message string, you can also get the response object similar to assertion by surrounding the expression with double curly braces like the example above.

Built-in Alerts

Monika will automatically issue an alert when it detects a probe is inaccessible. An incident and recovery alert will be sent to all configured notification channels. Note that explicit connection assertion and customized message strings are not yet supported.

Further reading

  1. Probes
  2. Notifications
← PrevCLI Options
Was this page helpful?
Next →Notifications

PT Artha Rajamas Mandiri (Hyperjump) is an open-source-first company providing engineering excellence service. We aim to build and commercialize open-source tools to help companies streamline, simplify, and secure the most important aspects of its modern DevOps practices.

Copyright © 2024 Hyperjump Tech. All Rights Reserved.

\ No newline at end of file diff --git a/guides/cli-options.html b/guides/cli-options.html index 1a86e3ea1..a16eccb0e 100644 --- a/guides/cli-options.html +++ b/guides/cli-options.html @@ -17,7 +17,7 @@ gtag('config', 'G-W999ZM71FP', { page_path: window.location.pathname, }); -

Command-line Options

Star (0)

Monika can be run with the single command monika typed into the command shell. However to fully enjoy its flexibility, there are several options and arguments that can be used.

The common -h or --help displays all available options

monika -h

Configuration

Monika by default will look for the monika.yml config file. +

Command-line Options

Star (0)

Monika can be run with the single command monika typed into the command shell. However to fully enjoy its flexibility, there are several options and arguments that can be used.

The common -h or --help displays all available options

monika -h

Configuration

Monika by default will look for the monika.yml config file. You may want to store different configurations for different environments or projects. Applying custom configurations is straightforward by using the -c or --config flag followed by the filename.

monika --config staging-set.yml

A neat feature is that the configuration file is watched and any changes will cause Monika to reload.

You can also use a configuration from some remote resource, which you specify using the same -c flag and a URI address.

monika -c https://raw.githubusercontent.com/hyperjumptech/monika/main/config_sample/config.desktop.example.yml

For remote configuration files, you can additionally specify how often (in seconds) Monika checks for changes with the --config-interval switch like this:

monika -c https://raw.githubusercontent.com/hyperjumptech/monika/main/config_sample/config.desktop.example.yml --config-interval 10

By default, monika will check remote locations once every 15 minutes.

Multiple configurations

Monika also supports multiple sources of configuration at the same time. Any top-level keys from the first argument will be overridden by the later source(s).

For example, assuming you have a file named only-notif.yml whose content {"notifications":[<your-notifications-here>]}

# only-notif.yml's notifications will override notifications foo-monitoring.yml has
monika -c foo-monitoring.yml only-notif.yml

Auto-update

Monika supports automatic update with --auto-update major|minor|patch. Where major|minor|patch refers to semantic versioning (semver) specification. By default, the updater will check for a new Monika version every 24 hours.

monika --auto-update patch

Note that auto-update will make Monika terminate itself after successful update. To automatically restart Monika when terminated, you need to run Monika with a process manager application, e.g., monit, pm2, nodemon.

Create Config

Just starting out? Want to make a new configuration? Running monika without any parameters (and without any default config found in the working directory) will pull a default configuration monika.yml as a starting point. Looking for more options? The --create-config flag will spin up an easy Web based configuration file generator.

monika --create-config

As an alternative, the generator is able to read HAR or postman files as input to convert into monika.yml configuration files.

Use the --har or the --postman in combination with --create-config on the command line to convert those files.

monika --create-config --har myfile.har

The above example creates a config file from an existing HAR archive. Auto generated files defaults to 'monika.yml'. Use the -o output flag to specify another name.

monika --create-config --postman mypostman.json -o new-monika.yml

When generating config files, if an existing monika.yml already exists, the user will be prompted before overwriting. To bypass the user prompt, use the --force flag.

Force

The --force flag forces the execution of a command. The force flag will bypass any user prompts with an affirmative. If a Yes/No prompt is normally presented, --force will bypass the prompt and assume a Yes.

monika --flush --force

The example above flushes the database without waiting for user confirmation.

HAR

Monika supports HAR files as input. HAR are JSON formatted HTTP ARchive files. Follow these steps to generate your own HAR file from the site you've visited then use Monika to refetch the pages and ensure they still work.

You use the -H or --har to specify a HAR file.

monika -H my-file.har

Create config from HAR file

You can use the combination of --create-config and --har flags to convert the HAR archive into a monika.yml configuration file.

# default to monika.yml
monika --create-config -H my-file.har

Merge HAR file to existing configurations

You can also use -c/--config to merge properties with them. Note that using --har will override probes passed to -c/--config.

monika --config monika-notifications.yml -H my-file.har

P.S.: HAR files may contain sensitive information, use caution when distributing HAR filles.

Id

By default Monika loops through all the probe configurations in the order they are entered. However, you can specify any run order you want using the -i or --id flags.

monika -i 1,3,1,2,4,5,7,7

The above example will run probe id 1, 3, 1, 2, 4, 5, 7, 7 in that order just once. All id must be valid ids on the configuration file. You can combine the --id flag with the -r repeat flag to continuously repeat the specific ids.

Logging

Monika stores requests and responses data in an internal log file. By default, it only stores data when an incident or recovery occurs. You may choose to store all requests using the --keep-verbose-logs flag.

monika --keep-verbose-logs

To dump (display) all the logs, use the -l or --logs flag.

monika --logs

You can flush the log history with the --flush option. there is no -f short flag for this command.

monika --flush

You must respond with a capital "Y" to confirm if you want to flush the logs or use the --force flag to force a Yes without prompting.

Postman

NOTE: We only support Postman collection v2.0 and v2.1 files.

Have an existing request on postman you want to automate? Monika supports reading postman.yml as configuration input. Use the -p or the --postman switches.

monika -p postman.json

Create config from Postman file

You can use the combination of --create-config and --postman flags to convert the postman files to a monika.yml config file.

monika --create-config --postman postman.json

Merge Postman file to existing configurations

You can also use -c/--config to merge properties with them. Note that using --postman will override probes passed to -c/--config.

monika --config monika-notifications.yml --postman my-postman-collection.json

Insomnia

Use your own Insomnia collection with Monika by providing --insomnia or -I. We currently only support Insomnia export version 4. You can use both JSON and YAML file format.

monika -I /your/insomnia/collection.yaml # JSON / YAML

Create config from Insomnia file

Generate your Monika configuration by combining --create-config and --insomnia flags to convert your Insomnia collection file to a monika config file.

monika --create-config --insomnia /your/insomnia/collection.yaml # JSON / YAML

Merge Insomnia file to existing configurations

Merge your existing configurations with an Insomnia collection file using -c/--config together with -I/--insomnia. Note that this will override probes passed to -c.

monika --config monika-notifications.yml --insomnia /insomnia/collection.yml

Sitemap

Monika supports reading sitemap.xml as configuration input. Use the --sitemap switches.

monika --sitemap sitemap.xml

or you can also add --one-probe flag to merge all requests into single probe.

monika --sitemap sitemap.xml --one-probe

Create config from Sitemap file

You can use the combination of --create-config and --sitemap flags to convert the sitemap xml file to a monika.yml config file.

monika --create-config --sitemap sitemap.xml

or you can also add --one-probe flag to merge all requests into single probe.

monika --create-config --sitemap sitemap.xml --one-probe

Prometheus

You can expose the Prometheus metrics server with the --prometheus flag and server port as a value.

monika --prometheus 3001

Then you can scrape the metrics from http://localhost:3001/metrics.

Available Metrics

Monika exposes Prometheus default metrics, Node.js specific metrics, and Monika probe metrics below.

Metric NameTypePurposeLabel
monika_probes_totalGaugeCollect total probe-
monika_request_status_code_infoGaugeCollect HTTP status codeid, name, url, method
monika_request_response_time_secondsHistogramCollect duration of probe request in secondsid, name, url, method, statusCode
monika_request_response_size_bytesGaugeCollect size of response size in bytesid, name, url, method, statusCode
monika_alert_totalCounterCollect total alert triggeredid, name, url, method, alertQuery

Repeat

By default monika will continuously loop through all your probes in the configuration. To loop for a specific number of repeats use the -r or --repeat flags followed by a number. For example to repeat only 3 times type the command below:

monika -r 3

You can combine this flag with the --id flag to repeat custom sequences.

monika -r 3 -i 1,3,1

Retry Initial Delay

If Monika failed to probe, it will retry the request with and increase the interval exponentially. To set the first delay, you can use the --retryInitialDelayMs flag. Default to 128ms.

monika --retryInitialDelayMs 128

Retry Maximum Delay

You can also set the maximum of delay by using the --retryMaxDelayMs flag. Default to 30,000ms or 30 seconds.

monika --retryMaxDelayMs 30000

Native Fetch from Node.js

Monika use Axios as HTTP client by default, use --native-fetch to switch to native fetch provided by Node.js runtime.

monika --native-fetch

Follow Redirects

By default Monika will follow redirects 21 times. You can set the value of --follow-redirects flag to tell Monika to follow redirects as many as you want. If you don't want to follow redirects, set the value to zero.

monika --follow-redirects 0 # disable following redirects

STUN

By default monika will continuously check the STUN server every 20 second intervals. Continuously STUN checking ensures that connectivity to the outside world is guaranteed. When STUN checking fails, Monika assumes the network is down and probing will be paused.

You can specify the number of checking intervals using the -s or --stun flags followed by a number in seconds. For example to set the interval to every 10 seconds type the parameter below:

monika -s 10

If the number is zero or less, monika will check the STUN server just once, not repeatedly, to get public IP.

For internal networks where no outside connection is needed, you can disable the STUN checking by setting the -s flag to -1 as follows.

monika -s -1

Summary

While Monika is running, you can fetch the running statistics by using the --summary flag from another terminal.

monika --summary

Please note that you need to run the above command from the same working directory as the running monika you want to see/check. -The '--summary' flag also will not work when no other monika process is running.

TLS Reject Unauthorized

If there is a probe with request(s) that uses HTTPS, Monika will show an error if the target's TLS certificate is invalid (such as self-signed certificates, hostname/IP does not match certificate's altnames, and many other OpenSSL error codes). You can configure whether HTTPS requests should ignore invalid certificates using the --ignoreInvalidTLS flag.

monika --ignoreInvalidTLS

TTL Cache

Enable time-to-live for in-memory (HTTP) cache entries in minutes. This cache is used for requests with identical HTTP request config, e.g. headers, method, url.

Only usable for probes which does not have chaining requests.

# Set TTL cache for HTTP to 5 minutes
monika --ttl-cache 5

User Agent

The --user-agent flag in the Monika command allows you to set a custom user agent string for HTTP requests. This string is used to identify the browser, operating system, and device making the request. Setting a custom user agent can help simulate different browsing environments or bypass certain server restrictions. Defaults to "@hyperjumptech/monika/{current Monika version}"

# Set TTL cache for HTTP to 5 minutes
monika --user-agent "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.169 Safari/537.36"

Verbose

Like your app to be more chatty and honest revealing all its internal details? Use the --verbose flag.

monika --verbose

Verbose Cache

Show (HTTP) cache hit / miss messages to log.

This will only show for probes which does not have chaining requests.

monika --verbose-cache

Version

The -v or --version flag prints the current application version.

monika -v

PT Artha Rajamas Mandiri (Hyperjump) is an open-source-first company providing engineering excellence service. We aim to build and commercialize open-source tools to help companies streamline, simplify, and secure the most important aspects of its modern DevOps practices.

Copyright © 2024 Hyperjump Tech. All Rights Reserved.

\ No newline at end of file +The '--summary' flag also will not work when no other monika process is running.

TLS Reject Unauthorized

If there is a probe with request(s) that uses HTTPS, Monika will show an error if the target's TLS certificate is invalid (such as self-signed certificates, hostname/IP does not match certificate's altnames, and many other OpenSSL error codes). You can configure whether HTTPS requests should ignore invalid certificates using the --ignoreInvalidTLS flag.

monika --ignoreInvalidTLS

TTL Cache

Enable time-to-live for in-memory (HTTP) cache entries in minutes. This cache is used for requests with identical HTTP request config, e.g. headers, method, url.

Only usable for probes which does not have chaining requests.

# Set TTL cache for HTTP to 5 minutes
monika --ttl-cache 5

User Agent

The --user-agent flag in the Monika command allows you to set a custom user agent string for HTTP requests. This string is used to identify the browser, operating system, and device making the request. Setting a custom user agent can help simulate different browsing environments or bypass certain server restrictions. Defaults to "@hyperjumptech/monika/{current Monika version}"

# Set TTL cache for HTTP to 5 minutes
monika --user-agent "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.169 Safari/537.36"

Verbose

Like your app to be more chatty and honest revealing all its internal details? Use the --verbose flag.

monika --verbose

Verbose Cache

Show (HTTP) cache hit / miss messages to log.

This will only show for probes which does not have chaining requests.

monika --verbose-cache

Version

The -v or --version flag prints the current application version.

monika -v

PT Artha Rajamas Mandiri (Hyperjump) is an open-source-first company providing engineering excellence service. We aim to build and commercialize open-source tools to help companies streamline, simplify, and secure the most important aspects of its modern DevOps practices.

Copyright © 2024 Hyperjump Tech. All Rights Reserved.

\ No newline at end of file diff --git a/guides/configuration-file.html b/guides/configuration-file.html index 41f1fd4ab..551de9da2 100644 --- a/guides/configuration-file.html +++ b/guides/configuration-file.html @@ -17,4 +17,4 @@ gtag('config', 'G-W999ZM71FP', { page_path: window.location.pathname, }); -

Configuration File

Star (0)

Monika uses a YAML file to define all the settings and configurations. You can find a sample configuration file in the repository called monika.example.yml.

Pro tips: If you use Visual Studio Code (VSCode) on a regular basis, you can write the configuration file with the help of auto completion by installing the YAML extension for VSCode. More information can be found in our Creating Monika Configuration from Scratch using Autocomplete in Visual Studio Code blog post.

Another pro tips: If you'd rather use a GUI to create the configuration file, you can use the Monika Config Generator web app.

In general Monika and its configuration file, monika.yml is divided into three sections. A probe, an alert and a notification section.

Probes

Probes describe one or more requests to perform on your service to test. A probe will include the request, the URL to test, its method, timeout and any headers and body that you might wish to add.

Here is an example probe:

probes:
- id: 'submission_test'
name: HTML form submission
description: simulate html form submission
interval: 10 # in seconds
requests:
- url: https://httpbin.org/status/200
method: POST
timeout: 7000 # in milliseconds
headers:
Content-Type: application/x-www-form-urlencoded

For further details on probes, check the Probes guide.

Alerts

Alerts describe the conditions to trigger a notification. Alerts are basically test conditions for your service, such as http status, response time, or a particular response body.

The example below defines two alerts that will send notification if the HTTP response status is 500 or if the response time is greater than 150 ms.

alerts:
- assertion: response.status == 500
message: response status is 500
- assertion: response.time > 150 # in milliseconds
message: response time is slow

For details on alerts and how you can define different kind of queries, see the Alerts guide.

Notifications

Once an alert is triggered, Monika will send one or more notifications through any of the supported channels that you defined.

For instance, a simple desktop notification needs to be defined as follows:

notifications:
- id: my-desktop-notif
type: desktop

Or an e-mail notification via your own SMTP server can be done by defining the following configuration:

notifications:
- id: random-string-smtp
type: smtp
data:
recipients: [RECIPIENT_EMAIL_ADDRESS]
hostname: SMTP_HOSTNAME
port: 587
username: SMTP_USERNAME
password: SMTP_PASSWORD

Note that you can define more than one notification and Monika will notify you through them all when an alert is triggered.

Monika supports a wide variety of communication channels such as WhatsApp, Discord, Google Chat, and many more. For the complete list of the different notification channels that Monika supports, visit the Notifications page.

Pro tips: If the communication app you are using with your team is not supported by Monika, you can follow our guide to add it to Monika in Add your choice of notification channels to Monika blog post. Some of the notification channels that Monika supports are thanks to fellow developers' open source contributions!

← PrevQuick Start
Was this page helpful?
Next →CLI Options

PT Artha Rajamas Mandiri (Hyperjump) is an open-source-first company providing engineering excellence service. We aim to build and commercialize open-source tools to help companies streamline, simplify, and secure the most important aspects of its modern DevOps practices.

Copyright © 2024 Hyperjump Tech. All Rights Reserved.

\ No newline at end of file +

Configuration File

Star (0)

Monika uses a YAML file to define all the settings and configurations. You can find a sample configuration file in the repository called monika.example.yml.

Pro tips: If you use Visual Studio Code (VSCode) on a regular basis, you can write the configuration file with the help of auto completion by installing the YAML extension for VSCode. More information can be found in our Creating Monika Configuration from Scratch using Autocomplete in Visual Studio Code blog post.

Another pro tips: If you'd rather use a GUI to create the configuration file, you can use the Monika Config Generator web app.

In general Monika and its configuration file, monika.yml is divided into three sections. A probe, an alert and a notification section.

Probes

Probes describe one or more requests to perform on your service to test. A probe will include the request, the URL to test, its method, timeout and any headers and body that you might wish to add.

Here is an example probe:

probes:
- id: 'submission_test'
name: HTML form submission
description: simulate html form submission
interval: 10 # in seconds
requests:
- url: https://httpbin.org/status/200
method: POST
timeout: 7000 # in milliseconds
headers:
Content-Type: application/x-www-form-urlencoded

For further details on probes, check the Probes guide.

Alerts

Alerts describe the conditions to trigger a notification. Alerts are basically test conditions for your service, such as http status, response time, or a particular response body.

The example below defines two alerts that will send notification if the HTTP response status is 500 or if the response time is greater than 150 ms.

alerts:
- assertion: response.status == 500
message: response status is 500
- assertion: response.time > 150 # in milliseconds
message: response time is slow

For details on alerts and how you can define different kind of queries, see the Alerts guide.

Notifications

Once an alert is triggered, Monika will send one or more notifications through any of the supported channels that you defined.

For instance, a simple desktop notification needs to be defined as follows:

notifications:
- id: my-desktop-notif
type: desktop

Or an e-mail notification via your own SMTP server can be done by defining the following configuration:

notifications:
- id: random-string-smtp
type: smtp
data:
recipients: [RECIPIENT_EMAIL_ADDRESS]
hostname: SMTP_HOSTNAME
port: 587
username: SMTP_USERNAME
password: SMTP_PASSWORD

Note that you can define more than one notification and Monika will notify you through them all when an alert is triggered.

Monika supports a wide variety of communication channels such as WhatsApp, Discord, Google Chat, and many more. For the complete list of the different notification channels that Monika supports, visit the Notifications page.

Pro tips: If the communication app you are using with your team is not supported by Monika, you can follow our guide to add it to Monika in Add your choice of notification channels to Monika blog post. Some of the notification channels that Monika supports are thanks to fellow developers' open source contributions!

← PrevQuick Start
Was this page helpful?
Next →CLI Options

PT Artha Rajamas Mandiri (Hyperjump) is an open-source-first company providing engineering excellence service. We aim to build and commercialize open-source tools to help companies streamline, simplify, and secure the most important aspects of its modern DevOps practices.

Copyright © 2024 Hyperjump Tech. All Rights Reserved.

\ No newline at end of file diff --git a/guides/examples.html b/guides/examples.html index bcd08cfa0..35c8c4d0e 100644 --- a/guides/examples.html +++ b/guides/examples.html @@ -17,8 +17,8 @@ gtag('config', 'G-W999ZM71FP', { page_path: window.location.pathname, }); -

Examples

Star (0)

Minimal Configuration

At minimum, you only need to specify the url you want to monitor. For example to monitor github.com:

probes:
- requests:
- url: https://github.com

If you didn't define the http method, it will use the GET method by default. Please note that with this configuration, you will not get any notifications when the site github.com is down since the notification configuration is not defined.

Enabling Notification

Probes are more useful with notifications enabled to alert when something is amiss. The following is an example configuration to get notification via e-mail when an incident occurs:

notifications:
- id: unique-id-smtp
type: smtp
data:
recipients:
- YOUR_EMAIL_ADDRESS_HERE
hostname: smtp.gmail.com
port: 587
username: YOUR_GMAIL_ACCOUNT
password: YOUR_GMAIL_PASSWORD_OR_APP_PASSWORD
probes:
- id: '1'
name: Monika Landing Page
description: Landing page of awesome Monika
interval: 10 # in seconds
requests:
- url: https://hyperjumptech.github.io/monika
timeout: 7000 # in milliseconds
alerts:
- assertion: response.status < 200 or response.status > 299
message: Target is not healthy. It has not been returning status code 2xx.
- assertion: response.time > 2000 # in milliseconds
message:
Target is not healthy. The response time has been greater than 2000
ms.

Using the above configuration, Monika will check the landing page every 10 seconds and will send a notification by email when the landing page is down 5 times in a row. For more information about available notification channels, refer to Notifications.

HTML Form Submission Example

You can also send POST requests using Monika. The following is an example of sending a POST request to simulate HTML form submission.

probes:
- id: '1'
name: HTML form submission
description: simulate html form submission
interval: 10 # in seconds
requests:
- method: POST
url: http://www.example.com/login.php
timeout: 7000 # in milliseconds
headers:
Content-Type: application/x-www-form-urlencoded
body:
username: someusername
password: somepassword

Using the configuration above, Monika will send a POST request to http://www.example.com/login.php with the defined request's body.

Multiple requests

Monika supports sending multiple requests one after another in a single probe. Below is one such configuration:

probes:
- id: '1'
name: Simulate form submit
description: simulate html form submission
interval: 15 # in seconds
requests:
- method: GET
url: https://github.com/
timeout: 7000 # in milliseconds
saveBody: false
- method: GET
url: https://github.com/hyperjumptech
timeout: 7000 # in milliseconds
saveBody: true
alerts:
- assertion: response.status > 299
message: Target is not healthy. It has not been returning status code 2xx.
- assertion: response.time > 2000 # in milliseconds
message:
Target is not healthy. The response time has been greater than 2000
ms.

In the configuration above, Monika will first check https://github.com/ then https://github.com/hyperjumptech. If the status code of https://github.com/ is not 2xx (e.g., 200, 201), Monika will not check https://github.com/hyperjumptech.

If there is a case where executing a GET request to https://github.com triggers an alert, the next request will not be executed.

Requests Chaining

Monika supports request chaining, which enables you to do multiple requests and the ability to use past responses from earlier requests. For example, after executing a GET request to a certain API, the next request could use the previous request(s) response into their path/assertion parameters or headers.

Here is an example on how you could get previous request(s) response data into your next request:

{{ responses.[0].status }} ==> Get status code from first request response
{{ responses.[1].body.token }} ==> Get token from second request response
{{ responses.[2].headers.SetCookie[0] }} ==> Get first cookie from third request response

In the example above, responses.[0] refers to the response from the first request in the probe, responses.[1] refers to the response from the second request in the probe, and so on. Please note that you can only use the response from previous requests in the same probe.

Please refer to Probe Response Anatomy in order to know which value could be used from the response body for the next request(s).

In the sections below, you can find several examples of configuration files which contain chaining requests.

Pass Response Data as Path/Query Parameters

Here is an example of using previous request's response in the path/assertion parameters:

probes:
- id: '1'
name: Simulate form submit
description: simulate html form submission
interval: 15 # in seconds
requests:
- method: GET
url: https://reqres.in/api/users
timeout: 7000 # in milliseconds
- method: GET
url: https://reqres.in/api/users/{{ responses.[0].body.data.[0].id }}
timeout: 7000 # in milliseconds
alerts:
- assertion: response.status > 299
message: Target is not healthy. It has not been returning status code 2xx.
- assertion: response.time > 2000 # in milliseconds
message:
Target is not healthy. The response time has been greater than 2000
ms.

In the configuration above, the first request will fetch all users from https://reqres.in/api/users. Then in the second request, Monika will fetch the details of the first user from the first request. If there are no triggered alerts, the response returned from the first request is ready to be used by the second request using values from {{ responses.[0].body }}.

Let's say the response from fetching all users in JSON format is as follows:

{
"page": 2,
"per_page": 6,
"total": 12,
"total_pages": 2,
"data": [
{
"id": 7,
"email": "michael.lawson@reqres.in",
"first_name": "Michael",
"last_name": "Lawson",
"avatar": "https://reqres.in/img/faces/7-image.jpg"
},
...
]
}

To use the user ID of the first user in the second request, we define the url of the second request as {{ responses.[0].body.data.[0].id }}.

Pass Response Data as Headers value

Here is an example of using previous request's response in the headers:

probes:
- id: '1'
name: Simulate form submit
description: simulate html form submission
interval: 15 # in seconds
requests:
- method: POST
url: https://reqres.in/api/login
timeout: 7000 # in milliseconds
body:
email: eve.holt@reqres.in
password: cityslicka
- method: POST
url: https://reqres.in/api/users/
timeout: 7000 # in milliseconds
body:
name: morpheus
job: leader
headers:
Authorization: Bearer {{ responses.[0].body.token }}
alerts:
- assertion: response.status > 299
message: Target is not healthy. It has not been returning status code 2xx.
- assertion: response.time > 2000 # in milliseconds
message:
Target is not healthy. The response time has been greater than 2000
ms.

Using the above configuration, Monika will perform a login request in the first request, then use the returned token in the Authorization header of the second request.

Pass Response Data to Request Body

Continuing with the examples from www.reqres.in above, say we would like to use the previous GET request to perform a POST /login. If the data from the initial request is something like below:

{
"data":
{
"id": 1,
"email": "george.bluth@reqres.in",
"first_name": "George",
"last_name": "Bluth",
"avatar": "https://reqres.in/img/faces/1-image.jpg"
},
....
}

Then you can use the user's email in the login request body as follows:

probes:
- id: probe-01
name: 'body from response'
interval: 15 # in seconds
+

Examples

Star (0)

Minimal Configuration

At minimum, you only need to specify the url you want to monitor. For example to monitor github.com:

probes:
- requests:
- url: https://github.com

If you didn't define the http method, it will use the GET method by default. Please note that with this configuration, you will not get any notifications when the site github.com is down since the notification configuration is not defined.

Enabling Notification

Probes are more useful with notifications enabled to alert when something is amiss. The following is an example configuration to get notification via e-mail when an incident occurs:

notifications:
- id: unique-id-smtp
type: smtp
data:
recipients:
- YOUR_EMAIL_ADDRESS_HERE
hostname: smtp.gmail.com
port: 587
username: YOUR_GMAIL_ACCOUNT
password: YOUR_GMAIL_PASSWORD_OR_APP_PASSWORD
probes:
- id: '1'
name: Monika Landing Page
description: Landing page of awesome Monika
interval: 10 # in seconds
requests:
- url: https://hyperjumptech.github.io/monika
timeout: 7000 # in milliseconds
alerts:
- assertion: response.status < 200 or response.status > 299
message: Target is not healthy. It has not been returning status code 2xx.
- assertion: response.time > 2000 # in milliseconds
message:
Target is not healthy. The response time has been greater than 2000
ms.

Using the above configuration, Monika will check the landing page every 10 seconds and will send a notification by email when the landing page is down 5 times in a row. For more information about available notification channels, refer to Notifications.

HTML Form Submission Example

You can also send POST requests using Monika. The following is an example of sending a POST request to simulate HTML form submission.

probes:
- id: '1'
name: HTML form submission
description: simulate html form submission
interval: 10 # in seconds
requests:
- method: POST
url: http://www.example.com/login.php
timeout: 7000 # in milliseconds
headers:
Content-Type: application/x-www-form-urlencoded
body:
username: someusername
password: somepassword

Using the configuration above, Monika will send a POST request to http://www.example.com/login.php with the defined request's body.

Multiple requests

Monika supports sending multiple requests one after another in a single probe. Below is one such configuration:

probes:
- id: '1'
name: Simulate form submit
description: simulate html form submission
interval: 15 # in seconds
requests:
- method: GET
url: https://github.com/
timeout: 7000 # in milliseconds
saveBody: false
- method: GET
url: https://github.com/hyperjumptech
timeout: 7000 # in milliseconds
saveBody: true
alerts:
- assertion: response.status > 299
message: Target is not healthy. It has not been returning status code 2xx.
- assertion: response.time > 2000 # in milliseconds
message:
Target is not healthy. The response time has been greater than 2000
ms.

In the configuration above, Monika will first check https://github.com/ then https://github.com/hyperjumptech. If the status code of https://github.com/ is not 2xx (e.g., 200, 201), Monika will not check https://github.com/hyperjumptech.

If there is a case where executing a GET request to https://github.com triggers an alert, the next request will not be executed.

Requests Chaining

Monika supports request chaining, which enables you to do multiple requests and the ability to use past responses from earlier requests. For example, after executing a GET request to a certain API, the next request could use the previous request(s) response into their path/assertion parameters or headers.

Here is an example on how you could get previous request(s) response data into your next request:

{{ responses.[0].status }} ==> Get status code from first request response
{{ responses.[1].body.token }} ==> Get token from second request response
{{ responses.[2].headers.SetCookie[0] }} ==> Get first cookie from third request response

In the example above, responses.[0] refers to the response from the first request in the probe, responses.[1] refers to the response from the second request in the probe, and so on. Please note that you can only use the response from previous requests in the same probe.

Please refer to Probe Response Anatomy in order to know which value could be used from the response body for the next request(s).

In the sections below, you can find several examples of configuration files which contain chaining requests.

Pass Response Data as Path/Query Parameters

Here is an example of using previous request's response in the path/assertion parameters:

probes:
- id: '1'
name: Simulate form submit
description: simulate html form submission
interval: 15 # in seconds
requests:
- method: GET
url: https://reqres.in/api/users
timeout: 7000 # in milliseconds
- method: GET
url: https://reqres.in/api/users/{{ responses.[0].body.data.[0].id }}
timeout: 7000 # in milliseconds
alerts:
- assertion: response.status > 299
message: Target is not healthy. It has not been returning status code 2xx.
- assertion: response.time > 2000 # in milliseconds
message:
Target is not healthy. The response time has been greater than 2000
ms.

In the configuration above, the first request will fetch all users from https://reqres.in/api/users. Then in the second request, Monika will fetch the details of the first user from the first request. If there are no triggered alerts, the response returned from the first request is ready to be used by the second request using values from {{ responses.[0].body }}.

Let's say the response from fetching all users in JSON format is as follows:

{
"page": 2,
"per_page": 6,
"total": 12,
"total_pages": 2,
"data": [
{
"id": 7,
"email": "michael.lawson@reqres.in",
"first_name": "Michael",
"last_name": "Lawson",
"avatar": "https://reqres.in/img/faces/7-image.jpg"
},
...
]
}

To use the user ID of the first user in the second request, we define the url of the second request as {{ responses.[0].body.data.[0].id }}.

Pass Response Data as Headers value

Here is an example of using previous request's response in the headers:

probes:
- id: '1'
name: Simulate form submit
description: simulate html form submission
interval: 15 # in seconds
requests:
- method: POST
url: https://reqres.in/api/login
timeout: 7000 # in milliseconds
body:
email: eve.holt@reqres.in
password: cityslicka
- method: POST
url: https://reqres.in/api/users/
timeout: 7000 # in milliseconds
body:
name: morpheus
job: leader
headers:
Authorization: Bearer {{ responses.[0].body.token }}
alerts:
- assertion: response.status > 299
message: Target is not healthy. It has not been returning status code 2xx.
- assertion: response.time > 2000 # in milliseconds
message:
Target is not healthy. The response time has been greater than 2000
ms.

Using the above configuration, Monika will perform a login request in the first request, then use the returned token in the Authorization header of the second request.

Pass Response Data to Request Body

Continuing with the examples from www.reqres.in above, say we would like to use the previous GET request to perform a POST /login. If the data from the initial request is something like below:

{
"data":
{
"id": 1,
"email": "george.bluth@reqres.in",
"first_name": "George",
"last_name": "Bluth",
"avatar": "https://reqres.in/img/faces/1-image.jpg"
},
....
}

Then you can use the user's email in the login request body as follows:

probes:
- id: probe-01
name: 'body from response'
interval: 15 # in seconds
requests:
- url: https://reqres.in/api/users/1
method: GET
timeout: 5000 # in milliseconds
saveBody: false
headers:
Content-Type: application/json; charset=utf-8
- url: https://reqres.in/api/login
method: POST
timeout: 1000 # in milliseconds
headers:
Content-Type: application/json; charset=utf-8
body:
email: '{{ responses.[0].body.data.email }}'
password: password
alerts:
- assertion: response.status != 200
message: Http Response status code is not 200!
notifications:
- id: unique-id-desktop
type: desktop

Note: Please do not forget the single quotes before and after the opening and closing double braces to explicitly indicate a string value. YAML parsers will generate warnings without it.

Errors in Request Chaining

In a request chaining mode, if one request fails, Monika does not continue with the next request in the probe. The reasoning is that, if an earlier request, say a GET /token fails, it would be pointless to continue and fetch /userdata.

If you want to continue the next request even when the first one fails, we recommend putting your requests in multiple probes, something like this:

probes:
- id: get-user
name: 'get-user'
description: login and check user app data
interval: 30
requests:
- url: https://example.com/token
body: {user: 'xxxx', password: 'yyyy'}
method: POST
- url: https://example.com/userdata
method: GET
headers:
Authorization: Bearer {{ responses.[0].body.accessToken }}
-
- id: get-mail
name: 'get-mail'
description: fetching user emails
interval: 30
requests:
- url: https://example.com/token
body: {user: 'xxxx', password: 'yyyy'}
method: POST
timeout: 10000
method: POST
- url: https://example.com/usermail
method: GET
headers:
Authorization: Bearer {{ responses.[0].body.accessToken }}

In the example above, the get-email will run even if get-user has failed.

Was this page helpful?

PT Artha Rajamas Mandiri (Hyperjump) is an open-source-first company providing engineering excellence service. We aim to build and commercialize open-source tools to help companies streamline, simplify, and secure the most important aspects of its modern DevOps practices.

Copyright © 2024 Hyperjump Tech. All Rights Reserved.

\ No newline at end of file +
- id: get-mail
name: 'get-mail'
description: fetching user emails
interval: 30
requests:
- url: https://example.com/token
body: {user: 'xxxx', password: 'yyyy'}
method: POST
timeout: 10000
method: POST
- url: https://example.com/usermail
method: GET
headers:
Authorization: Bearer {{ responses.[0].body.accessToken }}

In the example above, the get-email will run even if get-user has failed.

Was this page helpful?

PT Artha Rajamas Mandiri (Hyperjump) is an open-source-first company providing engineering excellence service. We aim to build and commercialize open-source tools to help companies streamline, simplify, and secure the most important aspects of its modern DevOps practices.

Copyright © 2024 Hyperjump Tech. All Rights Reserved.

\ No newline at end of file diff --git a/guides/new-notifications.html b/guides/new-notifications.html index fb35aa63b..289c4e8c0 100644 --- a/guides/new-notifications.html +++ b/guides/new-notifications.html @@ -17,4 +17,4 @@ gtag('config', 'G-W999ZM71FP', { page_path: window.location.pathname, }); -

New Notifications

Star (0)

Introduction

Out of the box, Monika support a multitude of notification channels, from chat applications such as Slack, Discourse, Microsoft Teams, Google Chats to email based platform such as Mailgun, to generic webhooks and the SMTP protocol (full list can be found in Notifications here). Should you have a favorite tool we haven't supported, we invite you to add it to Monika's growing list. Here's how.

Prerequisites

There are few requirements to start adding a new notification to Monika:

  1. Some basic TypeScript may be helpful.
  2. Some familiarity with git is required to clone and create pull requests.
  3. A GitHub account to fork and clone the Monika open source repository.
  4. An environment already set up for development in JavaScript/TypeScript. See the project README for an overview.
  5. A code editor such as Vim or Visual Studio Code is recommended.

Add a New Notification

  1. Create a new file in the packages/notification/channel directory that satisfies the NotificationChannel type from the packages/notification/channel/index.ts file and implement the new notification.
type NotificationChannel<T = any> = {
validator: Joi.AnySchema
send: (notificationData: T, message: NotificationMessage) => Promise<void>
sendWithCustomContent?: (
notificationData: T,
customContent: T
) => Promise<void>
additionalStartupMessage?: (notificationData: T) => string
}
PropertyDescriptionExample
validatorTo validate the notificationData field by using JoiJoi.object().keys({ url: Joi.string().uri().required() })
sendIt will be invoked if the application needs to send a message through the channel-
sendWithCustomContentOptional to implement. It will be invoked by other apps that use package @hyperjumptech/monika-notification and need custom content in the notification-
additionalStartupMessageTo display additional message on the startup when using verbose flag-
  1. Import the implemented notification file to the packages/notification/channel/index.ts file.
import * as whatsapp from './whatsapp'
  1. Register it to the channels variable in the same file. The key in the channels variable will be used in the Monika configuration to identify the notification type.
export const channels: Record<string, NotificationChannel> = {
desktop,
'google-chat': googlechat,
// ...
whatsapp,
workplace,
}

Events

You can access different type of events from the message argument from the send function. It available on the meta.type property. Some of the events you need to handle are:

  • start: This is a "start-of-monitoring" message when monika is first fired up.
  • termination: A termination message occurs as Monika is shutting down.
  • incident: Incident is an alert triggered whenever we've detected an incident in the probes.
  • recovery: Recovery alert indicates the probe has recovered from the previous incident.
  • status-update: Status update is a daily summary message of the probe events.

This is the example how we handle the different events.

function getContent(
{ body, meta, summary }: NotificationMessage,
notificationType: string
): Content {
switch (notificationType) {
case 'start':
... code to send start notifications
case 'termination':
... code to send termination notifications
case `incident`:
... code to send incident notifications

This is where you can get creative and really customize the look and feel of the notifications. You can use icons, widgets, fonts and colors of your choice. In the example googlechat.ts below, you can see how headers, text coloring are used to create the incident notifications. Your choices and available options will vary depending on your application. Refer to the app's development/integration documentation for more information.

case 'incident':
return {
cards: [
{
header: {
title: 'Monika Notification',
subtitle: `New ${notificationType} from Monika`,
imageUrl: 'https://bit.ly/3kckaGO',
},
sections: [
{
widgets: [
{
textParagraph: {
text: `<b>Message: <font color=#ff0000>Alert!</font></b> ${summary}`,
},
},
{
textParagraph: {
text: `<b>URL:</b> <a href>${url}</a>`,
},
},
{
textParagraph: {
text: `<b>Time:</b> ${time}`,
},
},
{
textParagraph: {
text: `<b>From:</b> ${monikaInstance}`,
},
},
],
},
],
},
],
}

Validating

Monika users have the option to use JSON schema validation from their favorite editors. This is super convenient and provide useful real time feedback. Therefore it is mandatory to add a new schema to reflect your changes, otherwise, your new notification type will not be recognized and flagged as an unknown type.

Update the json schema in src/monika-config-schema.json to be able to validate your new notification.

In the example above, the google chat schema validation may look something like:

{
"title": "Google Chat",
"type": "object",
"required": ["id", "type", "data"],
"additionalProperties": false,
"properties": {
"id": {
"type": "string",
"description": "Unique notification id",
"default": "google-chat-01"
},
"type": {
"const": "google-chat"
},
"data": {
"type": "object",
"description": "Data for your payload",
"additionalProperties": false,
"required": ["url"],
"properties": {
"url": {
"$ref": "#/definitions/urlFormat",
"description": "The webhook URL for your google chat",
"examples": [
"https://chat.googleapis.com/v1/spaces/XXXXX/messages?key=1122334455"
]
}
}
}
}
},

For further documentation on json schemas, you can visit the json schema website here.

Testing

To make sure your integration won't break in the future, add your unit test(s) into the folder test/components/notification.test.ts. This will also ensure that all your code behaves as designed. We use Mocha.js testing framework and Chai.js' expect for assertion and checking.

Documentation

To wrap it up, add some documentation about your new app, specifically how to set it up for others to use. Users will love you for it.

That's it. Finally push your changes and create a pull request back to Monika's mainline repository and we'll merge it.

PT Artha Rajamas Mandiri (Hyperjump) is an open-source-first company providing engineering excellence service. We aim to build and commercialize open-source tools to help companies streamline, simplify, and secure the most important aspects of its modern DevOps practices.

Copyright © 2024 Hyperjump Tech. All Rights Reserved.

\ No newline at end of file +

New Notifications

Star (0)

Introduction

Out of the box, Monika support a multitude of notification channels, from chat applications such as Slack, Discourse, Microsoft Teams, Google Chats to email based platform such as Mailgun, to generic webhooks and the SMTP protocol (full list can be found in Notifications here). Should you have a favorite tool we haven't supported, we invite you to add it to Monika's growing list. Here's how.

Prerequisites

There are few requirements to start adding a new notification to Monika:

  1. Some basic TypeScript may be helpful.
  2. Some familiarity with git is required to clone and create pull requests.
  3. A GitHub account to fork and clone the Monika open source repository.
  4. An environment already set up for development in JavaScript/TypeScript. See the project README for an overview.
  5. A code editor such as Vim or Visual Studio Code is recommended.

Add a New Notification

  1. Create a new file in the packages/notification/channel directory that satisfies the NotificationChannel type from the packages/notification/channel/index.ts file and implement the new notification.
type NotificationChannel<T = any> = {
validator: Joi.AnySchema
send: (notificationData: T, message: NotificationMessage) => Promise<void>
sendWithCustomContent?: (
notificationData: T,
customContent: T
) => Promise<void>
additionalStartupMessage?: (notificationData: T) => string
}
PropertyDescriptionExample
validatorTo validate the notificationData field by using JoiJoi.object().keys({ url: Joi.string().uri().required() })
sendIt will be invoked if the application needs to send a message through the channel-
sendWithCustomContentOptional to implement. It will be invoked by other apps that use package @hyperjumptech/monika-notification and need custom content in the notification-
additionalStartupMessageTo display additional message on the startup when using verbose flag-
  1. Import the implemented notification file to the packages/notification/channel/index.ts file.
import * as whatsapp from './whatsapp'
  1. Register it to the channels variable in the same file. The key in the channels variable will be used in the Monika configuration to identify the notification type.
export const channels: Record<string, NotificationChannel> = {
desktop,
'google-chat': googlechat,
// ...
whatsapp,
workplace,
}

Events

You can access different type of events from the message argument from the send function. It available on the meta.type property. Some of the events you need to handle are:

  • start: This is a "start-of-monitoring" message when monika is first fired up.
  • termination: A termination message occurs as Monika is shutting down.
  • incident: Incident is an alert triggered whenever we've detected an incident in the probes.
  • recovery: Recovery alert indicates the probe has recovered from the previous incident.
  • status-update: Status update is a daily summary message of the probe events.

This is the example how we handle the different events.

function getContent(
{ body, meta, summary }: NotificationMessage,
notificationType: string
): Content {
switch (notificationType) {
case 'start':
... code to send start notifications
case 'termination':
... code to send termination notifications
case `incident`:
... code to send incident notifications

This is where you can get creative and really customize the look and feel of the notifications. You can use icons, widgets, fonts and colors of your choice. In the example googlechat.ts below, you can see how headers, text coloring are used to create the incident notifications. Your choices and available options will vary depending on your application. Refer to the app's development/integration documentation for more information.

case 'incident':
return {
cards: [
{
header: {
title: 'Monika Notification',
subtitle: `New ${notificationType} from Monika`,
imageUrl: 'https://bit.ly/3kckaGO',
},
sections: [
{
widgets: [
{
textParagraph: {
text: `<b>Message: <font color=#ff0000>Alert!</font></b> ${summary}`,
},
},
{
textParagraph: {
text: `<b>URL:</b> <a href>${url}</a>`,
},
},
{
textParagraph: {
text: `<b>Time:</b> ${time}`,
},
},
{
textParagraph: {
text: `<b>From:</b> ${monikaInstance}`,
},
},
],
},
],
},
],
}

Validating

Monika users have the option to use JSON schema validation from their favorite editors. This is super convenient and provide useful real time feedback. Therefore it is mandatory to add a new schema to reflect your changes, otherwise, your new notification type will not be recognized and flagged as an unknown type.

Update the json schema in src/monika-config-schema.json to be able to validate your new notification.

In the example above, the google chat schema validation may look something like:

{
"title": "Google Chat",
"type": "object",
"required": ["id", "type", "data"],
"additionalProperties": false,
"properties": {
"id": {
"type": "string",
"description": "Unique notification id",
"default": "google-chat-01"
},
"type": {
"const": "google-chat"
},
"data": {
"type": "object",
"description": "Data for your payload",
"additionalProperties": false,
"required": ["url"],
"properties": {
"url": {
"$ref": "#/definitions/urlFormat",
"description": "The webhook URL for your google chat",
"examples": [
"https://chat.googleapis.com/v1/spaces/XXXXX/messages?key=1122334455"
]
}
}
}
}
},

For further documentation on json schemas, you can visit the json schema website here.

Testing

To make sure your integration won't break in the future, add your unit test(s) into the folder test/components/notification.test.ts. This will also ensure that all your code behaves as designed. We use Mocha.js testing framework and Chai.js' expect for assertion and checking.

Documentation

To wrap it up, add some documentation about your new app, specifically how to set it up for others to use. Users will love you for it.

That's it. Finally push your changes and create a pull request back to Monika's mainline repository and we'll merge it.

PT Artha Rajamas Mandiri (Hyperjump) is an open-source-first company providing engineering excellence service. We aim to build and commercialize open-source tools to help companies streamline, simplify, and secure the most important aspects of its modern DevOps practices.

Copyright © 2024 Hyperjump Tech. All Rights Reserved.

\ No newline at end of file diff --git a/guides/notifications.html b/guides/notifications.html index d417d4212..6ea1df040 100644 --- a/guides/notifications.html +++ b/guides/notifications.html @@ -17,7 +17,7 @@ gtag('config', 'G-W999ZM71FP', { page_path: window.location.pathname, }); -

Notifications

Star (0)

Notification Types

Monika will send notifications to you whenever alerts are triggered, e.g., when the response status of a probed URL is not 2xx success code (status-not-2xx).

At this moment, Monika support these channel of notifications (You can use just one or more):

  1. Desktop Notifications
  2. Discord
  3. Facebook Workplace
  4. Google Chat
  5. Lark Suite
  6. Mailgun
  7. Microsoft Teams
  8. Monika Whatsapp Notifier
  9. PagerDuty
  10. SendGrid
  11. Slack
  12. SMTP
  13. Telegram
  14. Webhook
  15. WhatsApp Business
  16. Dingtalk
  17. Pushover
  18. Opsgenie
  19. Pushbullet
  20. Instatus

Configurations

To use one or more notifications, you need to define the settings in the monika.yml file as shown below.

notifications:
- id: unique-id-mailgun
type: mailgun
data:
recipients: ['RECIPIENT_EMAIL_ADDRESS1', 'RECIPIENT_EMAIL_ADDRESS2']
apiKey: YOUR_API_KEY
domain: YOUR_DOMAIN
+

Notifications

Star (0)

Notification Types

Monika will send notifications to you whenever alerts are triggered, e.g., when the response status of a probed URL is not 2xx success code (status-not-2xx).

At this moment, Monika support these channel of notifications (You can use just one or more):

  1. Desktop Notifications
  2. Discord
  3. Facebook Workplace
  4. Google Chat
  5. Lark Suite
  6. Mailgun
  7. Microsoft Teams
  8. Monika Whatsapp Notifier
  9. PagerDuty
  10. SendGrid
  11. Slack
  12. SMTP
  13. Telegram
  14. Webhook
  15. WhatsApp Business
  16. Dingtalk
  17. Pushover
  18. Opsgenie
  19. Pushbullet
  20. Instatus

Configurations

To use one or more notifications, you need to define the settings in the monika.yml file as shown below.

notifications:
- id: unique-id-mailgun
type: mailgun
data:
recipients: ['RECIPIENT_EMAIL_ADDRESS1', 'RECIPIENT_EMAIL_ADDRESS2']
apiKey: YOUR_API_KEY
domain: YOUR_DOMAIN
- id: unique-id-sendgrid
type: sendgrid
data:
sender: YOUR_VERIFIED_EMAIL_BY_SENDGRID
recipients: ['RECIPIENT_EMAIL_ADDRESS']
apiKey: YOUR_API_KEY
- id: unique-id-smtp
type: smtp
data:
recipients: ['RECIPIENT_EMAIL_ADDRESS']
hostname: SMTP_HOSTNAME
port: 587
username: SMTP_USERNAME
password: SMTP_PASSWORD
-
- id: unique-id-webhook
type: webhook
data:
url: https://WEBHOOK_URL

Note that every triggered alert will be sent to you through all the notifications you defined in the configuration file, e.g., if you added webhook and smtp settings, you will receive the alert messages through both.

Desktop Notifications

Monika supports desktop notifications. Here are the prerequisites for enabling the desktop notifications:

  • macOS: Uses OSAScript (Apple Open Scripting Architecture). AppleScript 2.0 or later and macOS version 10.5 or later required.
  • Linux: Uses notify-send command. notify-osd or libnotify-bin required (Ubuntu should have this by default).
  • Windows: Uses Powershell. Refer to Microsoft Official Documentation for System Requirements.
notifications:
- id: unique-id-monika-notif
type: desktop

Discord

Monika supports Discord. To enable notification via Discord, you must create a discord webhook first. More info at Discord webhook documentation

notifications:
- id: unique-id-webhook
type: discord
data:
url: https://YOUR_DISCORD_URL
KeyDescriptionExample
IDNotification identity numberDiscord12345
TypeNotification typesdiscord
UrlThe URL of the Discord Webhook that will receive notificationhttps://discord.com/api/webhook/<webhook.id>/<webhook.token>

Facebook Workplace

Monika supports Facebook Workplace. To enable notification via Workplace, you must create custom integration first. More info at Facebook Workplace Custom Integrations

notifications:
- id: unique-workplace-id
type: workplace
data:
thread_id: abcd-123-456
access_token: your_custom_integration_access_token
KeyDescriptionExample
IDNotification identity numberWorkplace12345
TypeNotification typesworkplace
ThreadIDIt's located at thread url, in the last segment6367478493277649
AccessTokenWorkplace access token for custom integrationDQVJzYWtsdHRJRWIxUk9uOG5VV...

Google Chat

You can send Monika notifications to your Google Chat. First you need to generate the url webhook for Monika to use. To create a webhook:

  1. Open Google Chat
  2. Go to the space to add notification
  3. Select Manage webhook from the top of the page
  4. Under Incoming webhook, click Add another if one already exists, in either case you need to provide a name.
  5. Name the new webhook and Save
  6. Copy the URL in the webhook modal
  7. You will need the URL in your monika configuration

For further information check the Google Chat documentations here

Example of Google Chat configuration may be something similar to below:

notifications:
- id: myGoogleChatNotif
type: google-chat
data:
url: https://chat.googleapis.com/v1/spaces/XXXXX/messages?key=1122334455

Larksuite Notifications

If you use Larksuite, you can get Monika to send notifications to the Larksuite bots. You can create a webhook url, and then use it in the monika configuration.

You can find more information on creating webhooks here.

The Yaml config setup may look something like this:

notifications:
- id: lark-group-message
type: lark
data:
url: https://open.larksuite.com/open-apis/bot/v2/hook/your-webhook-key-here

Keep watch on these pages, new notification methods are being developed.

Mailgun

Mailgun is an email notification delivery service provided by Mailgun email service. To use mailgun for your notification,

  1. You would need a mailgun account.
  2. Get your API key by referring to this documentation.
  3. For your domain
    • • If you are on the free plan, add authorized recipients as instructed here.
    • • If you want to use your own domain, refer here to add it.
  4. After that, put them in monika.yml configuration as follows:
notifications:
- id: unique-id-mailgun
type: mailgun
data:
recipients: ['RECIPIENT_EMAIL_ADDRESS']
apiKey: YOUR_API_KEY
domain: YOUR_DOMAIN
KeyDescriptionExample
IDNotification identity numberMailgun12345
TypeNotification typesmailgun
RecipientsAn array of email addresses that will receive the email from Monika["monika@testmail.com", "symon@testmail.com"]
Api KeyMailgun account api key, mailgun registered key to identify your accountMAILGUN_API_KEY
DomainThe domain to set in Mailgunsandboxmail.mailgun.com

Microsoft Teams

Monika supports sending notifications via Microsoft Teams. In order to be able to send notifications via Microsoft Teams, you may need to add Connectors and webhooks to your channel. Please refer to Microsoft Teams Documentation to enable connectors and webhooks.

notifications:
- id: unique-id-teams
type: teams
data:
url: https://YOUR_TEAMS_WEBHOOK_URL
KeyDescriptionExample
IDNotification identity numberMyTeamsNotif123
TypeNotification typesteams
UrlThe URL of your Microsoft Teams Webhookhttps://<company>.webhook.office.com/webhookb2/1234-abcdef

Monika WhatsApp Notifier

You can get a notification from Monika to your WhatsApp number without having a Whatsapp Business account. First, you must create a Monika Whatsapp Notifier account.

notifications:
- id: unique-monika-notif-id
type: monika-notif
data:
url: https://YOUR_MONIKA_NOTIF_URL
KeyDescriptionExample
IDNotification identity numberMonikaNotif12345
TypeNotification typesmonika-notif
UrlThe URL of the Monika Notif Webhook linkhttps://whatsapp.hyperjump.tech/api/notify?token=<webhook.token>

Please note, to receive messages from the WhatsApp cloud API the following requirements are mandatory.

  • The recipient phone number must be a WhatsApp phone number.
  • The recipient must accept Meta's new Terms of Service and Privacy Policy.
  • The recipient must use the following WhatsApp version or greater:
    Android: 2.21.15.15
    SMBA: 2.21.15.15
    iOS: 2.21.170.4
    SMBI: 2.21.170.4
    KaiOS: 2.2130.10
    Web: 2.2132.6

PagerDuty

PagerDuty is a platform for agile incident management. You need the integration key to use PagerDuty which you can get by following the steps in PagerDuty's services and integration docs. To give you the flexibility to choose which probe belongs to which PagerDuty service. You need to map the PagerDuty integration key with your Monika probe id in the configuration.

notifications:
- id: unique-id-pagerduty-notify
type: pagerduty
data:
- key: YOUR_PAGERDUTY_INTEGRATION_KEY
probeID: ZN32nw_KsvTKtLFNu55JV
KeyDescriptionExample
idNotification identity numberpager-duty-1
typeNotification typespagerduty
data.keyPagerDuty integration key0nlar5b9ko8hnqrvsfnhtmihyopn5eri
data.probeIDMonika Probe IDZN32nw_KsvTKtLFNu55JV

Sendgrid

Similar to mailgun, sendgrid is also an email delivery service. Make sure you have a sendgrid account. To obtain your API key, refer to sendgrid documentation. Then put the API key in Monika's configuration as follows:

notifications:
- id: unique-id-sendgrid
type: sendgrid
data:
sender: YOUR_VERIFIED_EMAIL_BY_SENDGRID
recipients: ['RECIPIENT_EMAIL_ADDRESS1', 'RECIPEIENT_EMAIL_ADDRESS2']
apiKey: YOUR_API_KEY
KeyDescriptionExample
IDNotification identity numberSendgrid12345
TypeNotification typessendgrid
senderA string of email addresses that has been verified in your sendgrid accountyour@email.com
RecipientsAn array of email addresses that will receive the email from Monika["monika@testmail.com", "symon@testmail.com"]
Api KeySendgrid account api key, sendgrid registered key to identify your account70e34aba-0ea908325

Slack Incoming Webhook

Monika supports Slack Incoming Webhook. To enable notification via Slack, you must have a Slack's Incoming Webhook URL. Please consult the Sending messages using Incoming Webhooks documentation.

notifications:
- id: unique-id-slack
type: slack
data:
url: https://YOUR_SLACK_INCOMING_WEBHOOK_URL
KeyDescriptionExample
IDNotification identity numberSlack12345
TypeNotification typesslack
UrlThe URL of your slack incoming webhookhttps://slackwebhook.com/channel

SMTP

SMTP (Simple Mail Transfer Protocol) is a way to send email using the TCP/IP protocol. This is the easiest way to get notified when alerts are triggered. Use the following configuration to set up SMTP notification.

notifications:
- id: unique-id-smtp
type: smtp
data:
recipients: ['RECIPIENT_EMAIL_ADDRESS']
hostname: smtp.mail.com
port: 587
username: SMTP_USERNAME
password: SMTP_PASSWORD
KeyDescriptionExample
IDNotification identity numberSmtp12345
TypeNotification typessmtp
RecipientsAn array of email addresses that will receive the email from Monika["monika@testmail.com", "symon@testmail.com"]
HostnameThe smtp host that you will be using for sending the emailsmtp.gmail.com
PortThe port allowed to be used for sending mail in your host587
UsernameRegistered username on your smtp serveryourusername@gmail.com
PasswordThe password set for your usernamethepasswordforyourusername

Example using Gmail SMTP

To use Gmail SMTP with Monika,

  1. You need to have a Gmail account.
  2. Use smtp.gmail.com for hostname.
  3. Use 587 for port.
  4. Use your Gmail address for username.
  5. Use your Gmail password for password.
    1. If you have activated 2-Factor-Authentication (2FA), you need to create an App Password from your Account Settings. Then use the app password for password.

Statuspage

Statuspage is a status and incident communication tool. You need a page ID and an API key to use Statuspage. You can obtain it by following the steps in the documentation.

notifications:
- id: unique-id-statuspage
type: statuspage
data:
apiKey: YOUR_STATUSPAGE_API_KEY
pageID: YOUR_STATUSPAGE_PAGE_ID
KeyDescriptionExample
idNotification identity numberstatuspage-1
typeNotification typesstatuspage
data.apiKeyStatuspage API keyc374d669-8ac0-480d-9ec7-732d71b43e38
data.pageIDStatuspage page IDq3sl2xb8h0

Telegram

Monika supports Telegram. To enable notification via Telegram, you must have a Telegram bot. Please consult Bots: An introduction for developers.

notifications:
- id: unique-id-telegram
type: telegram
data:
group_id: YOUR_GROUP_ID
bot_token: YOUR_BOT_TOKEN
KeyDescriptionExample
IDNotification identity numberTelegram12345
TypeNotification typestelegram
Group IDThe ID of group where the bot should send the messages-123456
Bot TokenThe Token of your telegram botabcdefg:hijklmnopqrstuvwxyz

Webhook

Monika supports Webhook. To enable notification via Webhook.

notifications:
- id: unique-id-webhook
type: webhook
data:
url: https://YOUR_WEBHOOK_URL
KeyDescriptionExample
IDNotification identity numberWebhook12345
TypeNotification typeswebhook
UrlThe URL of the server that will receive the webhook notificationhttps://yourwebsite.com/webhook

Using the webhook type configuration, Monika will send a request with the following body:

body: {
url: string
time: string
alert: string
}

Whatsapp Business

Monika supports notifications from Whatsapp for business accounts. To enable notifications via WhatsApp for business, you must have a registered user in the WhatsApp business API server. Please refer to WhatsApp Business API documentation.

notifications:
- id: unique-whatsapp-id
type: whatsapp
data:
recipients: ['628123456789', '3804321234']
url: https://yourwhatsappapiserver.com
username: whatsappusername
password: whatsapppassword
KeyDescriptionExample
IDNotification identity numberwhatsapp12345
TypeNotification typeswhatsapp
RecipientsAn array phone number registered for whatsapp, should start with your country code number["628123456790", "629745834093"]
UrlThe URL of your whatsapp api serverhttps://yourwhatsappapiserver.com
UsernameYour whatsapp api user nameusername
UserpasswordYour whatsapp api user passworduserpassword

Dingtalk

Monika supports Dingtalk. To enable notification via Dingtalk, you must create a robot webhook first. More info at Dingtalk robot webhook Dingtalk documentation and Alibaba cloud documentation.

notifications:
- id: unique-id-webhook
type: dingtalk
data:
access_token: YOUR_ACCESS_TOKEN
KeyDescriptionExample
Access TokenThe token of your Dingtalk accountDingtalk1234

Gotify

Monika supports Gotify. To enable notification via Gotify, you must have a Gotify Server's URL and application token. Gotify is an open source notification server with several different clients. More info at Gotify documentation.

notifications:
- id: unique-id-gotify
type: gotify
data:
url: GOTIFY_URL
token: GOTIFY_TOKEN
KeyDescriptionExample
urlGotify server URLhttps://gotify.example.com
tokenGotify application tokenOhyegh1eePahraz

Pushover

Monika supports Pushover. To enable notification via Pushover, you must create a pushover application first. More info at Pushover documentation.

notifications:
- id: unique-id-webhook
type: pushover
data:
token: PUSHOVER_TOKEN
user: PUSHOVER_USER
KeyDescriptionExample
TokenPushover application tokenpushoverApplicationToken
UserPushover user keypushoverUserKey

Opsgenie

Monika supports Opsgenie. To enable notification via Opsgenie, you must create a team, then create an integration, and finally add an API. More info at Opsgenie documentation.

notifications:
- id: unique-id-opsgenie
type: opsgenie
data:
geniekey: GENIE_KEY
KeyDescriptionExample
GeniekeyOpsgenie application tokenopsgenieApplicationToken

Pushbullet

Monika supports Pushbullet. To enable notification via Pushbullet, you must create an account and create your access token. You can create an access token at Pushbullet Settings Page.

Optionally, you can push notifications to specific devices by running the command below:

curl --header 'Access-Token: <your_access_token_here>' \
https://api.pushbullet.com/v2/devices

Then, you can put the iden value from the API response to the deviceID at the Monika configuration properties.

More info at Pushbullet Documentation.

notifications:
- id: unique-id-pushbullet
type: pushbullet
data:
token: PUSBULLET_ACCESS_TOKEN
deviceID: PUSHBULLET_DEVICE_ID
KeyDescriptionExample
tokenPushbullet Access Tokena6FJVAA0LVJKrT8k
deviceIDPushbullet Device Identifierujpah72o0sjAoRtnM0jc

Instatus

Instatus is a status and incident communication tool. You need a page ID and an API key to use Instatus. You can obtain it by following the steps in the documentation.

notifications:
- id: unique-id-instatus
type: instatus
data:
apiKey: YOUR_INSTATUS_API_KEY
pageID: YOUR_INSTATUS_PAGE_ID //You can get it with client.pages.get()
KeyDescriptionExample
idNotification identity numberinstatus-id
typeNotification typesinstatus
data.apiKeyInstatus API key43d43d2c06ae223a88a9c35523acd00a
data.data.pageIDInstatus page ID2hu1aj8r6td7mog6uz1sh
← PrevAlerts
Was this page helpful?
Next →Probes

PT Artha Rajamas Mandiri (Hyperjump) is an open-source-first company providing engineering excellence service. We aim to build and commercialize open-source tools to help companies streamline, simplify, and secure the most important aspects of its modern DevOps practices.

Copyright © 2024 Hyperjump Tech. All Rights Reserved.

\ No newline at end of file +
- id: unique-id-webhook
type: webhook
data:
url: https://WEBHOOK_URL

Note that every triggered alert will be sent to you through all the notifications you defined in the configuration file, e.g., if you added webhook and smtp settings, you will receive the alert messages through both.

Desktop Notifications

Monika supports desktop notifications. Here are the prerequisites for enabling the desktop notifications:

  • macOS: Uses OSAScript (Apple Open Scripting Architecture). AppleScript 2.0 or later and macOS version 10.5 or later required.
  • Linux: Uses notify-send command. notify-osd or libnotify-bin required (Ubuntu should have this by default).
  • Windows: Uses Powershell. Refer to Microsoft Official Documentation for System Requirements.
notifications:
- id: unique-id-monika-notif
type: desktop

Discord

Monika supports Discord. To enable notification via Discord, you must create a discord webhook first. More info at Discord webhook documentation

notifications:
- id: unique-id-webhook
type: discord
data:
url: https://YOUR_DISCORD_URL
KeyDescriptionExample
IDNotification identity numberDiscord12345
TypeNotification typesdiscord
UrlThe URL of the Discord Webhook that will receive notificationhttps://discord.com/api/webhook/<webhook.id>/<webhook.token>

Facebook Workplace

Monika supports Facebook Workplace. To enable notification via Workplace, you must create custom integration first. More info at Facebook Workplace Custom Integrations

notifications:
- id: unique-workplace-id
type: workplace
data:
thread_id: abcd-123-456
access_token: your_custom_integration_access_token
KeyDescriptionExample
IDNotification identity numberWorkplace12345
TypeNotification typesworkplace
ThreadIDIt's located at thread url, in the last segment6367478493277649
AccessTokenWorkplace access token for custom integrationDQVJzYWtsdHRJRWIxUk9uOG5VV...

Google Chat

You can send Monika notifications to your Google Chat. First you need to generate the url webhook for Monika to use. To create a webhook:

  1. Open Google Chat
  2. Go to the space to add notification
  3. Select Manage webhook from the top of the page
  4. Under Incoming webhook, click Add another if one already exists, in either case you need to provide a name.
  5. Name the new webhook and Save
  6. Copy the URL in the webhook modal
  7. You will need the URL in your monika configuration

For further information check the Google Chat documentations here

Example of Google Chat configuration may be something similar to below:

notifications:
- id: myGoogleChatNotif
type: google-chat
data:
url: https://chat.googleapis.com/v1/spaces/XXXXX/messages?key=1122334455

Larksuite Notifications

If you use Larksuite, you can get Monika to send notifications to the Larksuite bots. You can create a webhook url, and then use it in the monika configuration.

You can find more information on creating webhooks here.

The Yaml config setup may look something like this:

notifications:
- id: lark-group-message
type: lark
data:
url: https://open.larksuite.com/open-apis/bot/v2/hook/your-webhook-key-here

Keep watch on these pages, new notification methods are being developed.

Mailgun

Mailgun is an email notification delivery service provided by Mailgun email service. To use mailgun for your notification,

  1. You would need a mailgun account.
  2. Get your API key by referring to this documentation.
  3. For your domain
    • • If you are on the free plan, add authorized recipients as instructed here.
    • • If you want to use your own domain, refer here to add it.
  4. After that, put them in monika.yml configuration as follows:
notifications:
- id: unique-id-mailgun
type: mailgun
data:
recipients: ['RECIPIENT_EMAIL_ADDRESS']
apiKey: YOUR_API_KEY
domain: YOUR_DOMAIN
KeyDescriptionExample
IDNotification identity numberMailgun12345
TypeNotification typesmailgun
RecipientsAn array of email addresses that will receive the email from Monika["monika@testmail.com", "symon@testmail.com"]
Api KeyMailgun account api key, mailgun registered key to identify your accountMAILGUN_API_KEY
DomainThe domain to set in Mailgunsandboxmail.mailgun.com

Microsoft Teams

Monika supports sending notifications via Microsoft Teams. In order to be able to send notifications via Microsoft Teams, you may need to add Connectors and webhooks to your channel. Please refer to Microsoft Teams Documentation to enable connectors and webhooks.

notifications:
- id: unique-id-teams
type: teams
data:
url: https://YOUR_TEAMS_WEBHOOK_URL
KeyDescriptionExample
IDNotification identity numberMyTeamsNotif123
TypeNotification typesteams
UrlThe URL of your Microsoft Teams Webhookhttps://<company>.webhook.office.com/webhookb2/1234-abcdef

Monika WhatsApp Notifier

You can get a notification from Monika to your WhatsApp number without having a Whatsapp Business account. First, you must create a Monika Whatsapp Notifier account.

notifications:
- id: unique-monika-notif-id
type: monika-notif
data:
url: https://YOUR_MONIKA_NOTIF_URL
KeyDescriptionExample
IDNotification identity numberMonikaNotif12345
TypeNotification typesmonika-notif
UrlThe URL of the Monika Notif Webhook linkhttps://whatsapp.hyperjump.tech/api/notify?token=<webhook.token>

Please note, to receive messages from the WhatsApp cloud API the following requirements are mandatory.

  • The recipient phone number must be a WhatsApp phone number.
  • The recipient must accept Meta's new Terms of Service and Privacy Policy.
  • The recipient must use the following WhatsApp version or greater:
    Android: 2.21.15.15
    SMBA: 2.21.15.15
    iOS: 2.21.170.4
    SMBI: 2.21.170.4
    KaiOS: 2.2130.10
    Web: 2.2132.6

PagerDuty

PagerDuty is a platform for agile incident management. You need the integration key to use PagerDuty which you can get by following the steps in PagerDuty's services and integration docs. To give you the flexibility to choose which probe belongs to which PagerDuty service. You need to map the PagerDuty integration key with your Monika probe id in the configuration.

notifications:
- id: unique-id-pagerduty-notify
type: pagerduty
data:
- key: YOUR_PAGERDUTY_INTEGRATION_KEY
probeID: ZN32nw_KsvTKtLFNu55JV
KeyDescriptionExample
idNotification identity numberpager-duty-1
typeNotification typespagerduty
data.keyPagerDuty integration key0nlar5b9ko8hnqrvsfnhtmihyopn5eri
data.probeIDMonika Probe IDZN32nw_KsvTKtLFNu55JV

Sendgrid

Similar to mailgun, sendgrid is also an email delivery service. Make sure you have a sendgrid account. To obtain your API key, refer to sendgrid documentation. Then put the API key in Monika's configuration as follows:

notifications:
- id: unique-id-sendgrid
type: sendgrid
data:
sender: YOUR_VERIFIED_EMAIL_BY_SENDGRID
recipients: ['RECIPIENT_EMAIL_ADDRESS1', 'RECIPEIENT_EMAIL_ADDRESS2']
apiKey: YOUR_API_KEY
KeyDescriptionExample
IDNotification identity numberSendgrid12345
TypeNotification typessendgrid
senderA string of email addresses that has been verified in your sendgrid accountyour@email.com
RecipientsAn array of email addresses that will receive the email from Monika["monika@testmail.com", "symon@testmail.com"]
Api KeySendgrid account api key, sendgrid registered key to identify your account70e34aba-0ea908325

Slack Incoming Webhook

Monika supports Slack Incoming Webhook. To enable notification via Slack, you must have a Slack's Incoming Webhook URL. Please consult the Sending messages using Incoming Webhooks documentation.

notifications:
- id: unique-id-slack
type: slack
data:
url: https://YOUR_SLACK_INCOMING_WEBHOOK_URL
KeyDescriptionExample
IDNotification identity numberSlack12345
TypeNotification typesslack
UrlThe URL of your slack incoming webhookhttps://slackwebhook.com/channel

SMTP

SMTP (Simple Mail Transfer Protocol) is a way to send email using the TCP/IP protocol. This is the easiest way to get notified when alerts are triggered. Use the following configuration to set up SMTP notification.

notifications:
- id: unique-id-smtp
type: smtp
data:
recipients: ['RECIPIENT_EMAIL_ADDRESS']
hostname: smtp.mail.com
port: 587
username: SMTP_USERNAME
password: SMTP_PASSWORD
KeyDescriptionExample
IDNotification identity numberSmtp12345
TypeNotification typessmtp
RecipientsAn array of email addresses that will receive the email from Monika["monika@testmail.com", "symon@testmail.com"]
HostnameThe smtp host that you will be using for sending the emailsmtp.gmail.com
PortThe port allowed to be used for sending mail in your host587
UsernameRegistered username on your smtp serveryourusername@gmail.com
PasswordThe password set for your usernamethepasswordforyourusername

Example using Gmail SMTP

To use Gmail SMTP with Monika,

  1. You need to have a Gmail account.
  2. Use smtp.gmail.com for hostname.
  3. Use 587 for port.
  4. Use your Gmail address for username.
  5. Use your Gmail password for password.
    1. If you have activated 2-Factor-Authentication (2FA), you need to create an App Password from your Account Settings. Then use the app password for password.

Statuspage

Statuspage is a status and incident communication tool. You need a page ID and an API key to use Statuspage. You can obtain it by following the steps in the documentation.

notifications:
- id: unique-id-statuspage
type: statuspage
data:
apiKey: YOUR_STATUSPAGE_API_KEY
pageID: YOUR_STATUSPAGE_PAGE_ID
KeyDescriptionExample
idNotification identity numberstatuspage-1
typeNotification typesstatuspage
data.apiKeyStatuspage API keyc374d669-8ac0-480d-9ec7-732d71b43e38
data.pageIDStatuspage page IDq3sl2xb8h0

Telegram

Monika supports Telegram. To enable notification via Telegram, you must have a Telegram bot. Please consult Bots: An introduction for developers.

notifications:
- id: unique-id-telegram
type: telegram
data:
group_id: YOUR_GROUP_ID
bot_token: YOUR_BOT_TOKEN
KeyDescriptionExample
IDNotification identity numberTelegram12345
TypeNotification typestelegram
Group IDThe ID of group where the bot should send the messages-123456
Bot TokenThe Token of your telegram botabcdefg:hijklmnopqrstuvwxyz

Webhook

Monika supports Webhook. To enable notification via Webhook.

notifications:
- id: unique-id-webhook
type: webhook
data:
url: https://YOUR_WEBHOOK_URL
KeyDescriptionExample
IDNotification identity numberWebhook12345
TypeNotification typeswebhook
UrlThe URL of the server that will receive the webhook notificationhttps://yourwebsite.com/webhook

Using the webhook type configuration, Monika will send a request with the following body:

body: {
url: string
time: string
alert: string
}

Whatsapp Business

Monika supports notifications from Whatsapp for business accounts. To enable notifications via WhatsApp for business, you must have a registered user in the WhatsApp business API server. Please refer to WhatsApp Business API documentation.

notifications:
- id: unique-whatsapp-id
type: whatsapp
data:
recipients: ['628123456789', '3804321234']
url: https://yourwhatsappapiserver.com
username: whatsappusername
password: whatsapppassword
KeyDescriptionExample
IDNotification identity numberwhatsapp12345
TypeNotification typeswhatsapp
RecipientsAn array phone number registered for whatsapp, should start with your country code number["628123456790", "629745834093"]
UrlThe URL of your whatsapp api serverhttps://yourwhatsappapiserver.com
UsernameYour whatsapp api user nameusername
UserpasswordYour whatsapp api user passworduserpassword

Dingtalk

Monika supports Dingtalk. To enable notification via Dingtalk, you must create a robot webhook first. More info at Dingtalk robot webhook Dingtalk documentation and Alibaba cloud documentation.

notifications:
- id: unique-id-webhook
type: dingtalk
data:
access_token: YOUR_ACCESS_TOKEN
KeyDescriptionExample
Access TokenThe token of your Dingtalk accountDingtalk1234

Gotify

Monika supports Gotify. To enable notification via Gotify, you must have a Gotify Server's URL and application token. Gotify is an open source notification server with several different clients. More info at Gotify documentation.

notifications:
- id: unique-id-gotify
type: gotify
data:
url: GOTIFY_URL
token: GOTIFY_TOKEN
KeyDescriptionExample
urlGotify server URLhttps://gotify.example.com
tokenGotify application tokenOhyegh1eePahraz

Pushover

Monika supports Pushover. To enable notification via Pushover, you must create a pushover application first. More info at Pushover documentation.

notifications:
- id: unique-id-webhook
type: pushover
data:
token: PUSHOVER_TOKEN
user: PUSHOVER_USER
KeyDescriptionExample
TokenPushover application tokenpushoverApplicationToken
UserPushover user keypushoverUserKey

Opsgenie

Monika supports Opsgenie. To enable notification via Opsgenie, you must create a team, then create an integration, and finally add an API. More info at Opsgenie documentation.

notifications:
- id: unique-id-opsgenie
type: opsgenie
data:
geniekey: GENIE_KEY
KeyDescriptionExample
GeniekeyOpsgenie application tokenopsgenieApplicationToken

Pushbullet

Monika supports Pushbullet. To enable notification via Pushbullet, you must create an account and create your access token. You can create an access token at Pushbullet Settings Page.

Optionally, you can push notifications to specific devices by running the command below:

curl --header 'Access-Token: <your_access_token_here>' \
https://api.pushbullet.com/v2/devices

Then, you can put the iden value from the API response to the deviceID at the Monika configuration properties.

More info at Pushbullet Documentation.

notifications:
- id: unique-id-pushbullet
type: pushbullet
data:
token: PUSBULLET_ACCESS_TOKEN
deviceID: PUSHBULLET_DEVICE_ID
KeyDescriptionExample
tokenPushbullet Access Tokena6FJVAA0LVJKrT8k
deviceIDPushbullet Device Identifierujpah72o0sjAoRtnM0jc

Instatus

Instatus is a status and incident communication tool. You need a page ID and an API key to use Instatus. You can obtain it by following the steps in the documentation.

notifications:
- id: unique-id-instatus
type: instatus
data:
apiKey: YOUR_INSTATUS_API_KEY
pageID: YOUR_INSTATUS_PAGE_ID //You can get it with client.pages.get()
KeyDescriptionExample
idNotification identity numberinstatus-id
typeNotification typesinstatus
data.apiKeyInstatus API key43d43d2c06ae223a88a9c35523acd00a
data.data.pageIDInstatus page ID2hu1aj8r6td7mog6uz1sh
← PrevAlerts
Was this page helpful?
Next →Probes

PT Artha Rajamas Mandiri (Hyperjump) is an open-source-first company providing engineering excellence service. We aim to build and commercialize open-source tools to help companies streamline, simplify, and secure the most important aspects of its modern DevOps practices.

Copyright © 2024 Hyperjump Tech. All Rights Reserved.

\ No newline at end of file diff --git a/guides/probes.html b/guides/probes.html index 3d0211453..14cdccea5 100644 --- a/guides/probes.html +++ b/guides/probes.html @@ -17,10 +17,10 @@ gtag('config', 'G-W999ZM71FP', { page_path: window.location.pathname, }); -

Probes

Star (0)

Probes are the heart of the monitoring requests. Probes are made out of an array of "requests" and some controls. The control parameters determine how the probes are performed, such as repetition intervals, probe name, identification and text descriptions. Requests are either Ping, TCP or HTTP(S) requests to some location. +

Probes

Star (0)

Probes are the heart of the monitoring requests. Probes are made out of an array of "requests" and some controls. The control parameters determine how the probes are performed, such as repetition intervals, probe name, identification and text descriptions. Requests are either Ping, TCP or HTTP(S) requests to some location. Monika goes through each probe object in the monika.yml config file, sends it out, and determines whether an alert or notification needs to be sent out.

probes:
- id: '1'
name: Name of the probe
description: Probe to check GET time
interval: 10 # in seconds
requests:
- method: GET
url: https://github.com
alerts: []
- id: '2'
name: Name of the probe 2
description: Probe to check GET health
interval: 10 # in seconds
requests:
- method: GET
url: https://github.com
alerts: []

Basically probes are arranged as arrays of request objects.

HTTP Request Anatomy

probes:
- id: '1'
name: 'Example: get Time'
description: Probe
interval: 10 # in seconds
requests:
- method: POST
url: https://mybackend.org/user/login
timeout: 7000 # in milliseconds
saveBody: true
headers:
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkhlbGxvIGZyb20gSHlwZXJqdW1wIiwiaWF0IjoxNTE2MjM5MDIyfQ.T2SbP1G39CMD4MMfkOZYGFgNIQgNkyi0sPdiFi_DfVA
body:
username: someusername
password: somepassword
alerts:
- assertion: response.status != 200
message: Status not 2xx
allowUnauthorized: true
followRedirects: 1
incidentThreshold: 3
alerts:
- assertion: response.status != 200
message: HTTP response status is {{ response.status }}, expecting 200

Details of the field are given in the table below.

TopicDescription
method (optional)Http method such as GET, POST, PUT, DELETE.
url (required)This is the url endpoint to dispatch the request to.
timeout (optional)Request timeout in milliseconds, Default value is 10000 which corresponds to 10 seconds. If the request takes longer than timeout, the request will be aborted.
headers (optional)Http headers you might need for your request.
body (optional)Any http body if your method requires it.
interval (optional)Number of probe's interval (in seconds). Default value is 10 seconds.
incidentThreshold (optional)Number of times an alert should return true before Monika sends notifications. For example, when incidentThreshold is 3, Monika will only send incident notifications when the probed URL returns non-2xx status 3 times in a row. After sending the notifications, Monika will not send notifications anymore until the alert status changes. Default value is 5. However, the actual number of retries will be the the greatest number between incidentThreshold and recoveryThreshold. So if you want to have 3 retries, you need to set both incidentThreshold and recoveryThreshold.
recoveryThreshold (optional)Number of retries before Monika sends recovery notifications. For example, when recoveryThreshold is 3 and when previously a probe is marked as incident, Monika will only send recovery notification when the probing succeeds 3 times in a row. Default value is 5. However, the actual number of retries will be the the greatest number between incidentThreshold and recoveryThreshold. So if you want to have 3 retries, you need to set both incidentThreshold and recoveryThreshold.
saveBody (optional)When set to true, the response body of the request is stored in the internal database. The default is off when not defined. This is to keep the log file size small as some responses can be sizable. The setting is for each probe request.
alerts (optional)The condition which will trigger an alert, and the subsequent notification method to send out the alert. See below for further details on alerts and notifications. See alerts section for detailed information.
ping (optional)(boolean), If set true then send a PING to the specified url instead.
allowUnauthorized (optional)(boolean), If set to true, will make https agent to not check for ssl certificate validity
followRedirects (optional)The request follows redirects as many times as specified here. If unspecified, it will fallback to the value set by the follow redirects flag

Good to know

To reduce network usage, HTTP responses are cached with 5 time-to-live by default. This cache is then reused for requests with identical HTTP request config, e.g. headers, method, url.

This cache is usable for probes which does not have chaining requests.

Request Body

By default, the request body will be treated as-is. If the request header's Content-Type is set to application/x-www-form-urlencoded, it will be serialized into URL-safe string in UTF-8 encoding. Body payloads will vary on the specific probes being requested. For HTTP requests, the body and headers are defined like this:

requests:
- method: POST
url: https://example.com/auth/login
timeout: 7000 # in milliseconds
saveBody: true
headers:
Authorization: Bearer __your_token_here__
body:
username: someusername
password: somepassword

You can use responses from previous http requests in the body of your next request, see how requests chaining work in the sections further below. It is also possible to automatically generate data in your payload. See the fake data payload section here.

Content-Type header

Currently, Monika only supports Content-Type value application/x-www-form-urlencoded and application/json with UTF-8 encoding.

Mariadb or MySQL Probes

To monitor the connectivity and the health of your MariaDB database, you can use the following monika configuration:

probes:
- id: 'id-mariadb'
name: maria_probe
description: testing maria db
mariadb:
- host: 172.11.0.1
port: 3306
database: mydatabase
username: myuser
password: password

You can also use the mysql keyword for your Mysql database like below. The mariadb and mysql probe types are interchagnable.

probes:
- id: 'id-mariadb'
name: maria_probe
description: testing maria db
mysql:
- host: 172.11.0.1
port: 3306
database: mydatabase
username: myuser
password: password

MongoDB Request

You can check if your MongoDB instance is running and accessible by adding a probe with mongo configuration as follows.

probes:
- id: 'mongo-test'
name: MongoDB health check
interval: 30 # in seconds
mongo:
- host: localhost
port: 27017

If your MongoDB configuration uses authentication settings, you can pass the username and password field like below:

probes:
- id: 'mongo-test'
name: MongoDB health check
interval: 30 # in seconds
mongo:
- host: localhost
port: 28017
username: mongoadmin
password: secret

If you have a connection URI, you can pass it to the uri field like below:

- id: 'mongo-test'
name: MongoDB health check
interval: 30 # in seconds
mongo:
- uri: mongodb://mongoadmin:secret@localhost:28017

PING Request

You can send an ICMP echo request to a specific url by specifying a ping probe. In this mode the a PING echo request is sent to the specified url.

probes:
- id: 'ping_test'
name: ping_test
description: requesting icmp ping
interval: 10 # in seconds
ping:
- uri: http://google.com

Postgres Request

Monika provides a way to check your postgres database's health with a 'postgres' type probe. You can define the host, port and user and password like this:

probes:
- id: 'postgres-01'
name: database health
description: ensure db health
interval: 30 # in seconds
postgres:
- host: 172.15.0.1
port: 5432
user: user
password: password
database: mydb

Or alternatively you may provide a postgresql connection URI like below:

probes:
- id: 'postgres-01'
name: database health
description: ensure db health
interval: 30 # in seconds
postgres:
- uri: postgresql://user:password@172.15.0.1:5432/mydb

If uri is provided along with host, port, user and password fields, connection will be derived from the uri string and the other fields will be ignored.
Please see the postgres connection specification for details on uri formatting.

Redis Request

You can check if your redis instance is running and accessible by adding a probe with redis configuration as follows.

probes:
- id: 'redis-test'
name: redis health
description: requesting redis PONG
interval: 30 # in seconds
redis:
- host: 172.15.0.2
port: 6379

If your redis configuration include AUTH settings, you might get some error like Error: NOAUTH Authentication required. You can pass a password field like below:

probes:
- id: 'redis-ping'
name: redis check with password
description: requesting redis PONG
interval: 30 # in seconds
redis:
- host: 172.15.0.2
port: 6379
password: mypassword

You may also add a username property as needed. An alternative format that you can provide is a uri connection string for redis with the following specification redis://[[username][:password]@][host][:port][/db-number]:

probes:
- id: 'redis-ping'
name: redis check with password
description: requesting redis PONG
interval: 30 # in seconds
redis:
- uri: 'redis://alice:mypassword@172.15.0.2:6379'

See the full redis client configurations here.

TCP

You can send a TCP request to a specific host and port with data by using the socket field.

probes:
- id: 'tcp-example'
socket:
host: localhost
port: 3333
data: Hello from Monika

Probe Response Anatomy

The default shape of a response when Monika has successfully fetched a request is as the following.

status: 200
statusText: OK
headers:
test-header: ...
config:
url: https://reqres.in/api/users
method: GET
data:
mydata: value
headers:
Accept: application/json, text/plain, */*
User-Agent: axios/0.21.1
data: ...

Details of the fields are shown in the table below.

TopicDescription
statusHTTP Status Code (e.g 200, 403, 500)
statusTextHTTP Status Code Explanation (e.g OK, Forbidden, Internal Server Error)
configRequest configuration (e.g URL, Method, Data, Headers, Body, etc.)
headersResponse headers from the fetched request (e.g SetCookie, ETag, etc.).
dataResponse payload from the fetched request (e.g token, results, data).

Probe response data could be used for Request Chaining.

Custom HTTP Responses

To make it easier to troubleshoot HTTP requests, we have mapped low-level errors returned by the HTTP library to numbers between 0 and 99. These custom errors are returned as the HTTP status code and can be used to trigger alerts in the same way as regular HTTP status codes.

CodeError
0Connection not found
1Connection reset
2Connection refused
3Too many redirects
4Bad option value
5Bad option
6Timed out
7Network error
8Deprecated
9Bad response
11Bad request
12Canceled
13Not Supported
14Invalid URL
18Header / response size limit exceeded
19HTTP status code returns >= 400
20Invalid HTTP arguments
21Unexpected HTTP response to handle
22Connection closed unexpectedly
23Unsupported HTTP functionality
24Request / response size mismatch with Content-Length header value
25Missing HTTP client pool
26Expected error, exact reason is shown on runtime
27Unable to verify the first / leaf certificate
99Others
599Connection aborted

Execution order

In a configuration with multiple probes, Monika will load the requests in the order that they are entered, one after another. However, probes may be performed out of sequence depending on their interval setting, network latency and response times. By default Monika loops through all the probe configurations in the order they are entered, but you can use the --id or the --repeat flags to specify or repeat a particular sequence. See the cli options here for more information.

In general, Monika will sleep until the next interval timer to repeat a probe. If no interval time is specified for a probe, the default value will be used. If the configured probe interval is shorter than the amount of time to dispatch all the requests, then Monika will immediately repeat after the last response and any notification alerts sent.

Fake Data

You can use fake data to pass through your URLs, request body, and request headers. Here is the list of available fake data:

ExpressionDescriptionExamples
{{ alpha <count> }}returns random string with length count which contains only alphabetical characters. The default value for count is 8.{{ alpha }} returns abcdefgh
{{ alpha 3 }} returns abcd
{{ alphaNumeric <count> }}returns random string with length count which contains alphabets and digits. The default value for count is 8.{{ alphaNumeric }} returns ab12ef34
{{ alphaNumeric 4 }} returns ab12
{{ countryCode }}returns a random country code.{{ countryCode }} returns US
{{ color }}returns a random color string.{{ color }} returns lime or green
{{ currency }}returns a random currency code.{{ currency }} returns USD
{{ email }}returns a random email address.{{ email }} returns monika@hyperjump.tech
{{ fullName }}returns a random full name.{{ fullName }} returns John Doe
{{ gender <binary> }}returns a random gender. The default value for binary is true.{{ gender }} returns Male
{{ gender false }} returns Trans*Man
{{ isodate }}returns the date of the request sending in ISO format.{{ isodate }} returns 2022-08-24T04:36:46.019Z
{{ latitude <min> <max> }}returns a random latitude between min and max value. The default value for min and max are -90 and 90.{{ latitude }} returns -30.9501
{{ latitude 0 30 }} returns 3.9521
{{ lines <lineCount> }}return lineCount number of lines of "Lorem ipsum" strings.{{ lines }} returns Lorem ipsum dolor sit amet
{{ lines 2 }} returns Commodi non ex vol uptatibus quibusdam nisi aliquam dolor nihil. Eos maiore s enim praesentium.
{{ longitude <min> <max> }}returns a random longitude between min and max value. The default value for min and max are -180 and 180.{{ longitude }} returns -30.9501
{{ longitude 0 30 }} returns 3.9521
{{ number <min> <max> }}returns a random integer number between min and max. The default value for min and max are 0 and 1000.{{ number }} returns 720
{{ number 0 500 }} returns 480
{{ objectId }}returns a random MongoDB ObjectID.{{ objectId }} returns 63034695eca3670c4e083657
{{ statusCode }}returns a random HTTP status code.{{ statusCode }} returns 200
{{ timestamp }}returns current time in a form of a UNIX timestamp.{{ timestamp }} returns 1661159139803
{{ uuid }}returns a random UUID.{{ uuid }} returns d8ffd51c-88cd-453e-906e-389b145891e7
{{ word }}returns a random English word.{{ word }} returns nicely
{{ words <count> }}returns count number of random English words. The default value for words is 3.{{ words }} returns such fascinating energies

To use the fake data, all you need to do is to wrap them in the double curly brackets like the example below:

probes:
- id: '6'
name: '6'
interval: 10
requests:
- url: http://github.com?timestamp={{ timestamp }}
# This will be rendered as https://github.com?timestamp=1661159139803
- id: '15'
name: '15'
interval: 10
requests:
- url: http://github.com/user?id={{ uuid }}
# This will be rendered as http://github.com/user?id=d8ffd51c-88cd-453e-906e-389b145891e7

If you want to use it as a request body, you can use it like this:

probes:
- id: '0'
name: '0'
interval: 10
requests:
- url: https://httpbin.org/post
method: POST
body:
timestamp: '{{ timestamp }}'
id: '{{ uuid }}'
# This will be rendered as { timestamp: 1661159139803, id: d8ffd51c-88cd-453e-906e-389b145891e7 }

The same goes for the request headers, you can use it like this:

probes:
- id: '0'
name: '0'
interval: 10
requests:
- url: https://httpbin.org/post
method: POST
body:
timestamp: '{{ timestamp }}'
id: '{{ uuid }}'
headers:
'X-USER-ID': '{{ uuid }}'
# This will be rendered as { X-USER-ID: d8ffd51c-88cd-453e-906e-389b145891e7 }

Postman JSON file support

NOTE: We only support Postman collection v2.0 and v2.1 files.

To run monika using a Postman JSON file, use --postman flag as follows:

monika --postman <path_to_postman_file>

Insomnia file support

Monika supports Insomnia collection file in version 4 format. Both json and yaml files are supported. -To run Monika using an Insomnia collection file, use --insomnia flag as follows:

monika --insomnia <path_to_insomnia_file>

HAR file support

HAR HTTP-Archive format was created by the Web Performance Working Group and has become the standard in browser archive request data definition. To run monika using a HAR file, use --har flag as follows:

monika --har <path_to_HAR_file>

Further reading

  1. Alerts
  2. Notifications

PT Artha Rajamas Mandiri (Hyperjump) is an open-source-first company providing engineering excellence service. We aim to build and commercialize open-source tools to help companies streamline, simplify, and secure the most important aspects of its modern DevOps practices.

Copyright © 2024 Hyperjump Tech. All Rights Reserved.

\ No newline at end of file +To run Monika using an Insomnia collection file, use --insomnia flag as follows:

monika --insomnia <path_to_insomnia_file>

HAR file support

HAR HTTP-Archive format was created by the Web Performance Working Group and has become the standard in browser archive request data definition. To run monika using a HAR file, use --har flag as follows:

monika --har <path_to_HAR_file>

Further reading

  1. Alerts
  2. Notifications

PT Artha Rajamas Mandiri (Hyperjump) is an open-source-first company providing engineering excellence service. We aim to build and commercialize open-source tools to help companies streamline, simplify, and secure the most important aspects of its modern DevOps practices.

Copyright © 2024 Hyperjump Tech. All Rights Reserved.

\ No newline at end of file diff --git a/guides/status-notification.html b/guides/status-notification.html index 1cd17fff0..8e0500173 100644 --- a/guides/status-notification.html +++ b/guides/status-notification.html @@ -17,4 +17,4 @@ gtag('config', 'G-W999ZM71FP', { page_path: window.location.pathname, }); -

Status Notification

Star (0)

Monika sends status notifications periodically based on a set schedule with the following information:

  • Host
  • Number of probes
  • Average response time in the last 24 hours
  • Incidents in the last 24 hours
  • Recoveries in the last 24 hours
  • Number of sent notifications in the last 24 hours
  • Application version

By default the schedule is set to 6:00 AM everyday. You can configure the schedule with cron syntax via command line argument like so:

monika --status-notification "0 6 * * *"

or via the configuration file with the status-notification field like below:

notifications:
- id: desktop
type: desktop
probes:
- requests:
- url: http://example.com
status-notification: 0 6 * * *

You can also choose to disable this feature altogether. Just set the value to false

monika --status-notification false

or

notifications: ...
probes: ...
status-notification: false

Cron Syntax

To schedule the status notification we use standard cron syntax. You can try out your configuration on crontab.guru.

In addition to the standard 5 cron syntax, Monika supports an optional seconds field. So if you wrote 6 cron syntax, please be advised that the status notification could be sent very frequently.

┌────────────── second (optional)
│ ┌──────────── minute
│ │ ┌────────── hour
│ │ │ ┌──────── day of month
│ │ │ │ ┌────── month
│ │ │ │ │ ┌──── day of week
│ │ │ │ │ │
│ │ │ │ │ │
* * * * * *

Valid Field Values

FieldData
second0-59
minute0-59
hour0-23
day1-31
month1-12 (or month names)
day of the week0 - 7, or names (0 and 7 are Sunday)

Examples:

status-notification "1,2,5,7 * * * *"

Notifies every minute 1, 2, 5 and 7. In other words every xx:01, xx:02, xx:05, xx:07 of every hour.

status-notification "1-5 * * * *"

Notifies with the range of minute 1 to 5.

status-notification "*/2 * * * *"

Notifies every two minutes.

status-notification "* * * Feb,Mar Sun"

Notifies every Sunday in February and March.

← PrevProbes
Was this page helpful?
Next →TLS Checkers

PT Artha Rajamas Mandiri (Hyperjump) is an open-source-first company providing engineering excellence service. We aim to build and commercialize open-source tools to help companies streamline, simplify, and secure the most important aspects of its modern DevOps practices.

Copyright © 2024 Hyperjump Tech. All Rights Reserved.

\ No newline at end of file +

Status Notification

Star (0)

Monika sends status notifications periodically based on a set schedule with the following information:

  • Host
  • Number of probes
  • Average response time in the last 24 hours
  • Incidents in the last 24 hours
  • Recoveries in the last 24 hours
  • Number of sent notifications in the last 24 hours
  • Application version

By default the schedule is set to 6:00 AM everyday. You can configure the schedule with cron syntax via command line argument like so:

monika --status-notification "0 6 * * *"

or via the configuration file with the status-notification field like below:

notifications:
- id: desktop
type: desktop
probes:
- requests:
- url: http://example.com
status-notification: 0 6 * * *

You can also choose to disable this feature altogether. Just set the value to false

monika --status-notification false

or

notifications: ...
probes: ...
status-notification: false

Cron Syntax

To schedule the status notification we use standard cron syntax. You can try out your configuration on crontab.guru.

In addition to the standard 5 cron syntax, Monika supports an optional seconds field. So if you wrote 6 cron syntax, please be advised that the status notification could be sent very frequently.

┌────────────── second (optional)
│ ┌──────────── minute
│ │ ┌────────── hour
│ │ │ ┌──────── day of month
│ │ │ │ ┌────── month
│ │ │ │ │ ┌──── day of week
│ │ │ │ │ │
│ │ │ │ │ │
* * * * * *

Valid Field Values

FieldData
second0-59
minute0-59
hour0-23
day1-31
month1-12 (or month names)
day of the week0 - 7, or names (0 and 7 are Sunday)

Examples:

status-notification "1,2,5,7 * * * *"

Notifies every minute 1, 2, 5 and 7. In other words every xx:01, xx:02, xx:05, xx:07 of every hour.

status-notification "1-5 * * * *"

Notifies with the range of minute 1 to 5.

status-notification "*/2 * * * *"

Notifies every two minutes.

status-notification "* * * Feb,Mar Sun"

Notifies every Sunday in February and March.

← PrevProbes
Was this page helpful?
Next →TLS Checkers

PT Artha Rajamas Mandiri (Hyperjump) is an open-source-first company providing engineering excellence service. We aim to build and commercialize open-source tools to help companies streamline, simplify, and secure the most important aspects of its modern DevOps practices.

Copyright © 2024 Hyperjump Tech. All Rights Reserved.

\ No newline at end of file diff --git a/guides/tls-checkers.html b/guides/tls-checkers.html index 8f031a44a..e22711064 100644 --- a/guides/tls-checkers.html +++ b/guides/tls-checkers.html @@ -17,6 +17,6 @@ gtag('config', 'G-W999ZM71FP', { page_path: window.location.pathname, }); -

TLS Checkers

Star (0)

You can check TLS validity and set the threshold to send notification before the expiry time.

certificate:
domains:
- example.com
- expired.badssl.com
- domain: example.com
options:
path: '/foo'
reminder: 30
NameData TypeRequiredDefault ValueDescription
domainsArraytrue-The list of domains to check.
reminderNumberfalse30The number of days to send notification to user before the domain expires.

The domains array can be a mix of strings (host name only, no path), or objects +

TLS Checkers

Star (0)

You can check TLS validity and set the threshold to send notification before the expiry time.

certificate:
domains:
- example.com
- expired.badssl.com
- domain: example.com
options:
path: '/foo'
reminder: 30
NameData TypeRequiredDefault ValueDescription
domainsArraytrue-The list of domains to check.
reminderNumberfalse30The number of days to send notification to user before the domain expires.

The domains array can be a mix of strings (host name only, no path), or objects that contain a domain string property for the host name, and an options object -property that contains custom HTTPS options for the TLS checker, such as path.

PT Artha Rajamas Mandiri (Hyperjump) is an open-source-first company providing engineering excellence service. We aim to build and commercialize open-source tools to help companies streamline, simplify, and secure the most important aspects of its modern DevOps practices.

Copyright © 2024 Hyperjump Tech. All Rights Reserved.

\ No newline at end of file +property that contains custom HTTPS options for the TLS checker, such as path.

PT Artha Rajamas Mandiri (Hyperjump) is an open-source-first company providing engineering excellence service. We aim to build and commercialize open-source tools to help companies streamline, simplify, and secure the most important aspects of its modern DevOps practices.

Copyright © 2024 Hyperjump Tech. All Rights Reserved.

\ No newline at end of file diff --git a/guides/troubleshoot.html b/guides/troubleshoot.html index e183248b4..ff6c3834c 100644 --- a/guides/troubleshoot.html +++ b/guides/troubleshoot.html @@ -17,4 +17,4 @@ gtag('config', 'G-W999ZM71FP', { page_path: window.location.pathname, }); -

Troubleshoot

Star (0)

If you have problem installing using npm, please check this issue #216. It might be related to permission issue. In most cases, it can be solved by running

sudo npm i -g @hyperjumptech/monika --unsafe-perm=true --allow-root

If you have issues probing a particular target we suggest:

  1. Try sending the request through curl or a separate tool such as Insomnia.
  2. Isolate the problematic probes in your monika.yml configuration file by removing others while you troubleshoot.
  3. Check the examples in our documentations here.

Found something you can't solve, have questions or feedback? By all means reach out through our discussion forums in github. We would love to hear from you.

PT Artha Rajamas Mandiri (Hyperjump) is an open-source-first company providing engineering excellence service. We aim to build and commercialize open-source tools to help companies streamline, simplify, and secure the most important aspects of its modern DevOps practices.

Copyright © 2024 Hyperjump Tech. All Rights Reserved.

\ No newline at end of file +

Troubleshoot

Star (0)

If you have problem installing using npm, please check this issue #216. It might be related to permission issue. In most cases, it can be solved by running

sudo npm i -g @hyperjumptech/monika --unsafe-perm=true --allow-root

If you have issues probing a particular target we suggest:

  1. Try sending the request through curl or a separate tool such as Insomnia.
  2. Isolate the problematic probes in your monika.yml configuration file by removing others while you troubleshoot.
  3. Check the examples in our documentations here.

Found something you can't solve, have questions or feedback? By all means reach out through our discussion forums in github. We would love to hear from you.

PT Artha Rajamas Mandiri (Hyperjump) is an open-source-first company providing engineering excellence service. We aim to build and commercialize open-source tools to help companies streamline, simplify, and secure the most important aspects of its modern DevOps practices.

Copyright © 2024 Hyperjump Tech. All Rights Reserved.

\ No newline at end of file diff --git a/index-component.html b/index-component.html index d51360ea4..9f631c09a 100644 --- a/index-component.html +++ b/index-component.html @@ -17,4 +17,4 @@ gtag('config', 'G-W999ZM71FP', { page_path: window.location.pathname, }); -

\ No newline at end of file +

\ No newline at end of file diff --git a/index.html b/index.html index c05a66dd1..2bcf97f26 100644 --- a/index.html +++ b/index.html @@ -17,4 +17,4 @@ gtag('config', 'G-W999ZM71FP', { page_path: window.location.pathname, }); -
image

Get WhatsApp notification when your web app is down

Or from any other communication channel. It's quick, easy, and completely free!

Let’s Hear What They Say

About Monika

Thank you Monika by Hyperjump. With Monika, we can improve our services SLA, get notified early when we have a server issue. Easy to install, have multi notification channels, can be setup from different server regions, and is easy to integrate on the dashboard make it all complete and help us to analyze the issue asap.

Eric Sudadyo

DevOps Manager, Yummycorp

Before using Monika, we were unaware when our website is down until our users reported it. We don’t want it to happen again. Now with Monika, we are notified much faster so our team can react quicker to solve the issue. Thank you, Monika!

Marsya Nurmaranti

Executive Director, Indorelawan

image

4 Simple Steps to Start Monika

Here are the steps to guide you to use Monika.
Hold your worry, this won't take hours for you to understand.
image

1. Decide what to monitor

Already know what you want to monitor? Great! First step done!

image

2. Install

npm i -g @hyperjumptech/monika

Get Monika using the popular package manager: Homebrew (macOS), Snap (Linux), or Chocolatey (Windows)

image

3. Create configuration file

You need monika.yml. Define how requests are set up (Probe), how it is triggered (Alerts), and how would you like to receive the notifications. Use our Config generator to get the monika.yml super easily!

Monika Config Generator

image

4. Run Monika

Monika by default reads a yaml configuration file called monika.yml in the current working directory if it exists. Run this command in the Terminal from the directory that contains the monika.yml file:

monika
image

Congratulations! Your web app is being monitored and Monika will send you notification if something happens.

image

What more can I do with Monika?

Here are Monika's capabilities and features to inspire and get you to start monitoring your IT systems.
image
Connecting Monika with PrometheusBy marrying Monika with Prometheus, you can display and query Monika’s data beautifully in Prometheus GUI or other data visualization tools like Grafana.Read more
image
Use Existing Postman Collections with MonikaPostman is one of the great tools to monitor your API, but maybe you’re looking for a free and open-source solution for your needs. With Monika, you can easily monitor websites without any monthly limitations. You can install Monika anywhere you want and monitor your websites right away.Read more
image
TLS certificate reminderWith Monika, you don’t have to worry about expiring TLS certificates anymore. Not that only you have prevented your TLS certificate from being expired, you also monitored your website performance. Hitting two birds with one stone.Read more
image
Chaining requestWith Monika, you can add as many requests as you want to monitor. You can monitor several undesirable events such as service outages or slow services.Read more

Get Started with Monika Now!

Monika is an open source synthetic monitoring command line application. it is actively developed and completely free!

Looking for a Low-Code Version Monitoring Solution? Try Neo Sense!

Elevate your Monika experience with Neo Sense, featuring an intuitive interface and dashboard.

\ No newline at end of file +
image

Get WhatsApp notification when your web app is down

Or from any other communication channel. It's quick, easy, and completely free!

Let’s Hear What They Say

About Monika

Thank you Monika by Hyperjump. With Monika, we can improve our services SLA, get notified early when we have a server issue. Easy to install, have multi notification channels, can be setup from different server regions, and is easy to integrate on the dashboard make it all complete and help us to analyze the issue asap.

Eric Sudadyo

DevOps Manager, Yummycorp

Before using Monika, we were unaware when our website is down until our users reported it. We don’t want it to happen again. Now with Monika, we are notified much faster so our team can react quicker to solve the issue. Thank you, Monika!

Marsya Nurmaranti

Executive Director, Indorelawan

image

4 Simple Steps to Start Monika

Here are the steps to guide you to use Monika.
Hold your worry, this won't take hours for you to understand.
image

1. Decide what to monitor

Already know what you want to monitor? Great! First step done!

image

2. Install

npm i -g @hyperjumptech/monika

Get Monika using the popular package manager: Homebrew (macOS), Snap (Linux), or Chocolatey (Windows)

image

3. Create configuration file

You need monika.yml. Define how requests are set up (Probe), how it is triggered (Alerts), and how would you like to receive the notifications. Use our Config generator to get the monika.yml super easily!

Monika Config Generator

image

4. Run Monika

Monika by default reads a yaml configuration file called monika.yml in the current working directory if it exists. Run this command in the Terminal from the directory that contains the monika.yml file:

monika
image

Congratulations! Your web app is being monitored and Monika will send you notification if something happens.

image

What more can I do with Monika?

Here are Monika's capabilities and features to inspire and get you to start monitoring your IT systems.
image
Connecting Monika with PrometheusBy marrying Monika with Prometheus, you can display and query Monika’s data beautifully in Prometheus GUI or other data visualization tools like Grafana.Read more
image
Use Existing Postman Collections with MonikaPostman is one of the great tools to monitor your API, but maybe you’re looking for a free and open-source solution for your needs. With Monika, you can easily monitor websites without any monthly limitations. You can install Monika anywhere you want and monitor your websites right away.Read more
image
TLS certificate reminderWith Monika, you don’t have to worry about expiring TLS certificates anymore. Not that only you have prevented your TLS certificate from being expired, you also monitored your website performance. Hitting two birds with one stone.Read more
image
Chaining requestWith Monika, you can add as many requests as you want to monitor. You can monitor several undesirable events such as service outages or slow services.Read more

Get Started with Monika Now!

Monika is an open source synthetic monitoring command line application. it is actively developed and completely free!

Looking for a Low-Code Version Monitoring Solution? Try Neo Sense!

Elevate your Monika experience with Neo Sense, featuring an intuitive interface and dashboard.

\ No newline at end of file diff --git a/overview.html b/overview.html index ebf264dd9..522998f97 100644 --- a/overview.html +++ b/overview.html @@ -17,4 +17,4 @@ gtag('config', 'G-W999ZM71FP', { page_path: window.location.pathname, }); -

Overview

Star (0)

Monika is an open source and free synthetic monitoring command line application. The name Monika stands for "Monitoring Berkala", which means "periodic monitoring" in the Indonesian language.

How it works

Monika operates by reading everything from a configuration file. Based on the configuration, it will build and send out HTTP or TCP requests. If the request's response is not as expected, Monika will send notification via various channels (E-mail, webhook, Telegram, WhatsApp, and many more).

For more information, please refer to the detailed documentations below.

TopicDescription
ProbesHow requests are set up and dispatched
AlertsHow alerts are triggered and how to setup an alert
NotificationsHow to receive notifications when alerts are triggered
TLS CheckersCheck TLS validity and send notification before the expiry time
CLI OptionsHow to run monika from the command line

Features

Monika has grown rapidly since its conception and currently it has variety of the following features.

Motivation

Anyone who has created a website or a backend service would want them to be fast, robust and perform well all the time. Good design, engineering excellence, and proper processes will contribute to these goals. Yet, what is often overlooked is the importance of monitoring tools have on a project's success. Hence the budget for some type of monitoring tool is often marked as optional rather than a must have. This what motivates us. We believe proper monitoring tools must be setup from the very beginning. Any development team should integrate monitoring tools in their development process. Then they should be able to extend it into production deployment.

Not just another tool

There are plenty of free monitoring tools online, but many fall short of our requirements. Free uptime monitors exists, but they only ping for service's availability. Most users don't use services only with pings. There are also plenty of real time monitoring tools. These tools need real users, which make them less suitable during development. Monika however, can synthesize usage scenarios during development, and you can use the same scenarios in production. Synthetic monitoring tool like Monika enables you to generate complex usage flows for quality assurance. Those same flows later on can be deployed to check the production environment. All without the need to install agents or third party libraries.

In addition, Monika is relatively easy to deploy. You can deploy Monika to multiple servers in different locations (for example via Docker). Afterwards, Monika can generate and send notifications when service's degradation is detected from any of the locations. All these features are available for free.

Open source

Monika is open source and free because we want it to be available even for budget strapped teams. Monika's source code is always open for inspection. Follow any updates or give feedbacks through our discussion forum. You can also contribute to this project by reporting and fixing bugs or by adding a new notification channel.

Was this page helpful?
Next →Quick Start

PT Artha Rajamas Mandiri (Hyperjump) is an open-source-first company providing engineering excellence service. We aim to build and commercialize open-source tools to help companies streamline, simplify, and secure the most important aspects of its modern DevOps practices.

Copyright © 2024 Hyperjump Tech. All Rights Reserved.

\ No newline at end of file +

Overview

Star (0)

Monika is an open source and free synthetic monitoring command line application. The name Monika stands for "Monitoring Berkala", which means "periodic monitoring" in the Indonesian language.

How it works

Monika operates by reading everything from a configuration file. Based on the configuration, it will build and send out HTTP or TCP requests. If the request's response is not as expected, Monika will send notification via various channels (E-mail, webhook, Telegram, WhatsApp, and many more).

For more information, please refer to the detailed documentations below.

TopicDescription
ProbesHow requests are set up and dispatched
AlertsHow alerts are triggered and how to setup an alert
NotificationsHow to receive notifications when alerts are triggered
TLS CheckersCheck TLS validity and send notification before the expiry time
CLI OptionsHow to run monika from the command line

Features

Monika has grown rapidly since its conception and currently it has variety of the following features.

Motivation

Anyone who has created a website or a backend service would want them to be fast, robust and perform well all the time. Good design, engineering excellence, and proper processes will contribute to these goals. Yet, what is often overlooked is the importance of monitoring tools have on a project's success. Hence the budget for some type of monitoring tool is often marked as optional rather than a must have. This what motivates us. We believe proper monitoring tools must be setup from the very beginning. Any development team should integrate monitoring tools in their development process. Then they should be able to extend it into production deployment.

Not just another tool

There are plenty of free monitoring tools online, but many fall short of our requirements. Free uptime monitors exists, but they only ping for service's availability. Most users don't use services only with pings. There are also plenty of real time monitoring tools. These tools need real users, which make them less suitable during development. Monika however, can synthesize usage scenarios during development, and you can use the same scenarios in production. Synthetic monitoring tool like Monika enables you to generate complex usage flows for quality assurance. Those same flows later on can be deployed to check the production environment. All without the need to install agents or third party libraries.

In addition, Monika is relatively easy to deploy. You can deploy Monika to multiple servers in different locations (for example via Docker). Afterwards, Monika can generate and send notifications when service's degradation is detected from any of the locations. All these features are available for free.

Open source

Monika is open source and free because we want it to be available even for budget strapped teams. Monika's source code is always open for inspection. Follow any updates or give feedbacks through our discussion forum. You can also contribute to this project by reporting and fixing bugs or by adding a new notification channel.

Was this page helpful?
Next →Quick Start

PT Artha Rajamas Mandiri (Hyperjump) is an open-source-first company providing engineering excellence service. We aim to build and commercialize open-source tools to help companies streamline, simplify, and secure the most important aspects of its modern DevOps practices.

Copyright © 2024 Hyperjump Tech. All Rights Reserved.

\ No newline at end of file diff --git a/quick-start.html b/quick-start.html index a83391033..9282de58d 100644 --- a/quick-start.html +++ b/quick-start.html @@ -17,4 +17,4 @@ gtag('config', 'G-W999ZM71FP', { page_path: window.location.pathname, }); -

Quick Start

Star (0)

Installation

There are many ways to install Monika. However, currently only x64 architecture is supported.

Windows

The recommended approach is to use Chocolatey, a popular package manager for Windows. Check Monika page on Chocolatey for more detailed information.

If you have installed Chocolatey in your PC, then run the following command to install Monika:

choco install monika

If it does not work right away, try again on a command prompt or PowerShell with the Administrator permission.

Alternatively, Monika for Windows can be installed from its prebuilt binary. Head over to Monika Releases page and download the release archive marked with win-x64. Extract the contents of the archive and the executable monika.exe is ready to use.

macOS

The recommended approach is to use Homebrew, a popular package manager for macOS. Check Monika page on Homebrew for more detailed information.

If you have installed Homebrew, then run the following command to install Monika:

brew install monika

Alternatively, Monika for macOS can be installed from its prebuilt binary. Head over to Monika Releases page and download the release archive marked with macos-x64. Extract the contents of the archive and the executable monika is ready to use. If necessary, make the file executable with sudo chmod +x monika.

Linux

The recommended approach is to use Snapcraft, a universal package manager for Linux. Check Monika page on Snapcraft for more detailed information.

Alternatively, Monika for Linux can be automatically downloaded and installed by running an installation script as follows:

curl https://raw.githubusercontent.com/hyperjumptech/monika/main/scripts/monika-install.sh | sh

The binary will be placed into ~/.local/bin.

If you prefer to perform the installation manually, head over to Monika Releases page and download the release archive marked with linux-x64. Extract the contents of the archive and the executable monika is ready to use. If necessary, make the file executable with sudo chmod +x monika.

Via Node.js

If you have installed Node.js in your machine, you can install Monika directly from npm:

npm i -g @hyperjumptech/monika

or yarn:

yarn global add @hyperjumptech/monika

Download the configuration file

Once you have installed Monika, let's confirm that it's working by downloading the example configuration that uses Desktop notification called config.desktop.example.yml and rename it as monika.yml.

Run Monika

Monika by default reads a yaml configuration file called monika.yml in the current working directory if it exists. To run monika with the configuration file that you have downloaded before, run this command in the Terminal from the directory that contains the monika.yml file:

monika

Otherwise, you can also specify a path to a YAML configuration file with -c flag if you didn't rename your configuration file as monika.yml:

monika -c <path_to_configuration_file>

Better yet, you can provide a URL that contains monika configuration

monika -c https://domain.com/path/to/your/configuration.yml

When using remote configuration file, you can use the --config-interval to tell Monika to check the configuration file periodically. For example, to check every 10 seconds:

monika -c https://raw.githubusercontent.com/hyperjumptech/monika/main/config_sample/config.desktop.example.yml --config-interval 10

Run Monika on Docker

docker run --name monika \
--net=host \
-d hyperjump/monika:latest \
monika -c https://domain.com/path/to/your/configuration.yml

On ARM / Apple Silicon chip, you need to pass --platform linux/amd64 to docker.

Congratulations, you have successfully run Monika in your machine!

Next Step

Now it's time to write your own configuration file. You can use VSCode with YAML extension for the auto completion feature or you can also use the Monika Config Generator web app if you prefer using Graphical User Interface (GUI).

For advanced configuration such as configuring notifications, probes, and alerts, you can find them on the sidebar menu.

← PrevOverview
Was this page helpful?
Next →Configuration File

PT Artha Rajamas Mandiri (Hyperjump) is an open-source-first company providing engineering excellence service. We aim to build and commercialize open-source tools to help companies streamline, simplify, and secure the most important aspects of its modern DevOps practices.

Copyright © 2024 Hyperjump Tech. All Rights Reserved.

\ No newline at end of file +

Quick Start

Star (0)

Installation

There are many ways to install Monika. However, currently only x64 architecture is supported.

Windows

The recommended approach is to use Chocolatey, a popular package manager for Windows. Check Monika page on Chocolatey for more detailed information.

If you have installed Chocolatey in your PC, then run the following command to install Monika:

choco install monika

If it does not work right away, try again on a command prompt or PowerShell with the Administrator permission.

Alternatively, Monika for Windows can be installed from its prebuilt binary. Head over to Monika Releases page and download the release archive marked with win-x64. Extract the contents of the archive and the executable monika.exe is ready to use.

macOS

The recommended approach is to use Homebrew, a popular package manager for macOS. Check Monika page on Homebrew for more detailed information.

If you have installed Homebrew, then run the following command to install Monika:

brew install monika

Alternatively, Monika for macOS can be installed from its prebuilt binary. Head over to Monika Releases page and download the release archive marked with macos-x64. Extract the contents of the archive and the executable monika is ready to use. If necessary, make the file executable with sudo chmod +x monika.

Linux

The recommended approach is to use Snapcraft, a universal package manager for Linux. Check Monika page on Snapcraft for more detailed information.

Alternatively, Monika for Linux can be automatically downloaded and installed by running an installation script as follows:

curl https://raw.githubusercontent.com/hyperjumptech/monika/main/scripts/monika-install.sh | sh

The binary will be placed into ~/.local/bin.

If you prefer to perform the installation manually, head over to Monika Releases page and download the release archive marked with linux-x64. Extract the contents of the archive and the executable monika is ready to use. If necessary, make the file executable with sudo chmod +x monika.

Via Node.js

If you have installed Node.js in your machine, you can install Monika directly from npm:

npm i -g @hyperjumptech/monika

or yarn:

yarn global add @hyperjumptech/monika

Download the configuration file

Once you have installed Monika, let's confirm that it's working by downloading the example configuration that uses Desktop notification called config.desktop.example.yml and rename it as monika.yml.

Run Monika

Monika by default reads a yaml configuration file called monika.yml in the current working directory if it exists. To run monika with the configuration file that you have downloaded before, run this command in the Terminal from the directory that contains the monika.yml file:

monika

Otherwise, you can also specify a path to a YAML configuration file with -c flag if you didn't rename your configuration file as monika.yml:

monika -c <path_to_configuration_file>

Better yet, you can provide a URL that contains monika configuration

monika -c https://domain.com/path/to/your/configuration.yml

When using remote configuration file, you can use the --config-interval to tell Monika to check the configuration file periodically. For example, to check every 10 seconds:

monika -c https://raw.githubusercontent.com/hyperjumptech/monika/main/config_sample/config.desktop.example.yml --config-interval 10

Run Monika on Docker

docker run --name monika \
--net=host \
-d hyperjump/monika:latest \
monika -c https://domain.com/path/to/your/configuration.yml

On ARM / Apple Silicon chip, you need to pass --platform linux/amd64 to docker.

Congratulations, you have successfully run Monika in your machine!

Next Step

Now it's time to write your own configuration file. You can use VSCode with YAML extension for the auto completion feature or you can also use the Monika Config Generator web app if you prefer using Graphical User Interface (GUI).

For advanced configuration such as configuring notifications, probes, and alerts, you can find them on the sidebar menu.

← PrevOverview
Was this page helpful?
Next →Configuration File

PT Artha Rajamas Mandiri (Hyperjump) is an open-source-first company providing engineering excellence service. We aim to build and commercialize open-source tools to help companies streamline, simplify, and secure the most important aspects of its modern DevOps practices.

Copyright © 2024 Hyperjump Tech. All Rights Reserved.

\ No newline at end of file diff --git a/sitemap.xml b/sitemap.xml index f648a5ef7..898314023 100644 --- a/sitemap.xml +++ b/sitemap.xml @@ -3,200 +3,200 @@ https://monika.hyperjump.tech/articles - 2024-09-18T09:17:57.493Z + 2024-09-25T09:18:22.424Z monthly 1.0 https://monika.hyperjump.tech/index - 2024-09-18T09:17:57.493Z + 2024-09-25T09:18:22.424Z monthly 1.0 https://monika.hyperjump.tech/overview - 2024-09-18T09:17:57.493Z + 2024-09-25T09:18:22.424Z monthly 1.0 https://monika.hyperjump.tech/quick-start - 2024-09-18T09:17:57.493Z + 2024-09-25T09:18:22.424Z monthly 1.0 https://monika.hyperjump.tech/deployment/deploy-to-fly-io - 2024-09-18T09:17:57.493Z + 2024-09-25T09:18:22.424Z monthly 1.0 https://monika.hyperjump.tech/guides/alerts - 2024-09-18T09:17:57.493Z + 2024-09-25T09:18:22.424Z monthly 1.0 https://monika.hyperjump.tech/guides/cli-options - 2024-09-18T09:17:57.493Z + 2024-09-25T09:18:22.424Z monthly 1.0 https://monika.hyperjump.tech/guides/configuration-file - 2024-09-18T09:17:57.493Z + 2024-09-25T09:18:22.425Z monthly 1.0 https://monika.hyperjump.tech/guides/examples - 2024-09-18T09:17:57.493Z + 2024-09-25T09:18:22.425Z monthly 1.0 https://monika.hyperjump.tech/guides/new-notifications - 2024-09-18T09:17:57.493Z + 2024-09-25T09:18:22.425Z monthly 1.0 https://monika.hyperjump.tech/guides/notifications - 2024-09-18T09:17:57.493Z + 2024-09-25T09:18:22.425Z monthly 1.0 https://monika.hyperjump.tech/guides/probes - 2024-09-18T09:17:57.493Z + 2024-09-25T09:18:22.425Z monthly 1.0 https://monika.hyperjump.tech/guides/status-notification - 2024-09-18T09:17:57.493Z + 2024-09-25T09:18:22.425Z monthly 1.0 https://monika.hyperjump.tech/guides/tls-checkers - 2024-09-18T09:17:57.493Z + 2024-09-25T09:18:22.425Z monthly 1.0 https://monika.hyperjump.tech/guides/troubleshoot - 2024-09-18T09:17:57.493Z + 2024-09-25T09:18:22.425Z monthly 1.0 https://monika.hyperjump.tech/tutorial/deploy-to-fly-io - 2024-09-18T09:17:57.493Z + 2024-09-25T09:18:22.425Z monthly 1.0 https://monika.hyperjump.tech/tutorial/run-in-background - 2024-09-18T09:17:57.493Z + 2024-09-25T09:18:22.425Z monthly 1.0 https://monika.hyperjump.tech/tutorial/run-in-docker - 2024-09-18T09:17:57.493Z + 2024-09-25T09:18:22.425Z monthly 1.0 https://monika.hyperjump.tech/tutorial/run-in-raspberry-pi - 2024-09-18T09:17:57.493Z + 2024-09-25T09:18:22.425Z monthly 1.0 https://monika.hyperjump.tech/tutorial/run-using-dingtalk-notification - 2024-09-18T09:17:57.493Z + 2024-09-25T09:18:22.425Z monthly 1.0 https://monika.hyperjump.tech/tutorial/run-using-google-chat-notification - 2024-09-18T09:17:57.493Z + 2024-09-25T09:18:22.425Z monthly 1.0 https://monika.hyperjump.tech/tutorial/run-using-mailgun-notification - 2024-09-18T09:17:57.493Z + 2024-09-25T09:18:22.425Z monthly 1.0 https://monika.hyperjump.tech/tutorial/run-using-microsoft-teams-notification - 2024-09-18T09:17:57.493Z + 2024-09-25T09:18:22.425Z monthly 1.0 https://monika.hyperjump.tech/tutorial/run-using-monika-whatsapp-notifier-notification - 2024-09-18T09:17:57.493Z + 2024-09-25T09:18:22.425Z monthly 1.0 https://monika.hyperjump.tech/tutorial/run-using-opsgenie-notification - 2024-09-18T09:17:57.493Z + 2024-09-25T09:18:22.425Z monthly 1.0 https://monika.hyperjump.tech/tutorial/run-using-ping-method - 2024-09-18T09:17:57.493Z + 2024-09-25T09:18:22.425Z monthly 1.0 https://monika.hyperjump.tech/tutorial/run-using-pushover-notification - 2024-09-18T09:17:57.493Z + 2024-09-25T09:18:22.425Z monthly 1.0 https://monika.hyperjump.tech/tutorial/run-using-slack-notification - 2024-09-18T09:17:57.493Z + 2024-09-25T09:18:22.425Z monthly 1.0 https://monika.hyperjump.tech/tutorial/run-using-smtp-notification - 2024-09-18T09:17:57.493Z + 2024-09-25T09:18:22.425Z monthly 1.0 https://monika.hyperjump.tech/tutorial/run-using-telegram-notification - 2024-09-18T09:17:57.493Z + 2024-09-25T09:18:22.425Z monthly 1.0 https://monika.hyperjump.tech/tutorial/run-with-gmail-notification - 2024-09-18T09:17:57.493Z + 2024-09-25T09:18:22.425Z monthly 1.0 https://monika.hyperjump.tech/tutorial/visualizing-monika-data-with-prometheus-and-grafana - 2024-09-18T09:17:57.493Z + 2024-09-25T09:18:22.425Z monthly 1.0 https://monika.hyperjump.tech/tutorial/write-config-in-visual-studio-code - 2024-09-18T09:17:57.493Z + 2024-09-25T09:18:22.425Z monthly 1.0 diff --git a/tutorial/deploy-to-fly-io.html b/tutorial/deploy-to-fly-io.html index 9afa430cb..4566fa873 100644 --- a/tutorial/deploy-to-fly-io.html +++ b/tutorial/deploy-to-fly-io.html @@ -17,7 +17,7 @@ gtag('config', 'G-W999ZM71FP', { page_path: window.location.pathname, }); -

Deploy to Fly.io

Star (0)

Fly.io is a Platform-as-a-service for running full-stack apps and databases close to your users. Using Fly.io, you can deploy different kinds of apps such as Node, Go, Laravel, Python, and Dockerfile-based applications.

In this example, we will show you how to run Monika in Fly.io using Dockerfile deployments. First, we need to install Fly CLI.

  • If you are using macOS, you can install it via Homebrew by running brew install flyctl in your terminal. If you prefer the CURL way, run the command curl -L https://fly.io/install.sh | sh in your terminal.
  • If you are using Linux, you can run curl -L https://fly.io/install.sh | sh in your terminal
  • If you are using Windows, you can run the Powershell install script: powershell -Command "iwr https://fly.io/install.ps1 -useb | iex"

After installing the Fly CLI, the next step is to log in to Fly.io. You might need to sign up first by running fly auth signup in your terminal to create an account. Otherwise, you can run fly auth login in your terminal.

Both commands will open a browser so make sure you are running in a GUI environment. Once being authenticated, you can proceed to the next step.

Create a folder called flyio-monika in your local machine. Then, navigate to the flyio-monika and create two files: Dockerfile and monika.yml.

Dockerfile:

FROM hyperjump/monika:latest
+

Deploy to Fly.io

Star (0)

Fly.io is a Platform-as-a-service for running full-stack apps and databases close to your users. Using Fly.io, you can deploy different kinds of apps such as Node, Go, Laravel, Python, and Dockerfile-based applications.

In this example, we will show you how to run Monika in Fly.io using Dockerfile deployments. First, we need to install Fly CLI.

  • If you are using macOS, you can install it via Homebrew by running brew install flyctl in your terminal. If you prefer the CURL way, run the command curl -L https://fly.io/install.sh | sh in your terminal.
  • If you are using Linux, you can run curl -L https://fly.io/install.sh | sh in your terminal
  • If you are using Windows, you can run the Powershell install script: powershell -Command "iwr https://fly.io/install.ps1 -useb | iex"

After installing the Fly CLI, the next step is to log in to Fly.io. You might need to sign up first by running fly auth signup in your terminal to create an account. Otherwise, you can run fly auth login in your terminal.

Both commands will open a browser so make sure you are running in a GUI environment. Once being authenticated, you can proceed to the next step.

Create a folder called flyio-monika in your local machine. Then, navigate to the flyio-monika and create two files: Dockerfile and monika.yml.

Dockerfile:

FROM hyperjump/monika:latest
WORKDIR /usr
COPY monika.yml .
-
CMD ["monika", "-c", "monika.yml"]

monika.yml:

probes:
- id: example-com
requests:
- url: https://reqres.in
alerts:
- assertion: response.time > 1000
message: Website is slow
  • The Dockerfile file will pull the latest hyperjump/monika image from the Docker Hub and will be running the monika.yml file.
  • The monika.yml file is the Monika configuration file.

This Monika configuration sets up a probe for the website "reqres.in". The probe sends a request to the website's URL and triggers an alert if the response time exceeds 1000 milliseconds. An incident will be triggered if the alert condition is met, and a recovery notification will be sent when the alert condition is not met.

Save these two files inside the flyio-monika directory. Once that’s done, you can run fly launch in the flyio-monika directory. You will be prompted to enter a unique name and select a location for the app.

You can skip the PostgreSQL database setup, and proceed to deploy now. It will automatically create a file called fly.toml and it may take up to five minutes to successfully deploy the app. Once that’s done, you can go to your Fly.io dashboard to see that Monika is now running:

We want to add more regions to deploy our Monika instance. So, we need to add a new region to the region pool. You can simply do so by running fly regions add [...regions] in your terminal. You can see all the available regions on the Fly.io documentation page.

Once you add the Hong Kong region, it’s time to scale the Monika instance by running fly scale 2 --max-per-region 1 in your terminal. Then, check if the scaling works by running fly scale show

Alternatively, you can go to the Fly.io dashboard and navigate to the Monitoring menu. You will see that your app is now running in two regions.

PT Artha Rajamas Mandiri (Hyperjump) is an open-source-first company providing engineering excellence service. We aim to build and commercialize open-source tools to help companies streamline, simplify, and secure the most important aspects of its modern DevOps practices.

Copyright © 2024 Hyperjump Tech. All Rights Reserved.

\ No newline at end of file +
CMD ["monika", "-c", "monika.yml"]

monika.yml:

probes:
- id: example-com
requests:
- url: https://reqres.in
alerts:
- assertion: response.time > 1000
message: Website is slow
  • The Dockerfile file will pull the latest hyperjump/monika image from the Docker Hub and will be running the monika.yml file.
  • The monika.yml file is the Monika configuration file.

This Monika configuration sets up a probe for the website "reqres.in". The probe sends a request to the website's URL and triggers an alert if the response time exceeds 1000 milliseconds. An incident will be triggered if the alert condition is met, and a recovery notification will be sent when the alert condition is not met.

Save these two files inside the flyio-monika directory. Once that’s done, you can run fly launch in the flyio-monika directory. You will be prompted to enter a unique name and select a location for the app.

You can skip the PostgreSQL database setup, and proceed to deploy now. It will automatically create a file called fly.toml and it may take up to five minutes to successfully deploy the app. Once that’s done, you can go to your Fly.io dashboard to see that Monika is now running:

We want to add more regions to deploy our Monika instance. So, we need to add a new region to the region pool. You can simply do so by running fly regions add [...regions] in your terminal. You can see all the available regions on the Fly.io documentation page.

Once you add the Hong Kong region, it’s time to scale the Monika instance by running fly scale 2 --max-per-region 1 in your terminal. Then, check if the scaling works by running fly scale show

Alternatively, you can go to the Fly.io dashboard and navigate to the Monitoring menu. You will see that your app is now running in two regions.

PT Artha Rajamas Mandiri (Hyperjump) is an open-source-first company providing engineering excellence service. We aim to build and commercialize open-source tools to help companies streamline, simplify, and secure the most important aspects of its modern DevOps practices.

Copyright © 2024 Hyperjump Tech. All Rights Reserved.

\ No newline at end of file diff --git a/tutorial/run-in-background.html b/tutorial/run-in-background.html index c89689efe..9a67b2c4d 100644 --- a/tutorial/run-in-background.html +++ b/tutorial/run-in-background.html @@ -17,7 +17,7 @@ gtag('config', 'G-W999ZM71FP', { page_path: window.location.pathname, }); -

Run Monika in Background

Star (0)

By default Monika will run in the foreground. Like other Node.js applications, there are several ways to run Monika in the background on Unix, Linux, and macOS.

Using Docker

Refer to the Run in Docker documentation page.

Using PM2

  • Make sure you already have NPM installed
  • Run npm install -g pm2 to install PM2
  • Run pm2 start monika -- -c <your_full_path_to_the_monika.yml> to start Monika using PM2

If you want to add more Monika parameters such as --prometheus, add it after the double dashes. But if you want to add more PM2 parameters such as -i max, add it before the double dashes.

Refer to the PM2 Official Documentation for all available PM2 parameters.

Using nohup

  • On your terminal, run nohup monika &

  • You'll get an output similar to the following.

    [1] 93457
    appending output to nohup.out

    In the above example, 93457 is the process ID (pid). And the output of Monika is written to nohup.out file.

  • To stop Monika, run kill -9 <pid>.

Using screen

  • On Debian/Ubuntu, you can install it by running sudo apt install screen.

  • Run screen.

  • Run monika -c monika.yaml

  • Press Ctrl+a then D. This will cause Monika to run on a different screen in the background.

  • To go back to the screen, run screen -ls to list the running screens. You will get an output similar to the following.

    There is a screen on:
    9049.pts-0.the-server (03/23/21 08:34:38) (Detached)
    1 Socket in /run/screen/S-server.

    9049.pts-0.the-server is the name of the screen.

  • Then run screen -r <name_of_the_screen>.

  • To stop Monika, hit CTRL+C and then CTRL+D to exit/terminate Screen.

Using systemd

  • To use the systemd service unit, you need to locate the Monika binary. For example, if you installed Monika using NPM, run which monika to know where is your Monika located. +

    Run Monika in Background

    Star (0)

    By default Monika will run in the foreground. Like other Node.js applications, there are several ways to run Monika in the background on Unix, Linux, and macOS.

    Using Docker

    Refer to the Run in Docker documentation page.

    Using PM2

    • Make sure you already have NPM installed
    • Run npm install -g pm2 to install PM2
    • Run pm2 start monika -- -c <your_full_path_to_the_monika.yml> to start Monika using PM2

    If you want to add more Monika parameters such as --prometheus, add it after the double dashes. But if you want to add more PM2 parameters such as -i max, add it before the double dashes.

    Refer to the PM2 Official Documentation for all available PM2 parameters.

    Using nohup

    • On your terminal, run nohup monika &

    • You'll get an output similar to the following.

      [1] 93457
      appending output to nohup.out

      In the above example, 93457 is the process ID (pid). And the output of Monika is written to nohup.out file.

    • To stop Monika, run kill -9 <pid>.

    Using screen

    • On Debian/Ubuntu, you can install it by running sudo apt install screen.

    • Run screen.

    • Run monika -c monika.yaml

    • Press Ctrl+a then D. This will cause Monika to run on a different screen in the background.

    • To go back to the screen, run screen -ls to list the running screens. You will get an output similar to the following.

      There is a screen on:
      9049.pts-0.the-server (03/23/21 08:34:38) (Detached)
      1 Socket in /run/screen/S-server.

      9049.pts-0.the-server is the name of the screen.

    • Then run screen -r <name_of_the_screen>.

    • To stop Monika, hit CTRL+C and then CTRL+D to exit/terminate Screen.

    Using systemd

    • To use the systemd service unit, you need to locate the Monika binary. For example, if you installed Monika using NPM, run which monika to know where is your Monika located. e.g

      1. /home/hyperjump/.nvm/versions/node/v14.17.6/bin/monika is the full path to Monika binary file
      2. /home/hyperjump/.nvm/versions/node/v14.17.6/bin/ is the full path to Monika binary directory
    • Create a new file and copy the contents below into the file:

      [Unit]
      Description=Monika
      [Service]
      ExecStart=/bin/sh -c '<full_path_to_your_monika_binary_file> -c <full_path_to_your_monika.yml>'
      Restart=on-failure
      User=<your_user>
      Group=<your_group>
      WorkingDirectory=<full_path_to_your_monika_binary_directory>
      -
      [Install]
      WantedBy=multi-user.target
    • Replace the values to the correct values and save the file as monika.service

    • Adjust the service file permissions to 644 by running sudo chmod 644 monika.service

    • Copy the monika.service file to /etc/systemd/system/ folder by running sudo cp monika.service /etc/systemd/system/monika.service

    • Reload the daemon server by running sudo systemctl daemon-reload

    • Start Monika service by running sudo systemctl restart monika.service

    • To confirm that Monika is working flawlessly, run sudo systemctl status monika.service in your terminal.

    PT Artha Rajamas Mandiri (Hyperjump) is an open-source-first company providing engineering excellence service. We aim to build and commercialize open-source tools to help companies streamline, simplify, and secure the most important aspects of its modern DevOps practices.

    Copyright © 2024 Hyperjump Tech. All Rights Reserved.

    \ No newline at end of file +
[Install]
WantedBy=multi-user.target
  • Replace the values to the correct values and save the file as monika.service

  • Adjust the service file permissions to 644 by running sudo chmod 644 monika.service

  • Copy the monika.service file to /etc/systemd/system/ folder by running sudo cp monika.service /etc/systemd/system/monika.service

  • Reload the daemon server by running sudo systemctl daemon-reload

  • Start Monika service by running sudo systemctl restart monika.service

  • To confirm that Monika is working flawlessly, run sudo systemctl status monika.service in your terminal.

  • Resources

    DocumentationBlogHow-toExamplesConfig GeneratorWhatsApp Notifier

    Community

    DiscussionReleasesNPM Homepage

    PT Artha Rajamas Mandiri (Hyperjump) is an open-source-first company providing engineering excellence service. We aim to build and commercialize open-source tools to help companies streamline, simplify, and secure the most important aspects of its modern DevOps practices.

    Copyright © 2024 Hyperjump Tech. All Rights Reserved.

    \ No newline at end of file diff --git a/tutorial/run-in-docker.html b/tutorial/run-in-docker.html index 98068e09f..0df4c55d3 100644 --- a/tutorial/run-in-docker.html +++ b/tutorial/run-in-docker.html @@ -17,7 +17,7 @@ gtag('config', 'G-W999ZM71FP', { page_path: window.location.pathname, }); -

    Run Monika in Docker

    Star (0)

    Monika is available as a docker image. You can find the image in the docker hub as hyperjump/monika, or pull the image with the following command

    docker pull hyperjump/monika

    Running Monika on ARM / Apple Silicon

    Monika docker image only supports amd64 architecture, you have to pass --platform linux/amd64 when using hyperjump/monika docker image

    docker pull --platform linux/amd64 hyperjump/monika

    Once you've pulled the latest image, you can run it using

    # Run Monika in foreground
    docker run --name monika --net=host -it hyperjump/monika:latest
    +

    Run Monika in Docker

    Star (0)

    Monika is available as a docker image. You can find the image in the docker hub as hyperjump/monika, or pull the image with the following command

    docker pull hyperjump/monika

    Running Monika on ARM / Apple Silicon

    Monika docker image only supports amd64 architecture, you have to pass --platform linux/amd64 when using hyperjump/monika docker image

    docker pull --platform linux/amd64 hyperjump/monika

    Once you've pulled the latest image, you can run it using

    # Run Monika in foreground
    docker run --name monika --net=host -it hyperjump/monika:latest
    # Or, if you prefer to run Monika in the background
    docker run --name monika --net=host --detach hyperjump/monika:latest
    # On ARM / Apple Silicon chip, pass --platform linux/amd64
    docker run --name monika --net=host --platform linux/amd64 -it hyperjump/monika:latest
    docker run --name monika --net=host --platform linux/amd64 --detach hyperjump/monika:latest

    In the example above, we create a container from the hyperjump/monika base image naming it with--name monika, indicate we'll use the host machine's network configuration with --net=host and let it run in the backround using the --detach switch (or interactively with -it).

    Once monika is up and running, you can see its log using

    docker logs monika

    Or you can stop the container with

    docker stop monika

    For more complex probing, for example to use your existing customized configuration and have the prometheus plugin. First copy your personalized config to a directory, say /config. Then create your container with the directory mounted as a --volume (-v) for the container to use, like so:

    docker run --name monika_interactive \
    --net=host \
    -v ${PWD}/config:/config \
    -d hyperjump/monika:latest \
    monika -c /config/myConfig.yml --prometheus 3001
    -
    # On ARM / Apple Silicon
    docker run --name monika_interactive \
    --net=host \
    --platform linux/amd64 \
    -v ${PWD}/config:/config \
    -d hyperjump/monika:latest \
    monika -c /config/myConfig.yml --prometheus 3001

    Troubleshooting

    Genererally when facing issues with your container or configuration, try the same configuration YAML using regular monika. For instance:

    monika -c myConfig.yml --prometheus 3001

    Ensure your container is up and running by issuing simple commands/parameters:

    docker run --name monika_interactive \
    -it hyperjump/monika:latest monika --help

    For further docker commands and documentation, visit the official Docker documentation here.

    If all else fails, hit us up at monika discussions or file an issue.

    PT Artha Rajamas Mandiri (Hyperjump) is an open-source-first company providing engineering excellence service. We aim to build and commercialize open-source tools to help companies streamline, simplify, and secure the most important aspects of its modern DevOps practices.

    Copyright © 2024 Hyperjump Tech. All Rights Reserved.

    \ No newline at end of file +
    # On ARM / Apple Silicon
    docker run --name monika_interactive \
    --net=host \
    --platform linux/amd64 \
    -v ${PWD}/config:/config \
    -d hyperjump/monika:latest \
    monika -c /config/myConfig.yml --prometheus 3001

    Troubleshooting

    Genererally when facing issues with your container or configuration, try the same configuration YAML using regular monika. For instance:

    monika -c myConfig.yml --prometheus 3001

    Ensure your container is up and running by issuing simple commands/parameters:

    docker run --name monika_interactive \
    -it hyperjump/monika:latest monika --help

    For further docker commands and documentation, visit the official Docker documentation here.

    If all else fails, hit us up at monika discussions or file an issue.

    PT Artha Rajamas Mandiri (Hyperjump) is an open-source-first company providing engineering excellence service. We aim to build and commercialize open-source tools to help companies streamline, simplify, and secure the most important aspects of its modern DevOps practices.

    Copyright © 2024 Hyperjump Tech. All Rights Reserved.

    \ No newline at end of file diff --git a/tutorial/run-in-raspberry-pi.html b/tutorial/run-in-raspberry-pi.html index a86c7d44d..b8da7e30f 100644 --- a/tutorial/run-in-raspberry-pi.html +++ b/tutorial/run-in-raspberry-pi.html @@ -17,4 +17,4 @@ gtag('config', 'G-W999ZM71FP', { page_path: window.location.pathname, }); -

    Run Monika in Raspberry Pi

    Star (0)

    Raspberry Pi is a good hardware to run Monika. For Raspbian OS user, you need to install NodeJS >= 14 manually since Raspbian package manager (apt) only install for NodeJS 8.

    Install Node 14 in Raspbian

    Monika needs NodeJS >= 14 and npm ~= 6 to run.To install NodeJS 14 in Raspberry Pi (Raspbian OS), you need to get CPU architecture by running uname:

    uname -a

    Next, download NodeJS package that matches your architecture. For example, if your architecture is arm v7:

    # Other architectures are available at https://nodejs.org/dist/v14.17.3
    wget https://nodejs.org/dist/v14.17.3/node-v14.17.3-linux-armv7l.tar.xz
    uname example

    Un-tar the file:

    tar xf node-v14.17.3-linux-armv7l.tar.xz

    And install NodeJS globally:

    sudo cp -R node-v14.17.3-linux-armv7l/* /usr/local/
    install nodejs

    Check NodeJS and NPM version using this command:

    node -v
    npm -v
    nodejs & npm version

    Install and Run Monika in Raspbian

    For now, the way to install Monika in Raspbian is to install from source code.

    There are two ways to get Monika in Raspbian, from archive file and via Git.

    • Download Monika source code archive
    cd ~
    mkdir monika-src
    cd monika-src
    # Download latest tarball and directly extract it to current directory
    wget -c `wget -S -O - https://api.github.com/repos/hyperjumptech/monika/releases/latest | grep -o -E "https://(.*)tarball(.*)/([^\"]+)"` -O - | tar -xz --strip-components=1
    • Get Monika from our Git repository
    cd ~
    git clone --depth 1 --branch `git -c 'versionsort.suffix=-' ls-remote --exit-code --refs --sort='version:refname' --tags https://github.com/hyperjumptech/monika.git '*.*.*' | tail -1 | cut -d'/' -f 3` https://github.com/hyperjumptech/monika.git
    cd monika/

    Looking for other versions? Check here

    • Download Monika dependencies and prepack
    npm install && npm run prepack

    Run Monika

    To run Monika, use this command

    ./bin/run -c monika.example.yml
    nodejs & npm version

    PT Artha Rajamas Mandiri (Hyperjump) is an open-source-first company providing engineering excellence service. We aim to build and commercialize open-source tools to help companies streamline, simplify, and secure the most important aspects of its modern DevOps practices.

    Copyright © 2024 Hyperjump Tech. All Rights Reserved.

    \ No newline at end of file +

    Run Monika in Raspberry Pi

    Star (0)

    Raspberry Pi is a good hardware to run Monika. For Raspbian OS user, you need to install NodeJS >= 14 manually since Raspbian package manager (apt) only install for NodeJS 8.

    Install Node 14 in Raspbian

    Monika needs NodeJS >= 14 and npm ~= 6 to run.To install NodeJS 14 in Raspberry Pi (Raspbian OS), you need to get CPU architecture by running uname:

    uname -a

    Next, download NodeJS package that matches your architecture. For example, if your architecture is arm v7:

    # Other architectures are available at https://nodejs.org/dist/v14.17.3
    wget https://nodejs.org/dist/v14.17.3/node-v14.17.3-linux-armv7l.tar.xz
    uname example

    Un-tar the file:

    tar xf node-v14.17.3-linux-armv7l.tar.xz

    And install NodeJS globally:

    sudo cp -R node-v14.17.3-linux-armv7l/* /usr/local/
    install nodejs

    Check NodeJS and NPM version using this command:

    node -v
    npm -v
    nodejs & npm version

    Install and Run Monika in Raspbian

    For now, the way to install Monika in Raspbian is to install from source code.

    There are two ways to get Monika in Raspbian, from archive file and via Git.

    • Download Monika source code archive
    cd ~
    mkdir monika-src
    cd monika-src
    # Download latest tarball and directly extract it to current directory
    wget -c `wget -S -O - https://api.github.com/repos/hyperjumptech/monika/releases/latest | grep -o -E "https://(.*)tarball(.*)/([^\"]+)"` -O - | tar -xz --strip-components=1
    • Get Monika from our Git repository
    cd ~
    git clone --depth 1 --branch `git -c 'versionsort.suffix=-' ls-remote --exit-code --refs --sort='version:refname' --tags https://github.com/hyperjumptech/monika.git '*.*.*' | tail -1 | cut -d'/' -f 3` https://github.com/hyperjumptech/monika.git
    cd monika/

    Looking for other versions? Check here

    • Download Monika dependencies and prepack
    npm install && npm run prepack

    Run Monika

    To run Monika, use this command

    ./bin/run -c monika.example.yml
    nodejs & npm version

    PT Artha Rajamas Mandiri (Hyperjump) is an open-source-first company providing engineering excellence service. We aim to build and commercialize open-source tools to help companies streamline, simplify, and secure the most important aspects of its modern DevOps practices.

    Copyright © 2024 Hyperjump Tech. All Rights Reserved.

    \ No newline at end of file diff --git a/tutorial/run-using-dingtalk-notification.html b/tutorial/run-using-dingtalk-notification.html index e172568f7..0cb2a6de1 100644 --- a/tutorial/run-using-dingtalk-notification.html +++ b/tutorial/run-using-dingtalk-notification.html @@ -17,4 +17,4 @@ gtag('config', 'G-W999ZM71FP', { page_path: window.location.pathname, }); -

    Run using DingTalk Notification

    Star (0)

    This tutorial will show you how to integrate Monika with DingTalk to get your Monika notifications

    Setup DingTalk Robot

    Setting up DingTalk could be very difficult if you can’t read Chinese. So, we will guide you on how to do it with pictures so that you can understand it more straightforwardly.

    First, you need to open https://open.dingtalk.com/document/group/assign-a-webhook-url-to-an-internal-chatbot to access the documentation. Then, you need to click the highlighted URL below:

    Assuming you already have a DingTalk account, you will be redirected to the page in the image below. If you haven’t, you will be redirected to create an account.

    After that, go to the second menu on the navbar, and select the first sub-menu like so:

    You will be redirected to another page. Select the last menu on the sidebar, and click the blue button to create a robot.

    After that, you will be prompted to fill out a form to create a robot. Fill out the form with the application name, description, and icon. Once that’s done, click the blue button again.

    If the bot has been successfully created, it should redirect you to the robot details page.

    But your newly created robot has not been activated yet, so let’s activate the robot by selecting the last menu on the sidebar, then select the first sub-menu of it, and click the right blue button. Once that’s done, the red indicator should turn green.

    Use DingTalk Robot in the Desktop App

    Now that we have successfully created the robot, we can use it in the desktop app. So, download the desktop app and authenticate with your credentials. Then, create a new group for the robot to be added.

    Then, click the group and open the settings inside the group and click the Group Assistant menu.

    From there, you can add your previously created robot. Click the robot name you have just created.

    A popup will appear showing your robot data. Scroll down to the webhook URL and copy the webhook URL to another place. Then, copy only the access token in the webhook URL. The access token format should be like this:

    https://oapi.dingtalk.com/robot/send?access\_token=<your\_access\_token>

    Save it to somewhere safe as we are going to need it later.

    Additionally, you can secure your robot by allowing keywords. Scroll down to Security Settings and check the Custom Keywords checkbox. From there, you can define the keywords allowlist yourself.

    We are finally done with the DingTalk setup, all that’s left is to set up Monika with the DingTalk webhook URL.

    Integrating Monika with DingTalk

    Now that we have our access token from DingTalk, it’s time to create a Monika configuration called monika.yml

    notifications:
    - id: dingtalk-notif
    type: dingtalk
    data:
    access_token: <your_access_token>
    probes:
    - id: '1'
    name: Hyperjump
    description: Landing page
    interval: 1
    requests:
    - method: GET
    url: 'http://localhost:3000/api/demo/status'
    alerts:
    - query: response.status != 200
    message: Status not 2xx

    Let me explain the configuration a little bit:

    • Monika will use DingTalk as their notification channel, using the access token from the previous step
    • Monika will probe http://localhost:3000/api/demo/status every one second
    • Monika will alert you if the response status code is not 200

    Once that’s done, run the monika.yml with the configuration above.

    Congratulations! You have successfully integrated Monika with DingTalk!

    PT Artha Rajamas Mandiri (Hyperjump) is an open-source-first company providing engineering excellence service. We aim to build and commercialize open-source tools to help companies streamline, simplify, and secure the most important aspects of its modern DevOps practices.

    Copyright © 2024 Hyperjump Tech. All Rights Reserved.

    \ No newline at end of file +

    Run using DingTalk Notification

    Star (0)

    This tutorial will show you how to integrate Monika with DingTalk to get your Monika notifications

    Setup DingTalk Robot

    Setting up DingTalk could be very difficult if you can’t read Chinese. So, we will guide you on how to do it with pictures so that you can understand it more straightforwardly.

    First, you need to open https://open.dingtalk.com/document/group/assign-a-webhook-url-to-an-internal-chatbot to access the documentation. Then, you need to click the highlighted URL below:

    Assuming you already have a DingTalk account, you will be redirected to the page in the image below. If you haven’t, you will be redirected to create an account.

    After that, go to the second menu on the navbar, and select the first sub-menu like so:

    You will be redirected to another page. Select the last menu on the sidebar, and click the blue button to create a robot.

    After that, you will be prompted to fill out a form to create a robot. Fill out the form with the application name, description, and icon. Once that’s done, click the blue button again.

    If the bot has been successfully created, it should redirect you to the robot details page.

    But your newly created robot has not been activated yet, so let’s activate the robot by selecting the last menu on the sidebar, then select the first sub-menu of it, and click the right blue button. Once that’s done, the red indicator should turn green.

    Use DingTalk Robot in the Desktop App

    Now that we have successfully created the robot, we can use it in the desktop app. So, download the desktop app and authenticate with your credentials. Then, create a new group for the robot to be added.

    Then, click the group and open the settings inside the group and click the Group Assistant menu.

    From there, you can add your previously created robot. Click the robot name you have just created.

    A popup will appear showing your robot data. Scroll down to the webhook URL and copy the webhook URL to another place. Then, copy only the access token in the webhook URL. The access token format should be like this:

    https://oapi.dingtalk.com/robot/send?access\_token=<your\_access\_token>

    Save it to somewhere safe as we are going to need it later.

    Additionally, you can secure your robot by allowing keywords. Scroll down to Security Settings and check the Custom Keywords checkbox. From there, you can define the keywords allowlist yourself.

    We are finally done with the DingTalk setup, all that’s left is to set up Monika with the DingTalk webhook URL.

    Integrating Monika with DingTalk

    Now that we have our access token from DingTalk, it’s time to create a Monika configuration called monika.yml

    notifications:
    - id: dingtalk-notif
    type: dingtalk
    data:
    access_token: <your_access_token>
    probes:
    - id: '1'
    name: Hyperjump
    description: Landing page
    interval: 1
    requests:
    - method: GET
    url: 'http://localhost:3000/api/demo/status'
    alerts:
    - query: response.status != 200
    message: Status not 2xx

    Let me explain the configuration a little bit:

    • Monika will use DingTalk as their notification channel, using the access token from the previous step
    • Monika will probe http://localhost:3000/api/demo/status every one second
    • Monika will alert you if the response status code is not 200

    Once that’s done, run the monika.yml with the configuration above.

    Congratulations! You have successfully integrated Monika with DingTalk!

    PT Artha Rajamas Mandiri (Hyperjump) is an open-source-first company providing engineering excellence service. We aim to build and commercialize open-source tools to help companies streamline, simplify, and secure the most important aspects of its modern DevOps practices.

    Copyright © 2024 Hyperjump Tech. All Rights Reserved.

    \ No newline at end of file diff --git a/tutorial/run-using-google-chat-notification.html b/tutorial/run-using-google-chat-notification.html index 3db4e800a..f0db8639e 100644 --- a/tutorial/run-using-google-chat-notification.html +++ b/tutorial/run-using-google-chat-notification.html @@ -17,4 +17,4 @@ gtag('config', 'G-W999ZM71FP', { page_path: window.location.pathname, }); -

    Run using Google Chat notification

    Star (0)

    This tutorial will show you how to integrate Monika with Google Chat using Google Chat webhook so that you can get your Monika notifications through your Google Chat.

    Getting your Google Chat webhook

    To create your Google Chat webhook, you need to create a space. Go to the Google Chat page, and navigate to the bottom-left part of the page. In the “Spaces” section, click the plus icon and click Create Space. Fill out the space details and then click Create.

    After you created a new space, click the menu icon on the top-right of the page to minimize the sidebar. Then, click your space’s name and select the Manage Webhook menu.

    It should display a new popup to create a new incoming webhook. Fill out the incoming webhooks name and avatar URL (which is optional), and then click Save. Copy the webhook URL into somewhere else, as we are going to use it later.

    Integrating Monika with Google Chat

    Now that we have our Google Chat Webhook URL and installed Monika, it’s time to create a configuration called monika.yml:

    notifications:
    - id: unique-id-webhook
    type: google-chat
    data:
    url: <YOUR_GOOGLE_CHAT_WEBHOOK_URL>
    probes:
    - id: google_chat_test
    name: Google Chat Test
    description: Google Chat Notification Channel Test
    interval: 10
    requests:
    - method: GET
    url: https://reqres.in/api/users
    alerts:
    - query: response.status != 200
    message: Status code is not 200
    - query: response.time > 500
    message: Request took more than half a second

    Let me explain a little bit about this configuration:

    • You need to set the notification channel in the notifications object. There are 3 properties: id, type, and data. Set the id to any string values, as it is just an identifier. Then, set the type field to google-chat to set the notification channel to Google Chat. After that, put your Google Chat Webhook URL into the data.url field.
    • Monika will be probing https://reqres.in/api/users every ten seconds and will send you an alert if the response time is greater than half a second or the response status code is not 200.

    Now that we have our configuration ready, it’s time to run it with Monika. Go to the directory where you saved the Monika configuration, and run Monika straight away using monika -c monika.yml

    Congratulations! Now that you have successfully integrated Monika with Google Chat.

    PT Artha Rajamas Mandiri (Hyperjump) is an open-source-first company providing engineering excellence service. We aim to build and commercialize open-source tools to help companies streamline, simplify, and secure the most important aspects of its modern DevOps practices.

    Copyright © 2024 Hyperjump Tech. All Rights Reserved.

    \ No newline at end of file +

    Run using Google Chat notification

    Star (0)

    This tutorial will show you how to integrate Monika with Google Chat using Google Chat webhook so that you can get your Monika notifications through your Google Chat.

    Getting your Google Chat webhook

    To create your Google Chat webhook, you need to create a space. Go to the Google Chat page, and navigate to the bottom-left part of the page. In the “Spaces” section, click the plus icon and click Create Space. Fill out the space details and then click Create.

    After you created a new space, click the menu icon on the top-right of the page to minimize the sidebar. Then, click your space’s name and select the Manage Webhook menu.

    It should display a new popup to create a new incoming webhook. Fill out the incoming webhooks name and avatar URL (which is optional), and then click Save. Copy the webhook URL into somewhere else, as we are going to use it later.

    Integrating Monika with Google Chat

    Now that we have our Google Chat Webhook URL and installed Monika, it’s time to create a configuration called monika.yml:

    notifications:
    - id: unique-id-webhook
    type: google-chat
    data:
    url: <YOUR_GOOGLE_CHAT_WEBHOOK_URL>
    probes:
    - id: google_chat_test
    name: Google Chat Test
    description: Google Chat Notification Channel Test
    interval: 10
    requests:
    - method: GET
    url: https://reqres.in/api/users
    alerts:
    - query: response.status != 200
    message: Status code is not 200
    - query: response.time > 500
    message: Request took more than half a second

    Let me explain a little bit about this configuration:

    • You need to set the notification channel in the notifications object. There are 3 properties: id, type, and data. Set the id to any string values, as it is just an identifier. Then, set the type field to google-chat to set the notification channel to Google Chat. After that, put your Google Chat Webhook URL into the data.url field.
    • Monika will be probing https://reqres.in/api/users every ten seconds and will send you an alert if the response time is greater than half a second or the response status code is not 200.

    Now that we have our configuration ready, it’s time to run it with Monika. Go to the directory where you saved the Monika configuration, and run Monika straight away using monika -c monika.yml

    Congratulations! Now that you have successfully integrated Monika with Google Chat.

    PT Artha Rajamas Mandiri (Hyperjump) is an open-source-first company providing engineering excellence service. We aim to build and commercialize open-source tools to help companies streamline, simplify, and secure the most important aspects of its modern DevOps practices.

    Copyright © 2024 Hyperjump Tech. All Rights Reserved.

    \ No newline at end of file diff --git a/tutorial/run-using-mailgun-notification.html b/tutorial/run-using-mailgun-notification.html index 1f5951038..5ec1e069b 100644 --- a/tutorial/run-using-mailgun-notification.html +++ b/tutorial/run-using-mailgun-notification.html @@ -17,4 +17,4 @@ gtag('config', 'G-W999ZM71FP', { page_path: window.location.pathname, }); -

    Run using Mailgun Notification

    Star (0)

    This tutorial will show you how to integrate Monika with Mailgun so you can receive notifications from Monika straight to your email.

    Getting the Mailgun API Key

    To get the Mailgun API Key, you need to create an account first. Head to https://www.mailgun.com and proceed to create an account. After that, log in to your dashboard.

    After that, you need to configure your domain. Let’s assume that you are on the free tier. Click Sending, and click Domains. Then, click the first listed sandbox domain.

    You will be redirected to a page that asks you “How would you like to send your emails from <YOUR_SANDBOX_DOMAIN>?”. On that page, select the API method and you will see your API key. Copy your API key and your sandbox domain and save it somewhere else.

    Then, you need to add your email to the Authorized Recipients. On the same page, scroll down to see the Authorized Recipients section. Add your email for testing purposes, and verify your email.

    Now that the preparation has been done, it’s time to run Monika with Mailgun notification.

    Running Monika with Mailgun Notification

    Now that we have the Mailgun API Key, Sandbox Domain, set up the Authorized Recipients, and installed Monika, it’s time to create a configuration called monika.yml:

    notifications:
    - id: unique-id-mailgun
    type: mailgun
    data:
    recipients: ['YOUR_AUTHORIZED_RECIPIENTS_EMAIL']
    apiKey: YOUR_MAILGUN_API_KEY
    domain: YOUR_SANDBOX_DOMAIN
    probes:
    - id: test
    interval: 10
    requests:
    - url: https://reqres.in/api/users
    method: GET
    alerts:
    - query: response.time > 2000
    message: Response time is longer than two seconds

    Let me explain a little bit about this configuration:

    • You need to set the notification channel in the notifications object. There are 3 properties: id, type, and data. Set the id to any string values, as it is just an identifier. Then, set the type field to mailgun to use the Mailgun notification channel. After that, put your Mailgun API Key, recipients, and domain in the corresponding fields.
    • Monika will be probing https://reqres.in/api/users using the GET method every ten seconds and will send you an alert if the response time is longer than two seconds.

    Save the configuration as monika.yml. To run the Monika configuration, go to the directory where you saved the Monika configuration, and run Monika straight away using monika -c monika.yml

    It’s working!

    Congratulations! Now that you have successfully integrated Monika with Mailgun, you will be notified if your website is slow or down through your email!

    PT Artha Rajamas Mandiri (Hyperjump) is an open-source-first company providing engineering excellence service. We aim to build and commercialize open-source tools to help companies streamline, simplify, and secure the most important aspects of its modern DevOps practices.

    Copyright © 2024 Hyperjump Tech. All Rights Reserved.

    \ No newline at end of file +

    Run using Mailgun Notification

    Star (0)

    This tutorial will show you how to integrate Monika with Mailgun so you can receive notifications from Monika straight to your email.

    Getting the Mailgun API Key

    To get the Mailgun API Key, you need to create an account first. Head to https://www.mailgun.com and proceed to create an account. After that, log in to your dashboard.

    After that, you need to configure your domain. Let’s assume that you are on the free tier. Click Sending, and click Domains. Then, click the first listed sandbox domain.

    You will be redirected to a page that asks you “How would you like to send your emails from <YOUR_SANDBOX_DOMAIN>?”. On that page, select the API method and you will see your API key. Copy your API key and your sandbox domain and save it somewhere else.

    Then, you need to add your email to the Authorized Recipients. On the same page, scroll down to see the Authorized Recipients section. Add your email for testing purposes, and verify your email.

    Now that the preparation has been done, it’s time to run Monika with Mailgun notification.

    Running Monika with Mailgun Notification

    Now that we have the Mailgun API Key, Sandbox Domain, set up the Authorized Recipients, and installed Monika, it’s time to create a configuration called monika.yml:

    notifications:
    - id: unique-id-mailgun
    type: mailgun
    data:
    recipients: ['YOUR_AUTHORIZED_RECIPIENTS_EMAIL']
    apiKey: YOUR_MAILGUN_API_KEY
    domain: YOUR_SANDBOX_DOMAIN
    probes:
    - id: test
    interval: 10
    requests:
    - url: https://reqres.in/api/users
    method: GET
    alerts:
    - query: response.time > 2000
    message: Response time is longer than two seconds

    Let me explain a little bit about this configuration:

    • You need to set the notification channel in the notifications object. There are 3 properties: id, type, and data. Set the id to any string values, as it is just an identifier. Then, set the type field to mailgun to use the Mailgun notification channel. After that, put your Mailgun API Key, recipients, and domain in the corresponding fields.
    • Monika will be probing https://reqres.in/api/users using the GET method every ten seconds and will send you an alert if the response time is longer than two seconds.

    Save the configuration as monika.yml. To run the Monika configuration, go to the directory where you saved the Monika configuration, and run Monika straight away using monika -c monika.yml

    It’s working!

    Congratulations! Now that you have successfully integrated Monika with Mailgun, you will be notified if your website is slow or down through your email!

    PT Artha Rajamas Mandiri (Hyperjump) is an open-source-first company providing engineering excellence service. We aim to build and commercialize open-source tools to help companies streamline, simplify, and secure the most important aspects of its modern DevOps practices.

    Copyright © 2024 Hyperjump Tech. All Rights Reserved.

    \ No newline at end of file diff --git a/tutorial/run-using-microsoft-teams-notification.html b/tutorial/run-using-microsoft-teams-notification.html index 0efc48e36..61283d0a1 100644 --- a/tutorial/run-using-microsoft-teams-notification.html +++ b/tutorial/run-using-microsoft-teams-notification.html @@ -17,4 +17,4 @@ gtag('config', 'G-W999ZM71FP', { page_path: window.location.pathname, }); -

    Run using Microsoft Teams Notification

    Star (0)

    This tutorial will show you how to integrate Monika with Microsoft Teams using Incoming Webhook so that when there is a Monika incidents or recoveries alert, your team will be notified via existing Microsoft Teams channels. So, without further ado:

    Setup Microsoft Teams Incoming Webhook

    First things first, you need to have a team in Microsoft Teams. Download the Microsoft Teams app and create your user account. Then, follow the steps to create a new team. Now that we have our team ready, click the three dots on any channel in your team, and click Connectors.

    Inside the connectors dialog, find the Incoming Webhook connector, click Add, and click Add again. Then, open the Connectors menu again, and find the Incoming Webhook again. This time, click Configure. Fill out your Incoming Webhook name, change the logo, and click Create. You should see that there is a new webhook link available for you to use with Monika.

    Running Monika with Microsoft Teams Webhook

    Now that we have our Webhook URL, it’s time to create a configuration called monika.yml:

    notifications:
    - id: microsoft-teams
    type: teams
    data:
    url: <REPLACE_THIS_TO_YOUR_INCOMING_WEBHOOK_URL>
    probes:
    - id: sample_login
    name: Sample Login
    requests:
    - method: GET
    url: https://github.com
    alerts:
    - query: response.time > 800
    message: Github response time is {{ response.time }} ms, expecting less than 800ms
    - query: response.status != 200
    message: Github status code is not 200. Please check the service status!
    alerts:
    - query: response.time > 10000
    message: Please check your internet connection

    Let me explain a little bit about this configuration:

    • Monika is using the Microsoft Teams notification channel. You can change the notification channel by changing the type key to another value such as SMTP or WhatsApp. In the data object, there is only one key called url for your Webhook URL
    • Monika will be probing https://github.com and will send you an alert if the response time is greater than 500 milliseconds or the response status code is not 200, meaning the website is down
    • If by chance when probing Github the response time is larger than 10000 milliseconds, you will receive an alert about your internet connection.

    Now that we have our configuration ready, it’s time to run it with Monika. Go to the directory where you saved the Monika configuration, and run Monika straight away using monika -c monika.yml

    Congratulations! Now that you have successfully integrated Monika with Microsoft Teams, you will be notified immediately through Microsoft Teams if your website is slow or down!

    PT Artha Rajamas Mandiri (Hyperjump) is an open-source-first company providing engineering excellence service. We aim to build and commercialize open-source tools to help companies streamline, simplify, and secure the most important aspects of its modern DevOps practices.

    Copyright © 2024 Hyperjump Tech. All Rights Reserved.

    \ No newline at end of file +

    Run using Microsoft Teams Notification

    Star (0)

    This tutorial will show you how to integrate Monika with Microsoft Teams using Incoming Webhook so that when there is a Monika incidents or recoveries alert, your team will be notified via existing Microsoft Teams channels. So, without further ado:

    Setup Microsoft Teams Incoming Webhook

    First things first, you need to have a team in Microsoft Teams. Download the Microsoft Teams app and create your user account. Then, follow the steps to create a new team. Now that we have our team ready, click the three dots on any channel in your team, and click Connectors.

    Inside the connectors dialog, find the Incoming Webhook connector, click Add, and click Add again. Then, open the Connectors menu again, and find the Incoming Webhook again. This time, click Configure. Fill out your Incoming Webhook name, change the logo, and click Create. You should see that there is a new webhook link available for you to use with Monika.

    Running Monika with Microsoft Teams Webhook

    Now that we have our Webhook URL, it’s time to create a configuration called monika.yml:

    notifications:
    - id: microsoft-teams
    type: teams
    data:
    url: <REPLACE_THIS_TO_YOUR_INCOMING_WEBHOOK_URL>
    probes:
    - id: sample_login
    name: Sample Login
    requests:
    - method: GET
    url: https://github.com
    alerts:
    - query: response.time > 800
    message: Github response time is {{ response.time }} ms, expecting less than 800ms
    - query: response.status != 200
    message: Github status code is not 200. Please check the service status!
    alerts:
    - query: response.time > 10000
    message: Please check your internet connection

    Let me explain a little bit about this configuration:

    • Monika is using the Microsoft Teams notification channel. You can change the notification channel by changing the type key to another value such as SMTP or WhatsApp. In the data object, there is only one key called url for your Webhook URL
    • Monika will be probing https://github.com and will send you an alert if the response time is greater than 500 milliseconds or the response status code is not 200, meaning the website is down
    • If by chance when probing Github the response time is larger than 10000 milliseconds, you will receive an alert about your internet connection.

    Now that we have our configuration ready, it’s time to run it with Monika. Go to the directory where you saved the Monika configuration, and run Monika straight away using monika -c monika.yml

    Congratulations! Now that you have successfully integrated Monika with Microsoft Teams, you will be notified immediately through Microsoft Teams if your website is slow or down!

    PT Artha Rajamas Mandiri (Hyperjump) is an open-source-first company providing engineering excellence service. We aim to build and commercialize open-source tools to help companies streamline, simplify, and secure the most important aspects of its modern DevOps practices.

    Copyright © 2024 Hyperjump Tech. All Rights Reserved.

    \ No newline at end of file diff --git a/tutorial/run-using-monika-whatsapp-notifier-notification.html b/tutorial/run-using-monika-whatsapp-notifier-notification.html index ad25044cd..6d93277cd 100644 --- a/tutorial/run-using-monika-whatsapp-notifier-notification.html +++ b/tutorial/run-using-monika-whatsapp-notifier-notification.html @@ -17,4 +17,4 @@ gtag('config', 'G-W999ZM71FP', { page_path: window.location.pathname, }); -

    Run using WhatsApp Notifier

    Star (0)

    This tutorial, we will be sharing how to integrate Monika with Monika WhatsApp Notifier so that when there is a Monika incidents or recoveries alert, you will be notified via WhatsApp.

    Setup Monika Whatsapp Notifier

    First things first, you need to have a Monika WhatsApp Notifier webhook URL. Navigate to the https://whatsapp.hyperjump.tech and create your own webhook URL by inputting your name and phone number. After you submit the form, you will receive a notification to confirm your phone number.

    Click the link that you received to confirm your phone number. After that, you should receive your webhook URL and a guide to set up your WhatsApp Notifier.

    Save the Monika WhatsApp Notifier webhook URL to somewhere safe as we will need them later.

    Configuring Monika with Webhook

    Now that we have our Webhook URL, it’s time to create a configuration called monika.yml:

    notifications:
    - id: monika-notif
    type: monika-notif
    data:
    url: https://YOUR_MONIKA_NOTIF_URL
    probes:
    - id: sample_login
    name: Sample Login
    requests:
    - method: GET
    url: https://github.com
    alerts:
    - query: response.time > 500
    message: Github response time is {{ response.time }} ms, expecting less than 500ms
    - query: response.status != 200
    message: Github status code is not 200. Please check the service status!

    Let me explain a little bit about this configuration:

    • You need to set the notification channel in the notifications object. There are 3 properties: id, type, and data. Set idwith any string values, it’s just an identifier. Set type with monika-notif. Then put your WhatsApp notifier webhook URL in url key in the data object.
    • Monika will be probing https://github.com and will send you an alert if the response time is greater than 500 milliseconds or the response status code is not 200, meaning the website is down

    Now that we have our configuration ready, it’s time to run it with Monika. Go to the directory where you saved the Monika configuration, and run Monika straight away using monika -c monika.yml

    Congratulations! Now that you have successfully integrated Monika with Monika WhatsApp Notifier, you will be notified if your website is slow or down via WhatsApp.

    PT Artha Rajamas Mandiri (Hyperjump) is an open-source-first company providing engineering excellence service. We aim to build and commercialize open-source tools to help companies streamline, simplify, and secure the most important aspects of its modern DevOps practices.

    Copyright © 2024 Hyperjump Tech. All Rights Reserved.

    \ No newline at end of file +

    Run using WhatsApp Notifier

    Star (0)

    This tutorial, we will be sharing how to integrate Monika with Monika WhatsApp Notifier so that when there is a Monika incidents or recoveries alert, you will be notified via WhatsApp.

    Setup Monika Whatsapp Notifier

    First things first, you need to have a Monika WhatsApp Notifier webhook URL. Navigate to the https://whatsapp.hyperjump.tech and create your own webhook URL by inputting your name and phone number. After you submit the form, you will receive a notification to confirm your phone number.

    Click the link that you received to confirm your phone number. After that, you should receive your webhook URL and a guide to set up your WhatsApp Notifier.

    Save the Monika WhatsApp Notifier webhook URL to somewhere safe as we will need them later.

    Configuring Monika with Webhook

    Now that we have our Webhook URL, it’s time to create a configuration called monika.yml:

    notifications:
    - id: monika-notif
    type: monika-notif
    data:
    url: https://YOUR_MONIKA_NOTIF_URL
    probes:
    - id: sample_login
    name: Sample Login
    requests:
    - method: GET
    url: https://github.com
    alerts:
    - query: response.time > 500
    message: Github response time is {{ response.time }} ms, expecting less than 500ms
    - query: response.status != 200
    message: Github status code is not 200. Please check the service status!

    Let me explain a little bit about this configuration:

    • You need to set the notification channel in the notifications object. There are 3 properties: id, type, and data. Set idwith any string values, it’s just an identifier. Set type with monika-notif. Then put your WhatsApp notifier webhook URL in url key in the data object.
    • Monika will be probing https://github.com and will send you an alert if the response time is greater than 500 milliseconds or the response status code is not 200, meaning the website is down

    Now that we have our configuration ready, it’s time to run it with Monika. Go to the directory where you saved the Monika configuration, and run Monika straight away using monika -c monika.yml

    Congratulations! Now that you have successfully integrated Monika with Monika WhatsApp Notifier, you will be notified if your website is slow or down via WhatsApp.

    PT Artha Rajamas Mandiri (Hyperjump) is an open-source-first company providing engineering excellence service. We aim to build and commercialize open-source tools to help companies streamline, simplify, and secure the most important aspects of its modern DevOps practices.

    Copyright © 2024 Hyperjump Tech. All Rights Reserved.

    \ No newline at end of file diff --git a/tutorial/run-using-opsgenie-notification.html b/tutorial/run-using-opsgenie-notification.html index 9a2962697..910b12309 100644 --- a/tutorial/run-using-opsgenie-notification.html +++ b/tutorial/run-using-opsgenie-notification.html @@ -17,4 +17,4 @@ gtag('config', 'G-W999ZM71FP', { page_path: window.location.pathname, }); -

    Run using Opsgenie Notification

    Star (0)

    This tutorial will show you how to integrate Monika with Opsgenie to get your Monika notifications through the Opsgenie dashboard.

    Setup Opsgenie

    To use Opsgenie, you need to create an account on the Opsgenie website. After you have created your account, head over to the Teams menu in the Dashboard and create a Team.

    Now that you have created a team, go to the Integrations menu and click Add Integration. Then, select the API integration. You will be redirected to the API Key page. After that, copy the API Key and save it somewhere safe as we are going to need it later.

    Once that’s done, it’s time to configure Monika to integrate with Opsgenie.

    Integrate Monika with Opsgenie

    Now that we have our API Key from Opsgenie, it’s time to create a Monika configuration called monika.yml

    notifications:
    - id: unique-id-opsgenie
    type: opsgenie
    data:
    geniekey: <YOUR_API_KEY>
    probes:
    - id: "1"
    name: Localhost
    description: Check status
    interval: 3
    requests:
    - method: GET
    url: https://httpbin.org/delay/2500
    alerts:
    - query: response.time > 2000
    message: Response time more than 2 seconds
    - query: response.status != 200
    message: Status not 2xx

    Let’s take a look at the configuration above:

    • The Pushover notification channel will use the API Token and User Key you created from the previous step.
    • It will probe https://httpbin.org/delay/2500, with the method GET
    • It will alert you if the response status code is not 200, or the response time is longer than two seconds

    Once that’s done, run Monika with the configuration above with the command monika -c monika.yml

    Congratulations! You have successfully integrated Monika with Opsgenie! Note that Opsgenie integration is only available from the Monika version 1.8.0++

    PT Artha Rajamas Mandiri (Hyperjump) is an open-source-first company providing engineering excellence service. We aim to build and commercialize open-source tools to help companies streamline, simplify, and secure the most important aspects of its modern DevOps practices.

    Copyright © 2024 Hyperjump Tech. All Rights Reserved.

    \ No newline at end of file +

    Run using Opsgenie Notification

    Star (0)

    This tutorial will show you how to integrate Monika with Opsgenie to get your Monika notifications through the Opsgenie dashboard.

    Setup Opsgenie

    To use Opsgenie, you need to create an account on the Opsgenie website. After you have created your account, head over to the Teams menu in the Dashboard and create a Team.

    Now that you have created a team, go to the Integrations menu and click Add Integration. Then, select the API integration. You will be redirected to the API Key page. After that, copy the API Key and save it somewhere safe as we are going to need it later.

    Once that’s done, it’s time to configure Monika to integrate with Opsgenie.

    Integrate Monika with Opsgenie

    Now that we have our API Key from Opsgenie, it’s time to create a Monika configuration called monika.yml

    notifications:
    - id: unique-id-opsgenie
    type: opsgenie
    data:
    geniekey: <YOUR_API_KEY>
    probes:
    - id: "1"
    name: Localhost
    description: Check status
    interval: 3
    requests:
    - method: GET
    url: https://httpbin.org/delay/2500
    alerts:
    - query: response.time > 2000
    message: Response time more than 2 seconds
    - query: response.status != 200
    message: Status not 2xx

    Let’s take a look at the configuration above:

    • The Pushover notification channel will use the API Token and User Key you created from the previous step.
    • It will probe https://httpbin.org/delay/2500, with the method GET
    • It will alert you if the response status code is not 200, or the response time is longer than two seconds

    Once that’s done, run Monika with the configuration above with the command monika -c monika.yml

    Congratulations! You have successfully integrated Monika with Opsgenie! Note that Opsgenie integration is only available from the Monika version 1.8.0++

    PT Artha Rajamas Mandiri (Hyperjump) is an open-source-first company providing engineering excellence service. We aim to build and commercialize open-source tools to help companies streamline, simplify, and secure the most important aspects of its modern DevOps practices.

    Copyright © 2024 Hyperjump Tech. All Rights Reserved.

    \ No newline at end of file diff --git a/tutorial/run-using-ping-method.html b/tutorial/run-using-ping-method.html index ca51adf47..d0db96622 100644 --- a/tutorial/run-using-ping-method.html +++ b/tutorial/run-using-ping-method.html @@ -17,4 +17,4 @@ gtag('config', 'G-W999ZM71FP', { page_path: window.location.pathname, }); -

    Run using Ping Method

    Star (0)

    This tutorial will show you how to integrate Monika with Ping Method to get your Monika notifications.

    Installing Monika

    Install Monika via npm install -g @hyperjumptech/monika or if you don’t have NPM in your system, you can download the prebuilt binary from our release page. After installing Monika, run monika -v to verify your Monika installation.

    Preparing a configuration

    Now that we have installed Monika, let’s prepare a configuration:

    notifications:
    - id: desktop
    type: desktop
    probes:
    - id: ping_test
    name: ping_test
    description: requesting icmp ping
    interval: 10
    ping:
    - uri: google.com

    Let me explain this configuration a little bit:

    • This configuration uses Desktop notifications
    • This probe configuration will hit google.com using PING
    • This probe configuration will alert you if ping request is not successful (200), or the request took longer than two seconds

    Save the configuration above as monika.yaml in your local machine and run monika -c monika.yaml command in your terminal inside the directory where you saved the configuration file.

    We’re not finished yet. We want to know what will happen if we failed to PING Google. Let Monika run in the background, and try to disconnect yourself from the internet. You will get a notification:

    There is some explanation for the error message:

    • 0: ‘URI not found’
    • 1: ‘Connection reset’
    • 2: ‘Connection refused’
    • 3: ‘Unknown error’
    • 4: ‘Ping timed out’
    • 599: ‘Request Timed out’

    It shows PING timed out because your internet is disconnected. So, we could distinguish which alerts come from the API itself, and which alerts come from your internet problem.

    PT Artha Rajamas Mandiri (Hyperjump) is an open-source-first company providing engineering excellence service. We aim to build and commercialize open-source tools to help companies streamline, simplify, and secure the most important aspects of its modern DevOps practices.

    Copyright © 2024 Hyperjump Tech. All Rights Reserved.

    \ No newline at end of file +

    Run using Ping Method

    Star (0)

    This tutorial will show you how to integrate Monika with Ping Method to get your Monika notifications.

    Installing Monika

    Install Monika via npm install -g @hyperjumptech/monika or if you don’t have NPM in your system, you can download the prebuilt binary from our release page. After installing Monika, run monika -v to verify your Monika installation.

    Preparing a configuration

    Now that we have installed Monika, let’s prepare a configuration:

    notifications:
    - id: desktop
    type: desktop
    probes:
    - id: ping_test
    name: ping_test
    description: requesting icmp ping
    interval: 10
    ping:
    - uri: google.com

    Let me explain this configuration a little bit:

    • This configuration uses Desktop notifications
    • This probe configuration will hit google.com using PING
    • This probe configuration will alert you if ping request is not successful (200), or the request took longer than two seconds

    Save the configuration above as monika.yaml in your local machine and run monika -c monika.yaml command in your terminal inside the directory where you saved the configuration file.

    We’re not finished yet. We want to know what will happen if we failed to PING Google. Let Monika run in the background, and try to disconnect yourself from the internet. You will get a notification:

    There is some explanation for the error message:

    • 0: ‘URI not found’
    • 1: ‘Connection reset’
    • 2: ‘Connection refused’
    • 3: ‘Unknown error’
    • 4: ‘Ping timed out’
    • 599: ‘Request Timed out’

    It shows PING timed out because your internet is disconnected. So, we could distinguish which alerts come from the API itself, and which alerts come from your internet problem.

    PT Artha Rajamas Mandiri (Hyperjump) is an open-source-first company providing engineering excellence service. We aim to build and commercialize open-source tools to help companies streamline, simplify, and secure the most important aspects of its modern DevOps practices.

    Copyright © 2024 Hyperjump Tech. All Rights Reserved.

    \ No newline at end of file diff --git a/tutorial/run-using-pushover-notification.html b/tutorial/run-using-pushover-notification.html index 7dfb2b3fc..edc4150de 100644 --- a/tutorial/run-using-pushover-notification.html +++ b/tutorial/run-using-pushover-notification.html @@ -17,4 +17,4 @@ gtag('config', 'G-W999ZM71FP', { page_path: window.location.pathname, }); -

    Run using Pushover Notification

    Star (0)

    This tutorial will show you how to integrate Monika with Pushover to get your Monika notifications through your Pushover clients.

    Setup Pushover

    To use Pushover with Monika, head to https://pushover.net and create an account. Then, you need to confirm your email. After that, log in to the dashboard and pay attention to the “Your User Key”. Save the user key to a safe place as we are going to need it later.

    Then, scroll down to the bottom of the page. Click the Create a new Application/API Token. Fill out the forms, and click Create Application. You should see your API Token/Key. Save the token to a safe place as we are going to need it later.

    After you created the API Token, go back to the main Dashboard. Then, click the Add Phone, Tablet, or Desktop. For this case, use the Pushover for Desktop. Then, enter your Device Name and click Register Web Browser. You will be redirected to your created Pushover desktop client.

    Once that’s done, it’s time to configure Monika to integrate with the Pushover desktop client.

    Integrate Monika with Pushover

    Now that we have our User and API Token from Pushover, it’s time to create a Monika configuration called monika.yml

    notifications:
    - id: pushover-notification
    type: pushover
    data:
    token: <YOUR_PUSHOVER_API_TOKEN>
    user: <YOUR_PUSHOVER_USER_KEY>
    probes:
    - id: 6a31bcff-48f1-40b0-98aa-8c7610f4f428
    name: Localhost
    description: ''
    requests:
    - url: http://localhost:8080/health
    method: GET
    headers: {}
    body: '{}'
    timeout: 0
    alerts:
    - query: response.status < 200 or response.status > 299
    message: HTTP Status is not 200
    - query: response.time > 2000
    message: Response time is more than 2000ms

    Let’s take a look at the configuration above:

    • The Pushover notification channel will use the API Token and User Key you created from the previous step.
    • It will probe http://localhost:8080/health, with the method GET
    • It will alert you if the response status code is not 200, or the response time is longer than two seconds

    Once that’s done, run Monika with the configuration above with the command monika -c monika.yml

    Congratulations! You have successfully integrated Monika with Pushover! Note that Pushover integration is only available from the Monika version 1.8.0.

    PT Artha Rajamas Mandiri (Hyperjump) is an open-source-first company providing engineering excellence service. We aim to build and commercialize open-source tools to help companies streamline, simplify, and secure the most important aspects of its modern DevOps practices.

    Copyright © 2024 Hyperjump Tech. All Rights Reserved.

    \ No newline at end of file +

    Run using Pushover Notification

    Star (0)

    This tutorial will show you how to integrate Monika with Pushover to get your Monika notifications through your Pushover clients.

    Setup Pushover

    To use Pushover with Monika, head to https://pushover.net and create an account. Then, you need to confirm your email. After that, log in to the dashboard and pay attention to the “Your User Key”. Save the user key to a safe place as we are going to need it later.

    Then, scroll down to the bottom of the page. Click the Create a new Application/API Token. Fill out the forms, and click Create Application. You should see your API Token/Key. Save the token to a safe place as we are going to need it later.

    After you created the API Token, go back to the main Dashboard. Then, click the Add Phone, Tablet, or Desktop. For this case, use the Pushover for Desktop. Then, enter your Device Name and click Register Web Browser. You will be redirected to your created Pushover desktop client.

    Once that’s done, it’s time to configure Monika to integrate with the Pushover desktop client.

    Integrate Monika with Pushover

    Now that we have our User and API Token from Pushover, it’s time to create a Monika configuration called monika.yml

    notifications:
    - id: pushover-notification
    type: pushover
    data:
    token: <YOUR_PUSHOVER_API_TOKEN>
    user: <YOUR_PUSHOVER_USER_KEY>
    probes:
    - id: 6a31bcff-48f1-40b0-98aa-8c7610f4f428
    name: Localhost
    description: ''
    requests:
    - url: http://localhost:8080/health
    method: GET
    headers: {}
    body: '{}'
    timeout: 0
    alerts:
    - query: response.status < 200 or response.status > 299
    message: HTTP Status is not 200
    - query: response.time > 2000
    message: Response time is more than 2000ms

    Let’s take a look at the configuration above:

    • The Pushover notification channel will use the API Token and User Key you created from the previous step.
    • It will probe http://localhost:8080/health, with the method GET
    • It will alert you if the response status code is not 200, or the response time is longer than two seconds

    Once that’s done, run Monika with the configuration above with the command monika -c monika.yml

    Congratulations! You have successfully integrated Monika with Pushover! Note that Pushover integration is only available from the Monika version 1.8.0.

    PT Artha Rajamas Mandiri (Hyperjump) is an open-source-first company providing engineering excellence service. We aim to build and commercialize open-source tools to help companies streamline, simplify, and secure the most important aspects of its modern DevOps practices.

    Copyright © 2024 Hyperjump Tech. All Rights Reserved.

    \ No newline at end of file diff --git a/tutorial/run-using-slack-notification.html b/tutorial/run-using-slack-notification.html index 3f61b3bf1..c05aeacd3 100644 --- a/tutorial/run-using-slack-notification.html +++ b/tutorial/run-using-slack-notification.html @@ -17,4 +17,4 @@ gtag('config', 'G-W999ZM71FP', { page_path: window.location.pathname, }); -

    Run using Slack Notification

    Star (0)

    This tutorial, I will be sharing how to integrate Monika with Slack. You can integrate Monika with Slack using Incoming Webhook so that when there is a Monika incidents or recoveries alert, your team will be notified via existing Slack channels.

    Setup Webhook with Slack

    First things first, you need to have a Slack workspace. Create your user account on their website and follow their steps to create a new workspace. Now that we have our workspace ready, head to the Browse Slack and select Apps. Search for an app called Incoming Webhooks.

    Click Add and you will be redirected to the setup page. Click the Add to Slack button. You will be asked which channels you want to connect with Monika. As an example, I used the #monika-notification channel. After you have selected your channel, click Add Incoming Webhooks Integration button. You should see that your Webhook URL is ready to use.

    Configuring Monika with Webhook

    Now that we have our Webhook URL, it’s time to create a configuration called monika.yml:

    notifications:
    - id: slack
    type: slack
    data:
    url: <REPLACE_THIS_TO_YOUR_INCOMING_WEBHOOK_URL>
    probes:
    - id: sample_login
    name: Sample Login
    requests:
    - method: GET
    url: https://github.com
    alerts:
    - query: response.time > 500
    message: Github response time is {{ response.time }} ms, expecting less than 500ms
    - query: response.status != 200
    message: Github status code is not 200. Please check the service status!
    alerts:
    - query: response.time > 10000
    message: Please check your internet connection

    Let me explain a little bit about this configuration:

    • Monika is using the Slack notification channel. You can change the notification channel by changing type key to another value such as SMTP or WhatsApp. In the data object, there is only one key called url for your Webhook URL
    • Monika will be probing https://github.com and will send you an alert if the response time is greater than 500 milliseconds or the response status code is not 200, meaning the website is down
    • If by chance when probing Github the response time is larger than 10000 milliseconds, you will receive an alert about your internet connection.

    Now that we have our configuration ready, it’s time to run it with Monika. Go to the directory where you saved the Monika configuration, and run Monika straight away using monika -c monika.yml

    Congratulations! Now that you have successfully integrated Monika with Slack, you will be notified if your website is slow or down!

    PT Artha Rajamas Mandiri (Hyperjump) is an open-source-first company providing engineering excellence service. We aim to build and commercialize open-source tools to help companies streamline, simplify, and secure the most important aspects of its modern DevOps practices.

    Copyright © 2024 Hyperjump Tech. All Rights Reserved.

    \ No newline at end of file +

    Run using Slack Notification

    Star (0)

    This tutorial, I will be sharing how to integrate Monika with Slack. You can integrate Monika with Slack using Incoming Webhook so that when there is a Monika incidents or recoveries alert, your team will be notified via existing Slack channels.

    Setup Webhook with Slack

    First things first, you need to have a Slack workspace. Create your user account on their website and follow their steps to create a new workspace. Now that we have our workspace ready, head to the Browse Slack and select Apps. Search for an app called Incoming Webhooks.

    Click Add and you will be redirected to the setup page. Click the Add to Slack button. You will be asked which channels you want to connect with Monika. As an example, I used the #monika-notification channel. After you have selected your channel, click Add Incoming Webhooks Integration button. You should see that your Webhook URL is ready to use.

    Configuring Monika with Webhook

    Now that we have our Webhook URL, it’s time to create a configuration called monika.yml:

    notifications:
    - id: slack
    type: slack
    data:
    url: <REPLACE_THIS_TO_YOUR_INCOMING_WEBHOOK_URL>
    probes:
    - id: sample_login
    name: Sample Login
    requests:
    - method: GET
    url: https://github.com
    alerts:
    - query: response.time > 500
    message: Github response time is {{ response.time }} ms, expecting less than 500ms
    - query: response.status != 200
    message: Github status code is not 200. Please check the service status!
    alerts:
    - query: response.time > 10000
    message: Please check your internet connection

    Let me explain a little bit about this configuration:

    • Monika is using the Slack notification channel. You can change the notification channel by changing type key to another value such as SMTP or WhatsApp. In the data object, there is only one key called url for your Webhook URL
    • Monika will be probing https://github.com and will send you an alert if the response time is greater than 500 milliseconds or the response status code is not 200, meaning the website is down
    • If by chance when probing Github the response time is larger than 10000 milliseconds, you will receive an alert about your internet connection.

    Now that we have our configuration ready, it’s time to run it with Monika. Go to the directory where you saved the Monika configuration, and run Monika straight away using monika -c monika.yml

    Congratulations! Now that you have successfully integrated Monika with Slack, you will be notified if your website is slow or down!

    PT Artha Rajamas Mandiri (Hyperjump) is an open-source-first company providing engineering excellence service. We aim to build and commercialize open-source tools to help companies streamline, simplify, and secure the most important aspects of its modern DevOps practices.

    Copyright © 2024 Hyperjump Tech. All Rights Reserved.

    \ No newline at end of file diff --git a/tutorial/run-using-smtp-notification.html b/tutorial/run-using-smtp-notification.html index 85c056504..28f490601 100644 --- a/tutorial/run-using-smtp-notification.html +++ b/tutorial/run-using-smtp-notification.html @@ -17,4 +17,4 @@ gtag('config', 'G-W999ZM71FP', { page_path: window.location.pathname, }); -

    Run using SMTP Notification

    Star (0)

    This tutorial will show you how to integrate Monika with SMTP so you can receive notifications from Monika straight to your email.

    Configuring the SMTP notification channel

    In order to start using Google Mail as your Monika notification channel, you need to prepare these:

    1. One Google Mail Account
    2. A Monika configuration
    3. Patience

    First, go to the Less secure app access section of your Google Account. You might need to sign in first using your Google account. Then, turn on the “Allow less secure apps” like so:

    Now that we enabled the ‘Allow less secure apps’ option, it is time to create a Monika configuration. As an example, let’s use a configuration from our previous article: Be alerted when your authentication API is slow with Monika: A guide for chaining request

    The configuration above will hit the /login endpoint with a JSON request body and hit an API using the token from the previous request’s response in the Authorization header. If you look closely in the notifications block, it only shows you desktop notifications when an alert is triggered. What we are going to do is to add a new notification channel, which is SMTP. Here is an example of an SMTP notification block:

    \- id: unique-id-smtp
    type: smtp
    data:
    recipients: \[RECIPIENT\_EMAIL\_ADDRESS\]
    hostname: smtp.mail.com
    port: 587
    username: SMTP\_USERNAME
    password: SMTP\_PASSWORD
    • ID: Notification channel unique ID
    • Type: Notification type (e.g smtp, desktop, etc.)
    • Recipients: An array of email addresses that will receive the e-mail from Monika (e.g ["monika@gmail.com", "symon@gmail.com"] )
    • Hostname: The SMTP host that you will use for sending the email, in this case smtp.gmail.com as we are going to be using Google Mail SMTP
    • Port: The port allowed to be used for sending mail in your SMTP host. Google Mail suggested that we use port 465 or 587
    • Username: Your SMTP username. Use your existing Google Mail email address
    • Password: Your SMTP password. Use your existing Google Mail password. If you have activated 2-Factor-Authentication (2FA), you need to create an App Password from your Account Settings and then use the app password.

    Now that we know the structure of the SMTP notification block, it’s time to update our Monika configuration:

    notifications:
    - id: unique-id-smtp
    type: smtp
    data:
    recipients: ["recipient-1@example.com", "recipient-2@example.com"]
    hostname: smtp.gmail.com
    port: 587
    username: denny@example.com
    password: p455w0rd
    probes:
    - id: sample_login
    name: Sample Login
    requests:
    - method: POST
    url: https://reqres.in/api/login
    body:
    email: "eve.holt@reqres.in"
    password: "cityslicka"
    headers:
    Content-Type: application/json
    alerts:
    - query: response.time > 600
    message: Login API Response time is {{ response.time }} ms, expecting less than 60>
    - query: response.status != 200
    message: Login API Status code is not 200. Please check the service status!
    - method: GET
    url: https://reqres.in/api/users/2
    headers:
    Authorization: Bearer {{ response.[0].data.token }}
    alerts:
    - query: response.time > 500
    message: Get User API Response time is {{ response.time }} ms, expecting less than>
    - query: response.status != 200
    message: Get User API Status code is not 200. Please check the service status!
    alerts:
    - query: response.time > 10000
    message: Please check your internet connection

    Save the configuration file as monika.yml and run the configuration. When an alert is triggered, it should send a recovery or incident email to the recipients you have configured.

    Congratulations! You can now send the alert notification using Google Mail SMTP!

    PT Artha Rajamas Mandiri (Hyperjump) is an open-source-first company providing engineering excellence service. We aim to build and commercialize open-source tools to help companies streamline, simplify, and secure the most important aspects of its modern DevOps practices.

    Copyright © 2024 Hyperjump Tech. All Rights Reserved.

    \ No newline at end of file +

    Run using SMTP Notification

    Star (0)

    This tutorial will show you how to integrate Monika with SMTP so you can receive notifications from Monika straight to your email.

    Configuring the SMTP notification channel

    In order to start using Google Mail as your Monika notification channel, you need to prepare these:

    1. One Google Mail Account
    2. A Monika configuration
    3. Patience

    First, go to the Less secure app access section of your Google Account. You might need to sign in first using your Google account. Then, turn on the “Allow less secure apps” like so:

    Now that we enabled the ‘Allow less secure apps’ option, it is time to create a Monika configuration. As an example, let’s use a configuration from our previous article: Be alerted when your authentication API is slow with Monika: A guide for chaining request

    The configuration above will hit the /login endpoint with a JSON request body and hit an API using the token from the previous request’s response in the Authorization header. If you look closely in the notifications block, it only shows you desktop notifications when an alert is triggered. What we are going to do is to add a new notification channel, which is SMTP. Here is an example of an SMTP notification block:

    \- id: unique-id-smtp
    type: smtp
    data:
    recipients: \[RECIPIENT\_EMAIL\_ADDRESS\]
    hostname: smtp.mail.com
    port: 587
    username: SMTP\_USERNAME
    password: SMTP\_PASSWORD
    • ID: Notification channel unique ID
    • Type: Notification type (e.g smtp, desktop, etc.)
    • Recipients: An array of email addresses that will receive the e-mail from Monika (e.g ["monika@gmail.com", "symon@gmail.com"] )
    • Hostname: The SMTP host that you will use for sending the email, in this case smtp.gmail.com as we are going to be using Google Mail SMTP
    • Port: The port allowed to be used for sending mail in your SMTP host. Google Mail suggested that we use port 465 or 587
    • Username: Your SMTP username. Use your existing Google Mail email address
    • Password: Your SMTP password. Use your existing Google Mail password. If you have activated 2-Factor-Authentication (2FA), you need to create an App Password from your Account Settings and then use the app password.

    Now that we know the structure of the SMTP notification block, it’s time to update our Monika configuration:

    notifications:
    - id: unique-id-smtp
    type: smtp
    data:
    recipients: ["recipient-1@example.com", "recipient-2@example.com"]
    hostname: smtp.gmail.com
    port: 587
    username: denny@example.com
    password: p455w0rd
    probes:
    - id: sample_login
    name: Sample Login
    requests:
    - method: POST
    url: https://reqres.in/api/login
    body:
    email: "eve.holt@reqres.in"
    password: "cityslicka"
    headers:
    Content-Type: application/json
    alerts:
    - query: response.time > 600
    message: Login API Response time is {{ response.time }} ms, expecting less than 60>
    - query: response.status != 200
    message: Login API Status code is not 200. Please check the service status!
    - method: GET
    url: https://reqres.in/api/users/2
    headers:
    Authorization: Bearer {{ response.[0].data.token }}
    alerts:
    - query: response.time > 500
    message: Get User API Response time is {{ response.time }} ms, expecting less than>
    - query: response.status != 200
    message: Get User API Status code is not 200. Please check the service status!
    alerts:
    - query: response.time > 10000
    message: Please check your internet connection

    Save the configuration file as monika.yml and run the configuration. When an alert is triggered, it should send a recovery or incident email to the recipients you have configured.

    Congratulations! You can now send the alert notification using Google Mail SMTP!

    PT Artha Rajamas Mandiri (Hyperjump) is an open-source-first company providing engineering excellence service. We aim to build and commercialize open-source tools to help companies streamline, simplify, and secure the most important aspects of its modern DevOps practices.

    Copyright © 2024 Hyperjump Tech. All Rights Reserved.

    \ No newline at end of file diff --git a/tutorial/run-using-telegram-notification.html b/tutorial/run-using-telegram-notification.html index 3673d0d86..34ea9ec07 100644 --- a/tutorial/run-using-telegram-notification.html +++ b/tutorial/run-using-telegram-notification.html @@ -17,4 +17,4 @@ gtag('config', 'G-W999ZM71FP', { page_path: window.location.pathname, }); -

    Run using Telegram Notification

    Star (0)

    This tutorial, we will be sharing how to integrate Monika with Telegram bots so that when there are Monika incidents or recoveries, you will be notified on your Telegram group.

    Set up the Telegram bot

    First, you need a Telegram account. Head over to https://web.telegram.org to create your account. And then, create a new private chat. Search for an account named “BotFather”. After that, do these steps below:

    • Type /newbot and press Enter to create a new bot.
    • You will be prompted by BotFather to name your bot. Let’s call it anything you like, such as “Monika Bot”, “Rise and Shine Bot”, or “Open your laptop now! Bot”. The more urgent it sounds, the better! Type your bot name and press Enter.
    • After that, you will be prompted by BotFather to enter your bot username. You may see an error because your bot username has been taken by someone else. Type your bot username and press Enter again.
    • If you have selected your bot username, you will receive your bot token. Save the token elsewhere as we are going to need them later.

    Now the next step is to create a group for the Monika notifications. Create a group in Telegram, and invite your bots into the group. Then, set your bot to be a group administrator.

    Now that we have our bot API key and set our bot to be a group administrator, all we need to do is to get the group ID. Invite a new bot to the group called @RawDataBot into your group to get the group ID.

    After you have successfully invited the Telegram Bot Raw, you will see the group ID. Save the group ID to somewhere else and don’t forget to kick the Telegram Bot Raw from your group. Now that we have the group ID and bot token, it’s time to integrate it with Monika.

    Integrate Telegram with Monika

    Now that we have our Webhook URL, it’s time to create a configuration called monika.yml:

    notifications:
    - id: 12f3e1df-3222-4a79-b931-146f964be711
    type: telegram
    data:
    group_id: "<group_id>"
    bot_token: <bot_token>
    probes:
    - id: 48c828bb-b761-41e7-b360-ba0692ded184
    name: ''
    requests:
    - url: https://github.com
    body: {}
    timeout: 10000
    alerts: []

    Let me explain a little bit about this configuration:

    • You need to set the notification channel in the notifications object. There are 3 properties: id, type, and data. Set the id to any string values, as it is just an identifier. Then, set the type to telegram to set the notification channel to Telegram. After that, put your group ID and bot token notifier webhook URL in group_id and bot_token keys in the data object.
    • Monika will be probing https://github.com and will send you an alert if the response time is greater than two seconds or the response status code is not 200, meaning the website is down five times.

    Now that we have our configuration ready, it’s time to run it with Monika. Go to the directory where you saved the Monika configuration, and run Monika straight away using monika -c monika.yml

    Congratulations! Now that you have successfully integrated Monika with Telegram, you will be notified if your website is slow or down.

    PT Artha Rajamas Mandiri (Hyperjump) is an open-source-first company providing engineering excellence service. We aim to build and commercialize open-source tools to help companies streamline, simplify, and secure the most important aspects of its modern DevOps practices.

    Copyright © 2024 Hyperjump Tech. All Rights Reserved.

    \ No newline at end of file +

    Run using Telegram Notification

    Star (0)

    This tutorial, we will be sharing how to integrate Monika with Telegram bots so that when there are Monika incidents or recoveries, you will be notified on your Telegram group.

    Set up the Telegram bot

    First, you need a Telegram account. Head over to https://web.telegram.org to create your account. And then, create a new private chat. Search for an account named “BotFather”. After that, do these steps below:

    • Type /newbot and press Enter to create a new bot.
    • You will be prompted by BotFather to name your bot. Let’s call it anything you like, such as “Monika Bot”, “Rise and Shine Bot”, or “Open your laptop now! Bot”. The more urgent it sounds, the better! Type your bot name and press Enter.
    • After that, you will be prompted by BotFather to enter your bot username. You may see an error because your bot username has been taken by someone else. Type your bot username and press Enter again.
    • If you have selected your bot username, you will receive your bot token. Save the token elsewhere as we are going to need them later.

    Now the next step is to create a group for the Monika notifications. Create a group in Telegram, and invite your bots into the group. Then, set your bot to be a group administrator.

    Now that we have our bot API key and set our bot to be a group administrator, all we need to do is to get the group ID. Invite a new bot to the group called @RawDataBot into your group to get the group ID.

    After you have successfully invited the Telegram Bot Raw, you will see the group ID. Save the group ID to somewhere else and don’t forget to kick the Telegram Bot Raw from your group. Now that we have the group ID and bot token, it’s time to integrate it with Monika.

    Integrate Telegram with Monika

    Now that we have our Webhook URL, it’s time to create a configuration called monika.yml:

    notifications:
    - id: 12f3e1df-3222-4a79-b931-146f964be711
    type: telegram
    data:
    group_id: "<group_id>"
    bot_token: <bot_token>
    probes:
    - id: 48c828bb-b761-41e7-b360-ba0692ded184
    name: ''
    requests:
    - url: https://github.com
    body: {}
    timeout: 10000
    alerts: []

    Let me explain a little bit about this configuration:

    • You need to set the notification channel in the notifications object. There are 3 properties: id, type, and data. Set the id to any string values, as it is just an identifier. Then, set the type to telegram to set the notification channel to Telegram. After that, put your group ID and bot token notifier webhook URL in group_id and bot_token keys in the data object.
    • Monika will be probing https://github.com and will send you an alert if the response time is greater than two seconds or the response status code is not 200, meaning the website is down five times.

    Now that we have our configuration ready, it’s time to run it with Monika. Go to the directory where you saved the Monika configuration, and run Monika straight away using monika -c monika.yml

    Congratulations! Now that you have successfully integrated Monika with Telegram, you will be notified if your website is slow or down.

    PT Artha Rajamas Mandiri (Hyperjump) is an open-source-first company providing engineering excellence service. We aim to build and commercialize open-source tools to help companies streamline, simplify, and secure the most important aspects of its modern DevOps practices.

    Copyright © 2024 Hyperjump Tech. All Rights Reserved.

    \ No newline at end of file diff --git a/tutorial/run-with-gmail-notification.html b/tutorial/run-with-gmail-notification.html index 221d55bec..83bc16b45 100644 --- a/tutorial/run-with-gmail-notification.html +++ b/tutorial/run-with-gmail-notification.html @@ -17,7 +17,7 @@ gtag('config', 'G-W999ZM71FP', { page_path: window.location.pathname, }); -

    Run with GMail Notification

    Star (0)
    1. Create a monika.yml file and fill it out with the following
    notifications:
    - id: unique-id-smtp
    type: smtp
    data:
    recipients:
    - YOUR_EMAIL_ADDRESS_HERE
    hostname: smtp.gmail.com
    port: 587
    username: YOUR_GMAIL_ACCOUNT
    password: YOUR_GMAIL_PASSWORD_OR_APP_PASSWORD
    probes:
    - id: '1'
    name: Monika Landing Page
    description: Landing page of awesome Monika
    interval: 10 # in seconds
    requests:
    - url: https://hyperjumptech.github.io/monika
    timeout: 7000 # in milliseconds
    alerts:
    - status-not-2xx
    1. Replace YOUR_EMAIL_ADDRESS_HERE in the monika.yml with your email address that will receive the notification.

    2. Replace YOUR_GMAIL_ACCOUNT with your valid Gmail account, e.g., yourname@gmail.com.

    3. Replace YOUR_GMAIL_PASSWORD_OR_APP_PASSWORD with your Gmail password.

      1. If you have activated Two Factor Authentication (2FA), you need to create an app password. Refer here to create an app password for your Gmail account.
    4. If you have installed Monika globally, run monika from Terminal app (macOS) in the same directory where monika.yml exists. If you haven't, you can quickly run Monika by running npx @hyperjumptech/monika in the same directory where monika.yml exists.

    5. During runtime, Monika will output a log that looks like this

      INFO (on x1): Starting Monika. Probes: 4. Notifications: 1
    INFO: 2021-06-16T04:14:40.128Z 1 id:5 200 http://localhost:7001/health 7ms
    INFO: 2021-06-16T04:14:45.109Z 2 id:5 200 http://localhost:7001/health 4ms
    INFO: 2021-06-16T04:14:50.126Z 3 id:5 200 http://localhost:7001/health 10ms
    INFO: 2021-06-16T04:14:55.107Z 4 id:5 200 http://localhost:7001/health 1ms
    WARN: 2021-06-16T04:15:00.117Z 5 id:5 500 http://localhost:7001/health 0ms, ALERT: status-not-2xx
    WARN: 2021-06-16T04:15:05.371Z 6 id:5 500 http://localhost:7001/health 0ms, ALERT: status-not-2xx
    WARN: 2021-06-16T04:15:10.128Z 7 id:5 500 http://localhost:7001/health 0ms, ALERT: status-not-2xx
    WARN: 2021-06-16T04:15:15.138Z 8 id:5 500 http://localhost:7001/health 0ms, ALERT: status-not-2xx, NOTIF: service probably down
    INFO: 2021-06-16T04:15:20.130Z 9 id:5 200 http://localhost:7001/health 6ms
    INFO: 2021-06-16T04:15:25.128Z 10 id:5 200 http://localhost:7001/health 4ms
    INFO: 2021-06-16T04:15:30.137Z 11 id:5 200 http://localhost:7001/health 6ms
    INFO: 2021-06-16T04:15:35.146Z 12 id:5 200 http://localhost:7001/health 8ms, NOTIF: service is back up
    INFO: 2021-06-16T04:15:40.140Z 13 id:5 200 http://localhost:7001/health 4ms
    +

    Run with GMail Notification

    Star (0)
    1. Create a monika.yml file and fill it out with the following
    notifications:
    - id: unique-id-smtp
    type: smtp
    data:
    recipients:
    - YOUR_EMAIL_ADDRESS_HERE
    hostname: smtp.gmail.com
    port: 587
    username: YOUR_GMAIL_ACCOUNT
    password: YOUR_GMAIL_PASSWORD_OR_APP_PASSWORD
    probes:
    - id: '1'
    name: Monika Landing Page
    description: Landing page of awesome Monika
    interval: 10 # in seconds
    requests:
    - url: https://hyperjumptech.github.io/monika
    timeout: 7000 # in milliseconds
    alerts:
    - status-not-2xx
    1. Replace YOUR_EMAIL_ADDRESS_HERE in the monika.yml with your email address that will receive the notification.

    2. Replace YOUR_GMAIL_ACCOUNT with your valid Gmail account, e.g., yourname@gmail.com.

    3. Replace YOUR_GMAIL_PASSWORD_OR_APP_PASSWORD with your Gmail password.

      1. If you have activated Two Factor Authentication (2FA), you need to create an app password. Refer here to create an app password for your Gmail account.
    4. If you have installed Monika globally, run monika from Terminal app (macOS) in the same directory where monika.yml exists. If you haven't, you can quickly run Monika by running npx @hyperjumptech/monika in the same directory where monika.yml exists.

    5. During runtime, Monika will output a log that looks like this

      INFO (on x1): Starting Monika. Probes: 4. Notifications: 1
    INFO: 2021-06-16T04:14:40.128Z 1 id:5 200 http://localhost:7001/health 7ms
    INFO: 2021-06-16T04:14:45.109Z 2 id:5 200 http://localhost:7001/health 4ms
    INFO: 2021-06-16T04:14:50.126Z 3 id:5 200 http://localhost:7001/health 10ms
    INFO: 2021-06-16T04:14:55.107Z 4 id:5 200 http://localhost:7001/health 1ms
    WARN: 2021-06-16T04:15:00.117Z 5 id:5 500 http://localhost:7001/health 0ms, ALERT: status-not-2xx
    WARN: 2021-06-16T04:15:05.371Z 6 id:5 500 http://localhost:7001/health 0ms, ALERT: status-not-2xx
    WARN: 2021-06-16T04:15:10.128Z 7 id:5 500 http://localhost:7001/health 0ms, ALERT: status-not-2xx
    WARN: 2021-06-16T04:15:15.138Z 8 id:5 500 http://localhost:7001/health 0ms, ALERT: status-not-2xx, NOTIF: service probably down
    INFO: 2021-06-16T04:15:20.130Z 9 id:5 200 http://localhost:7001/health 6ms
    INFO: 2021-06-16T04:15:25.128Z 10 id:5 200 http://localhost:7001/health 4ms
    INFO: 2021-06-16T04:15:30.137Z 11 id:5 200 http://localhost:7001/health 6ms
    INFO: 2021-06-16T04:15:35.146Z 12 id:5 200 http://localhost:7001/health 8ms, NOTIF: service is back up
    INFO: 2021-06-16T04:15:40.140Z 13 id:5 200 http://localhost:7001/health 4ms
    INFO_TYPE: current-time iteration probe:id _probeURL_ [response time in ms],[ALERT messages if any], [NOTIFICATION messages if any]
    -

    PT Artha Rajamas Mandiri (Hyperjump) is an open-source-first company providing engineering excellence service. We aim to build and commercialize open-source tools to help companies streamline, simplify, and secure the most important aspects of its modern DevOps practices.

    Copyright © 2024 Hyperjump Tech. All Rights Reserved.

    \ No newline at end of file +

    PT Artha Rajamas Mandiri (Hyperjump) is an open-source-first company providing engineering excellence service. We aim to build and commercialize open-source tools to help companies streamline, simplify, and secure the most important aspects of its modern DevOps practices.

    Copyright © 2024 Hyperjump Tech. All Rights Reserved.

    \ No newline at end of file diff --git a/tutorial/visualizing-monika-data-with-prometheus-and-grafana.html b/tutorial/visualizing-monika-data-with-prometheus-and-grafana.html index 038d6abd3..8e8b4b95d 100644 --- a/tutorial/visualizing-monika-data-with-prometheus-and-grafana.html +++ b/tutorial/visualizing-monika-data-with-prometheus-and-grafana.html @@ -17,4 +17,4 @@ gtag('config', 'G-W999ZM71FP', { page_path: window.location.pathname, }); -

    Visualizing Monika Data with Prometheus and Grafana

    Star (0)

    Grafana is an open source visualization and analytics software. It allows you to query, visualize, be alerted, and explore your metrics no matter where they are stored. In plain English, it provides you with tools to turn your time-series database (TSDB) data into beautiful graphs and visualizations. It will be used to visualize your Monika data that has been processed by Prometheus.

    Install Grafana

    Let’s assume that you already have Monika and Prometheus installed and connected. The next step is we need to install Grafana. Head to the Downloads page and select which OS you are using.

    After you installed Grafana, open your web browser and go to http://localhost:3000/. The default HTTP port that Grafana listens to is 3000 unless you have configured a different port. It should show you the login page. On the login page, enter admin for username and password. After you are logged in, you will see the prompt to change your default password. Change your default password, and submit. You are now on the Grafana home page.

    Configure the Data Source

    Before we configure the data source, we need to run Monika and Prometheus. In case you forgot, here are the commands to run Monika and Prometheus both locally or using Docker:

    _\# Run Monika
    \# If you're installing Monika locally_
    **monika -c monika.json --prometheus 3001**_\# Or if you're using Docker_
    **docker run --name monika \\
    -p 3001:3001 \\
    -v ${PWD}/monika.json:/config/monika.json \\
    --prometheus 3001 \\
    --detach hyperjump/monika:latest**_\# Run Prometheus
    \# If you're installing Prometheus locally_
    **./prometheus --config.file=prometheus.yml**_\# Or if you're using Docker_
    **docker run -d --name prometheus \\
    -p 9090:9090 \\
    -v <PATH\_TO\_prometheus.yml>:/etc/prometheus/prometheus.yml \\
    prom/prometheus --config.file=/etc/prometheus/prometheus.yml**

    Back to the Grafana home page. On the left sidebar, hover the gear icon and select the Data Source option. Add a new data source by clicking the blue “Add data source” button. Then, select Prometheus as your data source.

    If you are following the instructions from the previous article, you are running Prometheus in port 9090. Fill out the URL with http://localhost:9090 and click the Save and Test button. It should display a toast notification telling that the data source has been updated.

    Creating the Dashboard

    After the data source has been successfully added, hover over the plus icon sub-menu and select the Dashboard option. And then, click the “Add an Empty Panel” area. We are now going to create a probe status code information panel.

    You are now on the edit panel page. In the right top section of the page, change the “Time Series” dropdown to “Stat”. Then, navigate to the metrics browser input field, type monika_request_status_code_infoand press Shift + Enter. After that, on the right sidebar, change the Panel Title to “Probe Status Code” and scroll down to the Threshold section. Set the color red threshold to 500. Now it should look like this:

    Apply the changes, and we are halfway done. Next, we are going to create another panel for monitoring the average response time per 5 minutes.

    Create another panel in the current dashboard. Navigate to the metrics browser input field, type this in one line, and press Shift + Enter:

    rate(monika\_request\_response\_time\_seconds\_sum\[5m\]) / rate(monika\_request\_response\_time\_seconds\_count\[5m\])

    After that, on the right sidebar, change the Panel Title to “Probe Average Response Time”. Then on the right sidebar, scroll down to the “Standard Options” section and change the unit to “Milliseconds”. Apply the changes, and you’re done!

    Congratulations! Now that you have successfully integrated Monika with Prometheus and Grafana, you will be notified if your website is slow or down.

    PT Artha Rajamas Mandiri (Hyperjump) is an open-source-first company providing engineering excellence service. We aim to build and commercialize open-source tools to help companies streamline, simplify, and secure the most important aspects of its modern DevOps practices.

    Copyright © 2024 Hyperjump Tech. All Rights Reserved.

    \ No newline at end of file +

    Visualizing Monika Data with Prometheus and Grafana

    Star (0)

    Grafana is an open source visualization and analytics software. It allows you to query, visualize, be alerted, and explore your metrics no matter where they are stored. In plain English, it provides you with tools to turn your time-series database (TSDB) data into beautiful graphs and visualizations. It will be used to visualize your Monika data that has been processed by Prometheus.

    Install Grafana

    Let’s assume that you already have Monika and Prometheus installed and connected. The next step is we need to install Grafana. Head to the Downloads page and select which OS you are using.

    After you installed Grafana, open your web browser and go to http://localhost:3000/. The default HTTP port that Grafana listens to is 3000 unless you have configured a different port. It should show you the login page. On the login page, enter admin for username and password. After you are logged in, you will see the prompt to change your default password. Change your default password, and submit. You are now on the Grafana home page.

    Configure the Data Source

    Before we configure the data source, we need to run Monika and Prometheus. In case you forgot, here are the commands to run Monika and Prometheus both locally or using Docker:

    _\# Run Monika
    \# If you're installing Monika locally_
    **monika -c monika.json --prometheus 3001**_\# Or if you're using Docker_
    **docker run --name monika \\
    -p 3001:3001 \\
    -v ${PWD}/monika.json:/config/monika.json \\
    --prometheus 3001 \\
    --detach hyperjump/monika:latest**_\# Run Prometheus
    \# If you're installing Prometheus locally_
    **./prometheus --config.file=prometheus.yml**_\# Or if you're using Docker_
    **docker run -d --name prometheus \\
    -p 9090:9090 \\
    -v <PATH\_TO\_prometheus.yml>:/etc/prometheus/prometheus.yml \\
    prom/prometheus --config.file=/etc/prometheus/prometheus.yml**

    Back to the Grafana home page. On the left sidebar, hover the gear icon and select the Data Source option. Add a new data source by clicking the blue “Add data source” button. Then, select Prometheus as your data source.

    If you are following the instructions from the previous article, you are running Prometheus in port 9090. Fill out the URL with http://localhost:9090 and click the Save and Test button. It should display a toast notification telling that the data source has been updated.

    Creating the Dashboard

    After the data source has been successfully added, hover over the plus icon sub-menu and select the Dashboard option. And then, click the “Add an Empty Panel” area. We are now going to create a probe status code information panel.

    You are now on the edit panel page. In the right top section of the page, change the “Time Series” dropdown to “Stat”. Then, navigate to the metrics browser input field, type monika_request_status_code_infoand press Shift + Enter. After that, on the right sidebar, change the Panel Title to “Probe Status Code” and scroll down to the Threshold section. Set the color red threshold to 500. Now it should look like this:

    Apply the changes, and we are halfway done. Next, we are going to create another panel for monitoring the average response time per 5 minutes.

    Create another panel in the current dashboard. Navigate to the metrics browser input field, type this in one line, and press Shift + Enter:

    rate(monika\_request\_response\_time\_seconds\_sum\[5m\]) / rate(monika\_request\_response\_time\_seconds\_count\[5m\])

    After that, on the right sidebar, change the Panel Title to “Probe Average Response Time”. Then on the right sidebar, scroll down to the “Standard Options” section and change the unit to “Milliseconds”. Apply the changes, and you’re done!

    Congratulations! Now that you have successfully integrated Monika with Prometheus and Grafana, you will be notified if your website is slow or down.

    PT Artha Rajamas Mandiri (Hyperjump) is an open-source-first company providing engineering excellence service. We aim to build and commercialize open-source tools to help companies streamline, simplify, and secure the most important aspects of its modern DevOps practices.

    Copyright © 2024 Hyperjump Tech. All Rights Reserved.

    \ No newline at end of file diff --git a/tutorial/write-config-in-visual-studio-code.html b/tutorial/write-config-in-visual-studio-code.html index 08aa3bd6a..54c10405f 100644 --- a/tutorial/write-config-in-visual-studio-code.html +++ b/tutorial/write-config-in-visual-studio-code.html @@ -17,4 +17,4 @@ gtag('config', 'G-W999ZM71FP', { page_path: window.location.pathname, }); -

    Write Config in Visual Studio Code

    Star (0)

    This tutorial will tell you how to create Monika configurations from scratch, using only Visual Studio Code and a VS Code extension.

    Preparation

    Let’s start with installing Visual Studio Code if you haven’t installed it on your computer yet. Head over to https://code.visualstudio.com/ and download the installation file according to your operating system.

    After you installed Visual Studio Code, head to the Extension menu, and search for an extension called YAML created by Red Hat. Install the extension right away in order to enable the Monika configuration autocompletion.

    Once you’re done, create a file called monika.yml and try to type “notific”. It will show you an explanation of the “notifications” key.

    Then proceed to type “notifications:” all the way and press enter to break the line. You will see a warning that the “notifications” key type should be an array

    Now some of you may think, “what if I don’t know what to type in a blank file?”. You can simply press CTRL+Space to show available options.

    Also, it includes auto-complete when you select an option. For example, press CTRL+Space and select probes. It will automatically set a probe with an empty ID, and ten seconds interval.

    If you have used Monika, you may notice that some keys are not there yet such as the URL and the Method. Below the id key, with the same indent, try to press CTRL+Space again and you will see all available keys inside a probe object.

    Now you can create your own Monika configuration using the methods above. For now, let’s try to create a Monika configuration based on the points below:

    • I want to use the Desktop notification channel
    • I want to create a single probe with the name “Google”, with any ID, has ten seconds interval
    • Inside the probe “Google”, I want to have a request that will hit https://www.google.com with the method GET

    Try to do it yourself first and see if you can create the configuration from the points above similar to the configuration below:

    notifications:
    - id: desktop
    type: desktop
    probes:
    - id: google
    name: "Google"
    requests:
    - url: https://www.google.com
    timeout: 10
    method: GET
    interval: 10

    If the configuration is similar to the one you created, then congratulations! All that’s left to do is to run it using Monika.

    PT Artha Rajamas Mandiri (Hyperjump) is an open-source-first company providing engineering excellence service. We aim to build and commercialize open-source tools to help companies streamline, simplify, and secure the most important aspects of its modern DevOps practices.

    Copyright © 2024 Hyperjump Tech. All Rights Reserved.

    \ No newline at end of file +

    Write Config in Visual Studio Code

    Star (0)

    This tutorial will tell you how to create Monika configurations from scratch, using only Visual Studio Code and a VS Code extension.

    Preparation

    Let’s start with installing Visual Studio Code if you haven’t installed it on your computer yet. Head over to https://code.visualstudio.com/ and download the installation file according to your operating system.

    After you installed Visual Studio Code, head to the Extension menu, and search for an extension called YAML created by Red Hat. Install the extension right away in order to enable the Monika configuration autocompletion.

    Once you’re done, create a file called monika.yml and try to type “notific”. It will show you an explanation of the “notifications” key.

    Then proceed to type “notifications:” all the way and press enter to break the line. You will see a warning that the “notifications” key type should be an array

    Now some of you may think, “what if I don’t know what to type in a blank file?”. You can simply press CTRL+Space to show available options.

    Also, it includes auto-complete when you select an option. For example, press CTRL+Space and select probes. It will automatically set a probe with an empty ID, and ten seconds interval.

    If you have used Monika, you may notice that some keys are not there yet such as the URL and the Method. Below the id key, with the same indent, try to press CTRL+Space again and you will see all available keys inside a probe object.

    Now you can create your own Monika configuration using the methods above. For now, let’s try to create a Monika configuration based on the points below:

    • I want to use the Desktop notification channel
    • I want to create a single probe with the name “Google”, with any ID, has ten seconds interval
    • Inside the probe “Google”, I want to have a request that will hit https://www.google.com with the method GET

    Try to do it yourself first and see if you can create the configuration from the points above similar to the configuration below:

    notifications:
    - id: desktop
    type: desktop
    probes:
    - id: google
    name: "Google"
    requests:
    - url: https://www.google.com
    timeout: 10
    method: GET
    interval: 10

    If the configuration is similar to the one you created, then congratulations! All that’s left to do is to run it using Monika.

    PT Artha Rajamas Mandiri (Hyperjump) is an open-source-first company providing engineering excellence service. We aim to build and commercialize open-source tools to help companies streamline, simplify, and secure the most important aspects of its modern DevOps practices.

    Copyright © 2024 Hyperjump Tech. All Rights Reserved.

    \ No newline at end of file