Project

General

Profile

Actions

Bug #5190

closed

Rudder agents crons send far too many mails

Added by Dennis Cabooter almost 10 years ago. Updated about 9 years ago.

Status:
Released
Priority:
3
Category:
System integration
Target version:
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.


Related issues 2 (0 open2 closed)

Related to Rudder - Architecture #5391: Replace complex cron one-liner with one script call (impl)ReleasedBenoît PECCATTE2014-08-14Actions
Related to Rudder - Bug #5922: Rudder crons sends too much mailsReleasedJonathan CLARKE2014-12-04Actions
Actions #1

Updated by Nicolas CHARLES almost 10 years ago

  • Project changed from 24 to Rudder
  • Category set to 39
  • Status changed from New to Discussion
  • Assignee set to Jonathan CLARKE
  • Target version set to 2.10.4

Dennis,

I understand that it is really annoying. Asking Jon its advice on this one

Actions #2

Updated by Nicolas PERRON over 9 years ago

  • Target version changed from 2.10.4 to 2.10.5
Actions #3

Updated by Vincent MEMBRÉ over 9 years ago

  • Target version changed from 2.10.5 to 2.10.6
Actions #4

Updated by Olivier Mauras over 9 years ago

+1 on the annoyingness :)

Actions #5

Updated by Jonathan CLARKE over 9 years ago

Dennis Cabooter wrote:

Also, this is really too long for a cron job:

[...]

It would be a good idea to move all this logic into a script and execute the script from cron.

This is being done in #5391.

Actions #6

Updated by Jonathan CLARKE over 9 years ago

I agree that this script should not be sending emails all the time, especially for problems that it can solve by itself. It does get really annoying.

I propose that we change it to redirect stdout to /dev/null, but not stderr, so that we can still cause important messages to be sent out if necessary.

Actions #7

Updated by Jonathan CLARKE over 9 years ago

  • Status changed from Discussion to 8
  • Assignee changed from Jonathan CLARKE to Matthieu CERDA
Actions #8

Updated by Matthieu CERDA over 9 years ago

  • Target version changed from 2.10.6 to 2.10.7
Actions #9

Updated by Vincent MEMBRÉ over 9 years ago

  • Target version changed from 2.10.7 to 2.10.8
Actions #10

Updated by Matthieu CERDA over 9 years ago

  • Status changed from 8 to Pending technical review
  • Assignee changed from Matthieu CERDA to Jonathan CLARKE
  • Priority changed from N/A to 3
  • % Done changed from 0 to 100
  • Pull Request set to https://github.com/Normation/rudder-techniques/pull/596

Careful, 3.0 will need manual adjustment due to #5391... => #5922

PR is ready: https://github.com/Normation/rudder-techniques/pull/596

Actions #11

Updated by Matthieu CERDA over 9 years ago

  • Status changed from Pending technical review to Pending release

Applied in changeset policy-templates:commit:a0a97f04d7dbe5edc62702b2240eb70d35e1f099.

Actions #12

Updated by Jonathan CLARKE over 9 years ago

Applied in changeset policy-templates:commit:4f7903e44bc14ec87e078b2da58938c55a0e9bbe.

Actions #13

Updated by Vincent MEMBRÉ over 9 years ago

  • Subject changed from Rudder crons should be piped to /dev/null to Rudder agents crons send far too many mails
Actions #14

Updated by Vincent MEMBRÉ over 9 years ago

  • Status changed from Pending release to Released

This bug has been fixed in Rudder 2.10.8 and 2.11.5, which were released today (16/12/14)

Actions #15

Updated by Benoît PECCATTE about 9 years ago

  • Category changed from 39 to System integration
Actions

Also available in: Atom PDF