Last active
October 28, 2016 20:27
-
-
Save asabaylus/0dfdf6d691437aa2115b00fda760a979 to your computer and use it in GitHub Desktop.
vsync-monitor
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
#!/bin/bash | |
# print last timestampe from last two log files | |
# "2016-10-28T14:21:28.022-04:00" | |
# compare the date to now and return if > 5 min | |
# convert date to unix epoch | |
if [ $# = 1 ]; then | |
now=$(date +"%F %T"); | |
if [[ $(date -d `cat $(ls -1tr /syslog/vsynch/app*.log*) | grep "pushing changes" | cut -c1-19 | tail -1` +%s ) > `date -d "$1 secs ago" +%s` ]]; | |
then echo "$now: VSYNC UP" >> /syslog/vsynch/vsync-monitor.log; | |
else mail -s "vsync down!" asa@baylus.com,cprocunier@gmail.com,parmstrong@ifthen.com < /dev/null; | |
fi | |
fi |
jaanauati
commented
Oct 28, 2016
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment