Created
July 20, 2015 18:30
-
-
Save moali87/bfb43b403ea563fa8aca to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
minion_watchdog: | |
cloud.absent: | |
- tgt: {{ grains['id'] }} | |
- unless: | |
- cmd.run: /tmp/uptime_test | |
require: | |
- file: /tmp/uptime_test | |
/tmp/uptime_test: | |
file.managed: | |
- source: salt://minion_watchdog/uptime_test.sh | |
- user: root | |
- group: root | |
- mode: 644 | |
Source File: | |
#!/bin/bash | |
UPTIME=$(awk '{ print $1 }' /proc/uptime | awk -F '.' '{ print $1 }') | |
if [[ $UPTIME -lt 300 ]]; then exit 0;else exit 1; fi | |
Output: | |
Summary | |
----------- | |
Succeeded: 0 | |
Failed: 0 | |
----------- | |
Total states run: 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment