File tree 1 file changed +13
-1
lines changed
1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change 46
46
# return new AlarmStatus(CRITICAL, 'Process not running.');
47
47
# }
48
48
#
49
+ # if (metric['process_age'] > 86400) {
50
+ # return new AlarmStatus(WARNING, 'Process has been running for over 24 hours.');
51
+ # }
52
+ #
49
53
# return new AlarmStatus(OK, 'Process running normally.');
50
54
51
55
function help {
52
56
53
57
cat << HELP
54
58
55
- SYNOPSIS: ./process_mon.sh [process]...
59
+ SYNOPSIS: ./process_mon.sh [process]...
56
60
USAGE EXAMPLE: ./process_mon.sh lsync
57
61
58
62
HELP
@@ -64,4 +68,12 @@ if [ -z "$1" ]; then
64
68
fi
65
69
66
70
process_check=` ps ax | grep -v grep | grep -v process_mon | grep -c " $1 " `
71
+ if (( $process_check > 0 )) ; then
72
+ process_age=` ps -o etimes= -p " $process_check " `
73
+ process_age=${process_age## }
74
+ fi
75
+
67
76
echo " metric process_mon int $process_check "
77
+ echo " metric process_age int ${process_age:- 0} "
78
+
79
+ exit 0
You can’t perform that action at this time.
0 commit comments