My personal nagios plugins, suited for my environment
These plugins are tested only by me using them in my own environment
- check_gmodem2 - Telekom Glasfasermodem 2 fiber optic modem monitoring
- check_p110 - TP-Link P110 smart plug monitoring with KLAP protocol
- check_jetdirect - Network printer monitoring via SNMP
- check_goss - Infrastructure validation using Goss framework
- check_compose - Docker Compose service health monitoring
- check_eap772 - TP-Link Omada EAP772 access point monitoring via SNMPv3
- check_kindle - Kindle device monitoring via custom management platform API
- check_smart - SMART drive health monitoring for ATA/SCSI/NVMe devices
- check_lm_sensors - Hardware sensor monitoring (temperature, fans, voltages) and HDD temperatures
- check_space_usage - Disk space usage analysis by directory (respects mount points, excludes network mounts)
- check_lpr - LPD/LPR printer daemon protocol testing (RFC 1179)
For detailed plugin documentation see README-CHECKS.md
Important: Starting from firmware version 1.4 (released November 2025), you must enable Third-party Vendor Compatibility in the Tapo app settings to use the KLAP protocol with the P110 smart plug. Without this setting enabled, the plugin will not be able to communicate with the device.
To enable third-party vendor compatibility:
-
Open the Tapo app and select your P110 device
-
Navigate to device settings
-
Enable "Third-party Vendor Compatibility"
- Python 3.8 or higher
- UV package manager
- Nagios or Icinga monitoring system
- Root or sudo access for installation
- Install UV package manager:
curl -LsSf https://astral.sh/uv/install.sh | sh
- Clone and install:
git clone https://github.com/ckbaker10/nagios-plugins.git /opt/nagios-plugins-lukas
cd /opt/nagios-plugins-lukas
sudo ./install.sh
- Verify installation:
sudo -u nagios /opt/nagios-plugins-lukas/check_gmodem2 --help
sudo -u nagios /opt/nagios-plugins-lukas/check_p110 --help
sudo -u nagios /opt/nagios-plugins-lukas/check_jetdirect --help
sudo -u nagios /opt/nagios-plugins-lukas/check_goss --help
sudo -u nagios /opt/nagios-plugins-lukas/check_compose --help
sudo -u nagios /opt/nagios-plugins-lukas/check_eap772 --help
sudo -u nagios /opt/nagios-plugins-lukas/check_kindle --help
sudo -u nagios /opt/nagios-plugins-lukas/check_smart --help
sudo -u nagios /opt/nagios-plugins-lukas/check_lm_sensors --help
All commands should display help text without errors.
This collection uses a wrapper-based architecture:
- Python Scripts - Core plugin logic with proper dependency isolation
- Wrapper Scripts - Bash wrappers that activate virtual environment
- Virtual Environment - Isolated Python dependencies managed by UV
- Installation Script - Automated setup with proper permissions
Add command definitions to your Nagios configuration:
define command {
command_name check_gmodem2
command_line /opt/nagios-plugins-lukas/check_gmodem2 -H $HOSTADDRESS$ --rx-power-warning -15
}
define command {
command_name check_p110
command_line /opt/nagios-plugins-lukas/check_p110 -H $HOSTADDRESS$ -u $ARG1$ -p $ARG2$
}
define command {
command_name check_kindle
command_line /opt/nagios-plugins-lukas/check_kindle -u $ARG1$ -s $ARG2$ --offline-hours $ARG3$
}
Then reload the Nagios configuration:
sudo systemctl reload nagios
Copy the custom command definitions to your Icinga2 configuration:
sudo cp /opt/nagios-plugins-lukas/icinga-custom-commands/commands-custom.conf /etc/icinga2/conf.d/
sudo systemctl reload icinga2
Verify the configuration:
sudo icinga2 daemon -C
For environments using Icinga Director, follow these steps to import and configure the custom check commands:
-
Deploy to Global Zone
Copy the command definitions to the global zone on your Icinga master (config endpoint):
sudo cp /opt/nagios-plugins-lukas/icinga-custom-commands/commands-custom.conf \ /etc/icinga2/zones.d/global-templates/ -
Import via Director Kickstart Wizard
- Navigate to the Director web interface
- Go to Icinga Director → Icinga Infrastructure → Kickstart Wizard
- Click Run Import to sync the configuration
- Check the Activity Log to verify new commands are staged for deployment
- Click Deploy to push the configuration to your Icinga infrastructure
-
Create Service Templates
- Navigate to Director → Services → Service Templates
- Click Add to create a new service template
- Select your desired check command (e.g.,
check_gmodem2,check_p110,check_kindle) - Configure basic service parameters and Save
-
Add Custom Fields
- In the service template editor, navigate to the Fields tab
- Click Add Field to define custom parameters for the command
- Add variables like
gmodem2_rx_warning,p110_email,kindle_offline_hours, etc. - Save the field definitions
-
Configure Service Parameters
- Return to the service template main view
- Set values for the custom parameters you defined
- Configure check intervals, retry logic, and notification settings
- Save the template
-
Deploy Configuration
- Review pending changes in the Activity Log
- Click Deploy to push the configuration to your Icinga infrastructure
object CheckCommand "check_compose" {
import "plugin-check-command"
command = [ "/opt/nagios-plugins-lukas/check_compose" ]
arguments = {
"-p" = "$compose_project$"
"--show-services" = { set_if = "$compose_show_services$" }
"--ignore-services" = "$compose_ignore_services$"
}
}
This repository includes auto-generated Icinga2 CheckCommand definitions for the standard nagios-plugins 2.4.12 collection. These definitions were created by parsing the source code to extract command-line options.
Available commands: 51 plugins including check_mysql, check_http, check_smtp, check_ldap, check_disk, and many more.
See NAGIOS-PLUGINS-IMPORT.md for:
- Complete list of 51 parsed plugins
- Installation and usage instructions
- Parsing methodology details
- Variable naming conventions
Quick import:
sudo cp /opt/nagios-plugins-lukas/icinga-custom-commands/commands-nagios-plugins-2.4.12.conf \
/etc/icinga2/conf.d/
sudo icinga2 daemon -C
sudo systemctl reload icinga2./check_gmodem2 -H 192.168.100.1 --rx-power-warning -15 --rx-power-critical -20
./check_p110 -H 10.10.10.138 -u "user@example.com" -p "password" --expect-on
./check_jetdirect -H printer.domain.com -t consumable -o black -w 85 -c 90
./check_jetdirect -H printer.domain.com -t page
./check_goss -g /etc/goss/server.yaml --show-failures
./check_compose -p icinga-playground --show-services
./check_compose -f /opt/myapp/docker-compose.yml --unhealthy-warning
./check_kindle -u http://10.10.10.8:22116/api -s B077-XXXX-XXXX --offline-hours 8.0
./check_smart -d /dev/sda -i ata
./check_smart -d /dev/sda -i ata -b 5 -w "Reallocated_Sector_Ct=10"
./check_smart -g '/dev/sd[a-z]' -i scsi -q
./check_lm_sensors --list
./check_lm_sensors --high temp1=50,60 --high temp2=50,60
./check_lm_sensors --low fan1=2000,1000 --high 'sda Temp'=50,60
The check_compose plugin requires Docker access. The installation script automatically adds the nagios user to the docker group if Docker is installed.
Note: Restart Nagios/Icinga service after installation for docker group changes to take effect.
All dependencies are managed by UV in an isolated virtual environment:
- requests - HTTP client library
- pycryptodome - Cryptographic functions
- pysnmp - SNMP protocol implementation
- pydantic - Data validation
- pkcs7 - Cryptographic padding
- urllib3 - HTTP utilities
sudo chown -R nagios:nagios /opt/nagios-plugins-lukas
sudo chmod +x /opt/nagios-plugins-lukas/check_*
cd /opt/nagios-plugins-lukas
sudo -u nagios uv venv .venv --clear
sudo -u nagios uv pip install -e .
sudo usermod -aG docker nagios
sudo systemctl restart nagios
sudo -u nagios /opt/nagios-plugins-lukas/check_p110 -H device.local -u user -p pass -v
If you prefer manual setup:
# Install dependencies
uv venv .venv
uv pip install -e .
# Set permissions
sudo chown -R nagios:nagios /opt/nagios-plugins-lukas
sudo chmod +x /opt/nagios-plugins-lukas/check_*
# Add nagios to docker group (for check_compose)
sudo usermod -aG docker nagios
# Configure sudo rules for check_smart and check_lm_sensors
sudo tee /etc/sudoers.d/nagios-plugins > /dev/null << 'EOF'
# Nagios plugins - minimal permissions for hardware monitoring
# Allow nagios user to run smartctl, sensors, and hddtemp without password
Defaults:nagios !requiretty
nagios ALL=(root) NOPASSWD: /usr/sbin/smartctl
nagios ALL=(root) NOPASSWD: /usr/bin/sensors
nagios ALL=(root) NOPASSWD: /usr/sbin/hddtemp
EOF
# Set correct permissions on sudoers file
sudo chmod 0440 /etc/sudoers.d/nagios-plugins
# Validate sudoers syntax
sudo visudo -c -f /etc/sudoers.d/nagios-pluginsNote: The paths for smartctl, sensors, and hddtemp may vary by distribution:
- Debian/Ubuntu:
/usr/sbin/smartctl,/usr/bin/sensors,/usr/sbin/hddtemp - RHEL/CentOS: Check with
which smartctl sensors hddtemp
Adjust the sudoers file paths accordingly for your system.
- Follow Nagios plugin conventions
- Include performance data in standard format
- Provide comprehensive error handling
- Add tests and documentation
- Update pyproject.toml for dependencies
GPLv3 - See LICENSE file for details.