[Unit]
Description=HVAC Know It All Content Monitoring
After=network.target
Wants=network.target

[Service]
Type=oneshot
ExecStart=/usr/bin/python3 /opt/hvac-kia-content/monitoring/setup_monitoring.py
ExecStartPost=/usr/bin/python3 /opt/hvac-kia-content/monitoring/dashboard_generator.py

# Run as the hvac user
User=hvac
Group=hvac

# Working directory
WorkingDirectory=/opt/hvac-kia-content

# Environment
Environment=PYTHONPATH=/opt/hvac-kia-content
Environment=PATH=/usr/local/bin:/usr/bin:/bin

# Logging
StandardOutput=journal
StandardError=journal
SyslogIdentifier=hvac-monitoring

# Security settings
PrivateTmp=true
ProtectSystem=strict
ProtectHome=true
ReadWritePaths=/opt/hvac-kia-content
NoNewPrivileges=true
ProtectKernelTunables=true
ProtectKernelModules=true
ProtectControlGroups=true

[Install]
WantedBy=multi-user.target