Improved puppet check cron job to check memory consumption.
This commit is contained in:
parent
17a3381e82
commit
d2a35e980c
2 changed files with 25 additions and 1 deletions
13
puppet/files/puppet-check
Executable file
13
puppet/files/puppet-check
Executable file
|
@ -0,0 +1,13 @@
|
|||
#!/bin/sh
|
||||
|
||||
PID="`pgrep -f 'puppetd'`"
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "puppetd not running on host `hostname`"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
MEMUSAGE=`ps -p ${PID} -o rss | tail -1`
|
||||
if [ ${MEMUSAGE} -gt 262144 ]; then
|
||||
echo "puppetd process size is over 256 MB (${MEMUSAGE} KB), restart recommended"
|
||||
exit 1
|
||||
fi
|
Loading…
Add table
Add a link
Reference in a new issue