• Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Search
  • Register
  • Login
Netgate Discussion Forum
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Search
  • Register
  • Login

Gateway Email notifications not consistent

Scheduled Pinned Locked Moved General pfSense Questions
5 Posts 4 Posters 770 Views
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T
    timbot18
    last edited by Feb 26, 2018, 3:22 PM

    Im on 2.4.2_1, and for some reason the email notifications are not working consistently. i have the notifications setup to use gmail, and tests are successful.

    however, when the gateway goes down (or enters alert state), i do not get the notifications. when it comes back up (or resumes from alert state) i get a notification that the gateway is back up.

    looking at the log, i have for the failed send on gateway trouble:

    rc.dyndns.update: Could not send the message to xxxx@gmail.com – Error: Failed to connect to ssl://smtp.gmail.com:465 [SMTP: Failed to connect socket: fsockopen(): unable to connect to ssl://smtp.gmail.com:465 (Unknown error) (code: -1, response: )]

    then, a few seconds later, for the gateway online:

    /rc.dyndns.update: Message sent to xxxx@gmail.com OK

    the only thing i can assume is that it's failing to send the alert because the gateway is in the down or alert state, and is not using the failed to gateway to send the message out. if that is the case, is there a way i can set a delay on when it sends the email, say 10 seconds, so it fails to the other gateway? i have the option to flush all states when a gateway goes down. not sure if that helps or hurts.

    1 Reply Last reply Reply Quote 0
    • R
      robi
      last edited by Feb 26, 2018, 3:29 PM Feb 26, 2018, 3:25 PM

      +1 for this. I also experience loss of notifications due to flaky adsl wan lines. There should be a way to check first if the notification can be fulfilled, if not - postpone the notification and try again (with check) later. The retry interval should be a configurable value.

      Additionally - repeated notifications should be collected into one single message. So for instance if there are multiple notifications within the retry window, they should be sent as one single notification, concatenated into a single message.

      Possible solution:
      1. try to send notif
      2. if fails, echo it to a temp file, and set a retry flag
      3. next time it needs to be retried, read the file and try to send it

      Any notifications failing would be echoed to the temp file, next time it succeedes, it will send the whole file as a message.
      Or something similar…

      1 Reply Last reply Reply Quote 0
      • G
        Gertjan
        last edited by Feb 26, 2018, 4:04 PM Feb 26, 2018, 3:59 PM

        @timbot18:

        Im on 2.4.2_1, and for some reason the email notifications are not working consistently. i have the notifications setup to use gmail, and tests are successful.

        however, when the gateway goes down (or enters alert state), i do not get the notifications. when it comes back up (or resumes from alert state) i get a notification that the gateway is back up.

        looking at the log, i have for the failed send on gateway trouble:

        rc.dyndns.update: Could not send the message to xxxx@gmail.com – Error: Failed to connect to ssl://smtp.gmail.com:465 [SMTP: Failed to connect socket: fsockopen(): unable to connect to ssl://smtp.gmail.com:465 (Unknown error) (code: -1, response: )]

        then, a few seconds later, for the gateway online:

        /rc.dyndns.update: Message sent to xxxx@gmail.com OK

        the only thing i can assume is that it's failing to send the alert because the gateway is in the down or alert state, and is not using the failed to gateway to send the message out. if that is the case, is there a way i can set a delay on when it sends the email, say 10 seconds, ….

        You are aware of the fact that the gateway isn't down at all ? It's unreachable, because your WAN link is down.
        Sending mails - or doing what so ever - at that moment isn't possible.
        The mail will leave the system some time after the links comes up again. Don't know what "some time is" (should read the manual for that - can't figure it out walking through /etc/inc/notices.php).

        @timbot18:

        so it fails to the other gateway?

        You have two WAN connections ?

        @robi : You're probably right : an smtp message that can't be relayed to a server won't be cached for later retry.

        No "help me" PM's please. Use the forum, the community will thank you.
        Edit : and where are the logs ??

        1 Reply Last reply Reply Quote 0
        • J
          jimp Rebel Alliance Developer Netgate
          last edited by Feb 26, 2018, 4:58 PM

          2.4.3 has significant changes in notification handling, it's worth another shot there.

          But you should also enable default gateway switching if you haven't yet.

          Remember: Upvote with the 👍 button for any user/post you find to be helpful, informative, or deserving of recognition!

          Need help fast? Netgate Global Support!

          Do not Chat/PM for help!

          1 Reply Last reply Reply Quote 0
          • T
            timbot18
            last edited by Feb 26, 2018, 6:04 PM

            @Gertjan: sorry, yes i have two wan connections. i was referring to them as they are in the status/gateways and the gateway groups. i have one on tier 1, and the other on tier 2, so it should fail over (which it does). the problem is the gateway down notification. i never receive those, only gateway up notifications:

            MONITOR: WANGW is available now, adding to routing group WAN_Group 8.8.8.8

            @jimp: i'll set default gateway switching and if that doesnt help will try 2.4.3.

            1 Reply Last reply Reply Quote 0
            1 out of 5
            • First post
              1/5
              Last post
            Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.
              This community forum collects and processes your personal information.
              consent.not_received