This repository contains a collection of my custom CheckMK scripts designed to monitor various services and components within my network.
Windows hosts uses PowerShell scripts (.ps1 files). Theses should be placed in a directory accessible to your Windows monitoring agents. Typically, these would be located in the C:\ProgramData\checkmk\Agent\local directory.
Linux hosts uses Python scripts (.py files). Theses should be placed in a directory accessible to your Linux monitoring agents.
Typically, these would be located in the /usr/lib/check_mk_agent/local directory.
Ensure these scripts are made executable by running the following command:
chmod +x /path/to/your/script.py- Open your CheckMK Webinterface.
- Click on
Setupin the left side-bar - Click on
Hosts - Click on
Run service discoveryon your desired host - Check for
Undecided servicesand add them (Multiple refreshes may be needed!) - Click on Change in the upper right corner
- Click on
Activate in selected sites
- Description: Checks if a registered anti-idle service is running on Windows clients.
- Use Case: Ensures critical services remain active.
- How: PowerShell command:
Get-ScheduledTask - Response OK:
0 - Anti Idle - %serviceName% is running - Response CRIT:
2 - Anti Idle - $serviceName is not running
- Description: Monitors Discord-RPC server availability.
- Use Case: Ensures that the Discord RPC Server is functioning properly.
- How: PowerShell command:
Get-ScheduledTask - Response OK:
0 - RPC Server - Discord RPC Server is running - Response CRIT:
2 - RPC Server - Discord RPC Server is not running
- Description: Checks the status of the Cloudflare updater task on a Windows server.
- Use Case: Ensures Cloudflare DNS records are updated regularly.
- How: PowerShell command:
Get-ScheduledTask - Response OK:
0 - DNS Updater - Last run: $runTime - Response CRIT:
2 - DNS Updater - Last run: $runTime
Link to Cloudflare DNS Updater
- Description: Monitors the status of a Discord client.
- Use Case: Useful for managing Discord services on a Windows server.
- How: PowerShell command:
Get-ScheduledTask - Response OK:
0 - Discord - Instance is running - Response CRIT:
2 - Discord - Instance is not running
- Description: Checks if the NoIP-DUC process is running.
- Use Case: Ensures the NoIP IP-Address will always be up-to-date.
- How: Linux command:
pgrep - Response OK:
0 - DUC - /usr/bin/noip-duc is running - Response CRIT:
2 - DUC - /usr/bin/noip-duc is not running
- Description: Monitors Ring™ doorbell's status.
- Use Case: Integrates smart home devices with CheckMK.
- How: Protocol:
ICMP - Response OK:
0 - Doorbell - Doorbell is reachable - Response CRIT:
2 - Doorbell - Doorbell is not reachable
- Description: Monitors the status and player count of a Minecraft server.
- Use Case: Ensures the Minecraft server is up and running without issues.
- How: API: api.mcsrvstat.us & Protocol:
HTTPS - Response OK:
0 - Minecraft Server - Server is Available, Players online: $playerOn/$maxPlayer - Response WARN:
1 - Minecraft Server - Could not reach API. HTTP Status Code: $httpCode - Response CRIT:
2 - Minecraft Server - Server is not Available
- Description: Monitors the Pi-hole services to ensure they are running correctly.
- Use Case: Vital for networks using Pi-hole for ad blocking and DNS filtering.
- How: Linux command:
pgrep - Response OK:
0 - $serviceName - $serviceName is running - Response CRIT:
2 - $serviceName - $serviceName is not running
- Description: Monitors a Phillips-Hue Bridge's status.
- Use Case: Useful in environments where smarthome bridges are used extensively.
- How: Protocol:
ICMP - Response OK:
0 - Bridge - Bridge is available - Response CRIT:
2 - Bridge - Bridge is not available $httpCode
- Description: Checks available disk space on a SMB share.
- Use Case: Prevents disk space issues on shared network drives.
- How: APT-Package:
smbclient - Response OK:
0 - SMB disk space - $usedSpace% used, $freeSpace% free - Response WARN:
1 - SMB disk space - $usedSpace% used, $freeSpace% free - Response CRIT:
2 - SMB disk space - $usedSpace% used, $freeSpace% free
- Description: Monitors the availability of a SMB share.
- Use Case: Ensures network shares are accessible.
- How: APT-Package:
smbclient - Response OK:
0 - SMB share - Share is available - Response CRIT:
2 - SMB share - Share is not available
- Description: Checks the validity and expiration of SSL certificates.
- Use Case: Critical for ensuring SSL certificates are valid and up-to-date.
- How: Python-Package
ssl - Response OK:
0 - SSL Certificate - $daysRemaining days remaining - Response WARN:
1 - SSL Certificate - $daysRemaining days remaining - Response CRIT:
2 - SSL Certificate - $daysRemaining days remaining
- Description: Monitors the status page of a nextcloud instance.
- Use Case: Useful for tracking the health of the nextcloud services.
- How: Protocol:
HTTP/S - Response OK:
0 - Nextcloud - Nextcloud is running and not in maintenance mode - Response WARN:
1 - Nextcloud - Nextcloud is in maintenance mode - Response CRIT:
2 - Nextcloud - Nextcloud is unavailable
- Description: Monitors a UniFi Network Console's status.
- Use Case: Ensures Unifi network devices and consoles are operating correctly.
- How: Linux command:
pgrep - Response OK:
0 - Unifi Console - Network Console is running - Response CRIT:
2 - Unifi Console - Network Console is not running
- Description: Monitors Proxmox virtual machines' status.
- Use Case: Essential for environments heavily reliant on virtualization.
- How: Linux command:
qm - Response OK:
0 - VM Status - All VMs are running - Response WARN:
1 - VM Status - No returned no data - Response CRIT:
2 - VM Status - $criticalVms
- Description: Monitors the availability of a OpenVPN server.
- Use Case: Ensures VPN services are operational and accessible.
- How: Linux command:
pgrep) - Response OK:
0 - VPN Server - VPN Server is running - Response CRIT:
2 - VPN Server - VPN Server is not running