How sown/monitoring works
SOWN’s monitoring configuration manager gathers active inventory from NetBox, combines it with checked-in Icinga configuration, renders inventory-driven templates, compares the result with the active Icinga package, and optionally submits and verifies an update. The configuration also defines monitoring commands, dependencies, notifications, zones, and host services; check programs live separately. The sampled source supports the generator and API interactions, while the README documents the deployment workflow. Some configuration and check behavior is inferred only from paths and names.
Main entry points: cli.py Generator CLI · sown Icinga configuration · render.py Template renderer · logconfig.py Logging setup
Components 19
Config generation
- Generator CLI
icingagen/icingagen/cli.py - Template renderer
icingagen/icingagen/render.py - Logging setup
icingagen/icingagen/logconfig.py
Icinga definitions
- Icinga configuration
config/zones.d/sown - Host templates
config/zones.d/sown/hosts.j2.conf - Host services
config/zones.d/sown/host-services - Temperature config
config/zones.d/sown/host-temp.conf - Service definitions
config/zones.d/sown/services.conf - Command definitions
config/zones.d/sown/commands.conf - Dependencies
config/zones.d/sown/dependencies.conf - Notifications
config/zones.d/sown/notifications.conf - Constants
config/zones.d/sown/000_constants.conf
External systems
- Icinga API client
icingagen/icingagen/icinga.py - NetBox inventory
- Icinga API
Monitoring checks
- Check programs
checks - Notification scripts
scripts
Other components
- Operator
- System syslog
Connections 18
- Operator → Generator CLI: runs
- Generator CLI → NetBox inventory: queries inventory
- Generator CLI → Icinga configuration: reads config
- Generator CLI → Host templates: reads template
- Generator CLI → Template renderer: renders templates
- Template renderer → Host templates: loads template
- Generator CLI → Icinga API client: compares and updates
- Icinga API client → Icinga API: reads and submits stages
- Generator CLI → Logging setup: configures logging
- Logging setup → System syslog: writes logs
- Command definitions → Check programs: defines checks
- Notifications → Notification scripts: invokes notifications
- Service definitions → Host services: defines services
- Host services → Temperature config: includes temperature checks
- Icinga configuration → Constants: includes constants
- Icinga configuration → Command definitions: includes commands
- Icinga configuration → Dependencies: includes dependencies
- Icinga configuration → Notifications: includes notifications