Network health monitoring script with MQTT reporting for Home Assistant. - Ping, HTTP, and SNMP checkers - MQTT Discovery for automatic entity creation - Configurable check intervals Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1.1 KiB
1.1 KiB
CLAUDE.md
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
Project Overview
LAN Checker is a Python script that monitors network services and devices, publishing status via MQTT to Home Assistant using MQTT Discovery.
Commands
# Install dependencies
pip install -r requirements.txt
# Setup config
cp config.yaml.example config.yaml
# Run
python lan_checker.py
Architecture
lan_checker.py- Main script: config loading, MQTT client, check schedulercheckers/- Modular check implementationsbase.py-BaseCheckerabstract class andCheckResultdataclassping.py,http.py,snmp.py- Concrete checker implementations
config.yaml.example- Configuration template (copy toconfig.yaml)
Adding a New Checker
- Create
checkers/newtype.pyinheriting fromBaseChecker - Implement
check()method returningCheckResult - Register in
checkers/__init__.pyCHECKERS dict
MQTT Topics
- Discovery:
homeassistant/binary_sensor/lan_checker_{id}/config - State:
lan_checker/{id}/state(JSON with state, message, response_time, last_check)