For anyone trying to do this, I can't find a way around the problem from the original post either. I did create a script to enable/disable maintenance mode, and I can attach it to scheduled tasks, but if the system is down after the maintenance window the task to disable maintenance mode just gets 'skipped' and I don't get an email because getting skipped isn't a failure. Another attempt was the conditional in Workflows for "'System is Online' is equal to 'No'", but that just does nothing if it's true, so I can't trigger an email for offline systems using it. I'm left to rely on other monitoring systems to inform me if a computer is offline after a maintenance window. Here's the script if anyone wants it. #!/bin/bash
# Define the file path
FILE="/etc/pulseway/config.xml"
# 1. Use sed to replace the specific MaintenanceMode line
# -i: edit the file in-place
# s: substitute command
sudo sed -i 's/<MaintenanceMode Enabled="false"\/>/<MaintenanceMode Enabled="true"\/>/g' "$FILE"
# 2. Restart the Pulseway service to apply changes
echo "Maintenance mode set. Restarting Pulseway in 10 seconds..."
sudo systemd-run --on-active=10s bash -c "systemctl restart pulseway"
echo "Pulseway maintenance mode enabled and service restart scheduled."
exit 0