Forum Discussion

fjl80_29796's avatar
fjl80_29796
Icon for Nimbostratus rankNimbostratus
Nov 21, 2013

How 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 (00:00 to 06:00) as some pools have scheduled reboots.

 

Version: 11.3 Any idea, how could it be done?

 

Thanks, Fran

 

1 Reply

  • Hi,

    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