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

    Send an email when the gateway falls

    Scheduled Pinned Locked Moved General pfSense Questions
    7 Posts 6 Posters 1.7k 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.
    • A
      azelie
      last edited by

      The work of 2 providers is configured, I would like to receive an e-mail in case of problems with one of them. For example, if the gateway is offline for more than 5 minutes, send an email. Now we are trying to configure this through a script that reads gateways.log through cron, a problem with sending out for lack of sendmail.
      PfSense is installed on several servers and we would not like to have files that will not be included in the backup.

      1 Reply Last reply Reply Quote 0
      • GertjanG
        Gertjan
        last edited by

        @azelie:

        ….
        PfSense is installed on several servers and we would not like to have files that will not be included in the backup.

        Then no, pfSense has no such facility on-board.
        Special demands need special code (lines)  ;)

        But, I do receive a mail when my pfSense becomes unreachable - and even with just ONE ( 1 !) WAN interface.
        I check from the outside  ;) https://www.test-domaine.fr/munin/brit-hotel-fumel.net/pfsense.brit-hotel-fumel.net/index.html
        Munin dials in every 5 minutes for chart updates, and when it times out, he will call Houston (that's me).

        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
        • D
          DanC
          last edited by

          I use UptimeRobot for this.  It's free.

          https://uptimerobot.com/

          1 Reply Last reply Reply Quote 0
          • johnpozJ
            johnpoz LAYER 8 Global Moderator
            last edited by

            What if both your gateways are down?  How do you get the email ;)

            As mentioned easier and more reliable to test from outside or some sort of out of band system.  I use domotz and multiple outside monitors.. If my connection goes down I hear about it on my phone via app push, via sms via email, etc.

            No reason to re-invent the wheel for this sort of monitoring.

            An intelligent man is sometimes forced to be drunk to spend time with his fools
            If you get confused: Listen to the Music Play
            Please don't Chat/PM me for help, unless mod related
            SG-4860 24.11 | Lab VMs 2.8, 24.11

            1 Reply Last reply Reply Quote 0
            • A
              azelie
              last edited by

              From the outside, you will not be able to watch due to the fact that not all external interfaces have a permanent IP, and some are behind NAT.

              1 Reply Last reply Reply Quote 0
              • MikeV7896M
                MikeV7896
                last edited by

                For public IP addresses, use dynamic DNS with a static hostname then… the router will update the hostname with the correct IP address if/when it changes.

                Not sure of a way to handle it if your carrier is using NAT. Maybe see if they have IPv6 available also, and use that instead as your down-detector?

                The S in IOT stands for Security

                1 Reply Last reply Reply Quote 0
                • N
                  nycfly
                  last edited by

                  Are you not using gateway groups? It's a standard pfSense notification whenever a gateway in a gateway group goes up or down:

                  TMOBILE_DHCP is down, omitting from routing group FIOS_to_TMOBILE
                  8.8.8.8|192.168.0.254|TMOBILE_DHCP|982.895ms|1995.669ms|0.0%|down

                  1 Reply Last reply Reply Quote 0
                  • First post
                    Last post
                  Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.