Forum Discussion
fjl80_29796
Nimbostratus
Nov 21, 2013How to stop receiving alerts during night time from alertd and ssmtp
Hello,
we have configured to receive alerts any time a pool member goes up/down usinng ssmpt and alertd, this works fine. My problem is that I dont want to receive those mails during night time ...
PeteWhite
Employee
Nov 21, 2013Hi,
Can I suggest that you set a cron job to add the smtp config (or alertd config) at 0600 and remove it again at 0000?
Something along the lines of this:
Copy to /etc/cron.d/alert_enable
SHELL=/bin/bash
PATH=/sbin:/bin:/usr/sbin:/usr/bin
MAILTO=user@somewhere
HOME=/var/tmp
0 0 6 * * root /bin/bash /var/local/bin/alert_enable.sh 1>/var/tmp/alert_enable.log 2>&1
Copy to /etc/cron.d/alert_disable
SHELL=/bin/bash
PATH=/sbin:/bin:/usr/sbin:/usr/bin
MAILTO=user@somewhere
HOME=/var/tmp
0 0 0 * * root /bin/bash /var/local/bin/alert_disable.sh 1>/var/tmp/alert_disable.log 2>&1
Copy to /var/local/bin/alert_enable.sh
!/bin/bash
tmsh create sys smtp-server mail smtp-server-host-name mail.intranet.com username f5mail password f5password
Copy to /var/local/bin/alert_disable.sh
!/bin/bash
tmsh delete sys smtp-server mail
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects