Skip to main content

A command-line assistant for acknowledging and managing Nagios Core alerts.

Project description

mozzo

A lightweight CLI for acknowledging and managing Nagios Core alerts via its native CGI scripts.

Flake8 Lint PyPI version

Table of Contents

About

Mozzo interacts with Nagios Core (4.x) via cmd.cgi and statusjson.cgi using standard HTTPS requests. It allows you to acknowledge alerts, schedule downtime, and view statuses without needing to install specialized Nagios libraries or scrape HTML.

Installation

Option 1: Run from source (Standalone)

You can clone the repository and run the script directly:

git clone [https://github.com/sadsfae/mozzo.git](https://github.com/sadsfae/mozzo.git)
cd mozzo
chmod +x mozzo.py
./mozzo.py --help

Option 2: Install via pip

Install globally or in a virtual environment to make the mozzo command available anywhere:

git clone [https://github.com/sadsfae/mozzo.git](https://github.com/sadsfae/mozzo.git)
cd mozzo
pip install .
mozzo --help

Option 3: Install via Pypi

python -m venv mozzo
. !$/bin/activate
pip install mozzo

Configuration

Mozzo requires a configuration file named config.yml. It will search for this file in the following order:

  1. ~/.config/mozzo/config.yml
  2. ./config.yml (Current directory)
  3. /etc/mozzo/config.yml

[!TIP] Copy the example config.yml and edit it first.

mkdir -p ~/.config/mozzo
curl -s -o ~/.config/mozzo/config.yml [https://raw.githubusercontent.com/sadsfae/mozzo/refs/heads/main/config.yml](https://raw.githubusercontent.com/sadsfae/mozzo/refs/heads/main/config.yml)
vim ~/.config/mozzo/config.yml

Your config.yml needs the following structure:

nagios_server: [https://nagios.example.com](https://nagios.example.com)
nagios_cgi_path: /nagios/cgi-bin
nagios_username: nagiosadmin
nagios_password: mysecurepassword
default_downtime: 120 # in minutes
verify_ssl: false
date_format: "%m-%d-%Y %H:%M:%S"

Usage

[!IMPORTANT] You can run mozzo (if installed) or ./mozzo.py or python mozzo.py (if running from source).

View Nagios process status

mozzo --status

List unhandled/alerting services

mozzo --unhandled

List service issues

mozzo --service-issues [ --host host.example.com ]

Acknowledge a specific service

mozzo --ack --host host01.example.com --service "HTTP"

Acknowledge a host and all its services

mozzo --ack --host host01.example.com --all-services

Set downtime for a specific host

mozzo --set-downtime --host host01.example.com

Set downtime for a host and all its services

mozzo --set-downtime --host host01.example.com --all-services

Set downtime for a specific service

mozzo --set-downtime --host host01.example.com --service "HTTP"

Disable alerting for a specific service

mozzo --disable-alerts --host host01.example.com --service "HTTP"

Disable alerting for all services on a host

mozzo --disable-alerts --host host01.example.com --all-services

Enable alerting for all services on a host

mozzo --enable-alerts --host host01.example.com --all-services

Enable alerting for a specific service

mozzo --enable-alerts --host host01.example.com --service "HTTP"

Toggle global alerts

mozzo --disable-alerts
mozzo --enable-alerts

Setting Ack or Downtime with a Custom Message

mozzo --ack --host host01.example.com --message "Acknowledged per ticket INC-12345"
mozzo --set-downtime --host host01.example.com --all-services -m "Patching window"

Contributing

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mozzo-0.3.0.tar.gz (44.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mozzo-0.3.0-py3-none-any.whl (31.4 kB view details)

Uploaded Python 3

File details

Details for the file mozzo-0.3.0.tar.gz.

File metadata

  • Download URL: mozzo-0.3.0.tar.gz
  • Upload date:
  • Size: 44.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for mozzo-0.3.0.tar.gz
Algorithm Hash digest
SHA256 ddf3664ba805b14935945539301439595c2d324fee57b0ffd76eb63643499b73
MD5 8ea8de80d4d9bae129e4160b8e841bcf
BLAKE2b-256 3487c9d9c0ce144554a1b3b4e45881b4f6bf8421b2d512972e6f9a5805b7c381

See more details on using hashes here.

File details

Details for the file mozzo-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: mozzo-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 31.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for mozzo-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3f386945d34b0cda104b7fe8270f87a9327d3aa1d394982b47b3920ae93b905e
MD5 a475dac21510f8c2bb523e2eb596bbc6
BLAKE2b-256 d47c5effcf2ebef8b5b9f1410724f9d9acd93c7d8df5992cd52d004192ada685

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page