Actions
Bug #5190
closedRudder agents crons send far too many mails
Pull Request:
Severity:
UX impact:
User visibility:
Effort required:
Priority:
Name check:
Fix check:
Regression:
Description
There are some jobs, like purging the cf_lock.tcdb, which are known to happen quitte often. It would ne nice if these jobs are piped to /dev/null. At the moment it's a bit noisy.
At the moment I get ~ 100 cron e-mails from all of my servers with the following warning:
WARNING: The file /var/rudder/cfengine-community/state/cf_lock.tcdb is too big ( 10499072 bytes), purging it... Done
As you may understand, I would prefer to not read these messages constantly. please can you pipe the cron to /dev/null?
Also, this is really too long for a cron job:
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin 0,5,10,15,20,25,30,35,40,45,50,55 * * * * root . /etc/profile; if [ -e /opt/rudder/bin/check-rudder-agent ]; then /opt/rudder/bin/check-rudder-agent; else if [ ! -e /opt/rudder/etc/disable-agent -a `ps -efww | grep -E "(cf-execd|cf-agent)" | grep -E "/var/rudder/cfengine-community/bin/(cf-execd|cf-agent)" | grep -v grep | wc -l` -eq 0 ]; then /var/rudder/cfengine-community/bin/cf-agent -f failsafe.cf >/dev/null 2>&1 && /var/rudder/cfengine-community/bin/cf-agent >/dev/null 2>&1; if [ $? != 0 ]; then if [ -f /opt/rudder/etc/rudder-restart-message.txt ]; then cat /opt/rudder/etc/rudder-restart-message.txt; else echo "Rudder agent was unable to restart on $(hostname)."; fi; fi; fi; fi
It would be a good idea to move all this logic into a script and execute the script from cron.
Actions