Skip to main content

IntelMQ Monitoring with CheckMK

Collection of custom scripts intended to monitor our IntelMQ instances with CheckMK.

Scenarios

Status Module Description
works run (running-checks) Ensure all checks are successfully executed.
works inactive_enabled_feeds Ensure configured feeds sends data and we can ingest them into the workflow
works bot_status Verify state, queues etc. for every bot
works duplicated_processes Look for duplicated bots
works wrapper Wrapper for cronjobs to monitor their execution
planned orphan_queues Search for orphaned queues
planned dump_check Verify if there are some dumped events (intelmqdump)

⚠️ Error ratio calculation is currently not working fully correct and should rather be treated as a suggestion.

Monitoring philosophy

This monitoring is intended to provide regular status of each IntelMQ bot, periodic actions and a few global checks in a way it's easy to have an overview of the system health in a CheckMK dashboard.

The main monitoring script has to run periodically, and will generate a couple of informations that can be picked up by the CheckMK agent. It uses the local checks feature and runs independently from the CheckMK agent.

For every bot, there will be a new CheckMK service generated (and thus, you may need to accept it in the CheckMK service discovery). On every run, the monitoring script performs a couple of checks, e.g.:

  • is the bot running?
  • collect current queue size & check if they are not overfilled
  • collect & analyse bot stats (from built-in statistics)
    • not that this method is still a beta feature and has a few issues (e.g. clearing on reload, counting failed retries) which affects the ability to properly count the error rates
    • historic data are also stored locally to improve calculations
  • has a collector produced data in last X days?

Based on that, the status of each bot is determined and reported to CheckMK using the spool directory.

In addition, there are some checks unrelated to specific bots - e.g. looking for duplicated IntelMQ processes.

The execution of the monitoring script has to be scheduled manually (e.g. with cron).

How to use monitor-wrap

The monitor-wrap script is a helper for any script, especially the cronjobs. It takes an arbitrary command, and create for it a monitoring results in nagios-format, as well as capture output to a log file.

Usage:

monitor-wrap [--log-dir LOG_DIR] [--log-level {CRITICAL,FATAL,ERROR,WARN,WARNING,INFO,DEBUG,NOTSET}] [--valid-for VALID_FOR] --name NAME -- COMMAND

# For example, to:
# - run command `/usr/local/bin/script.sh arg1`,
# - name the service as `intelmq-periodic-my-script` (prefix hardcoded in package config),
# - mark the check valid for 5 minutes (after this time of no changes, CheckMK mark the status as undefined)
# - use default log level and dir:
monitor-wrap --valid-for 300 --name my-script -- /usr/local/bin/script.sh arg1

You may want to use it for periodic actions, like e.g. database updates for some bots.

How to deploy

  1. Install the package intelmq-monitoring-checkmk from the PyPI in the same place (system, venv) where your IntelMQ is running.
  2. Eventually adjust configuration (see config.py for available configuration, it can be overwritten in a file /etc/intelmq/monitoring.json).
  3. Schedule a cronjob under the same user as the IntelMQ is using (also intelmq).
  4. (if introducing new checks) Activate monitoring of new services in CheckMK

Also e.g.:

sudo pip3 install intelmq-monitoring-checkmk

sudo crontab -e -u intelmq
# Use the following cron rule to run every 5 minutes:
# */5 * * * * /usr/local/bin/intelmq-monitor

Documentation

TODO

Tests and linting

Development tools (test runner, linters) can be installed using dev extras:

   pip install -e .[dev]

All tests and linting tools (black, flake8, isort) can be run using tox:

tox  # run tests against a few python versions and linting
tox -epy10  # run only tests against Python 3.10
toy -elint  # run only linting

Debugging and logging

You can use --log-file and --log-level arguments to collect logs and save them. If file isn't set, logs will be printed on the standard output. Default log level is INFO.

CheckMK docs

Metadata

Release files for intelmq-monitoring-checkmk 0.6.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for intelmq-monitoring-checkmk 0.6.3
File Size Uploaded Provenance Actions
intelmq_monitoring_checkmk-0.6.3.tar.gz 35.9 kB With provenance Details for intelmq_monitoring_checkmk-0.6.3.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for intelmq-monitoring-checkmk 0.6.3
File Interpreter ABI Platform Actions
intelmq_monitoring_checkmk-0.6.3-py3-none-any.whl Python 3 none any Details for intelmq_monitoring_checkmk-0.6.3-py3-none-any.whl

Total release size: 69.4 kB

Release files / intelmq_monitoring_checkmk-0.6.3.tar.gz

Download URL intelmq_monitoring_checkmk-0.6.3.tar.gz
Size 35.9 kB
Tags Source
SHA-256 checksum
How to use checksums
a2e68c645fa314dceae27ea5d671e3a2f0d4f44782b7ab876592c931dfb4a8d0
BLAKE2b-256 checksum
How to use checksums
cbe49b74fcf46e08d800b5d5ee2d9a253542cfbb289200c1c8d5b3be1acb82af
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.9

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 26, 2025.

Transparency log

Release files / intelmq_monitoring_checkmk-0.6.3-py3-none-any.whl

Download URL intelmq_monitoring_checkmk-0.6.3-py3-none-any.whl
Size 33.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e3bc581ce4cbaeff2e1243d73fe13bbdb87a3c05abbe7c7ea9daea68d9ba1ef4
BLAKE2b-256 checksum
How to use checksums
315daca3ceb6c63052769e45a92dfb1294d70f3f2a5399f2f5bd2610806371d9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.9

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 26, 2025.

Transparency log

Security for intelmq-monitoring-checkmk 0.6.3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for intelmq_monitoring_checkmk-0.6.3.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 26, 2025.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page