Skip to content

Instantly share code, notes, and snippets.

@mattyjones
Created May 12, 2014 14:24
Show Gist options
  • Save mattyjones/39490b075e43a42757c2 to your computer and use it in GitHub Desktop.
Save mattyjones/39490b075e43a42757c2 to your computer and use it in GitHub Desktop.
This is an sec rulle file to help prevent an email storm with Icinga/Nagios caused by excessive notifications.
type=SingleWithThreshold
ptype=RegExp
pattern=test
desc=$0
action=eval %e {'[email protected]'} ; \
eval %c {'/var/spool/icinga/cmd/icinga.cmd'} ; \
pipe 'The email threshold was tripped at %t /n Stopping the sendmil service' /bin/mail -s "Email Storm Alert" %e ; \
shellcmd /usr/bin/printf "[%%lu] DISABLE_NOTIFICATIONS" %u > %c
window=60
thresh=25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment