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

    mailreport - extra 'boot completed' time option?

    Scheduled Pinned Locked Moved pfSense Packages
    mailreport
    9 Posts 4 Posters 1.2k 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.
    • I
      incith
      last edited by

      I'd love to see the ability to send an email 'boot completed', this would be immensely helpful to send diagnostic information e.g. IP info etc after a reboot from the mailreport package directly. If this isn't the right place for suggestions I apologize!

      V GertjanG 2 Replies Last reply Reply Quote 0
      • V
        viragomann @incith
        last edited by

        @incith
        You can configure a report mail, save it and edit the cron entry to be processed on bootup after.

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

          @incith

          What about the shellcmd package ?

          You can write a simple script that includes whatever you want, and send the mail using the pfSense mail notification system.

          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
          • provelsP
            provels
            last edited by

            I get a "bootup complete" message, but darned if I can figure out where it's switched on. If not in the GUI, must be some script I read about here.

            Peder

            MAIN - pfSense+ 24.11-RELEASE - Adlink MXE-5401, i7, 16 GB RAM, 64 GB SSD. 500 GB HDD for SyslogNG
            BACKUP - pfSense+ 23.01-RELEASE - Hyper-V Virtual Machine, Gen 1, 2 v-CPUs, 3 GB RAM, 8GB VHDX (Dynamic)

            V GertjanG 2 Replies Last reply Reply Quote 0
            • V
              viragomann @provels
              last edited by

              @provels
              I guess, you're talking about that script @Gertjan described here.

              provelsP 1 Reply Last reply Reply Quote 0
              • provelsP
                provels @viragomann
                last edited by

                @viragomann
                I don't think so. I just built myself a fresh 2.5.2 yesterday and only imported my config.xml. Must be in there somewhere, just not seeing it.

                Peder

                MAIN - pfSense+ 24.11-RELEASE - Adlink MXE-5401, i7, 16 GB RAM, 64 GB SSD. 500 GB HDD for SyslogNG
                BACKUP - pfSense+ 23.01-RELEASE - Hyper-V Virtual Machine, Gen 1, 2 v-CPUs, 3 GB RAM, 8GB VHDX (Dynamic)

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

                  @provels said in mailreport - extra 'boot completed' time option?:

                  but darned if I can figure out where it's switched on

                  pfSense physically ?
                  That would be like remembering things before your parents got the idea of 'instantiating' you.

                  pfSense wasn't there was it was put on neither.

                  Or do you mean : an example of the script ?
                  Sure :

                  <?php
                  
                    require_once("pkg-utils.inc");
                    require_once("notices.inc");
                    require_once("util.inc");
                  
                    $msg ="Put in here whatever you want.\n";
                    $msg .="You can even use known variables from the config or 'g' array\n";  
                  
                    if (!empty($msg)) {
                      notify_via_smtp($msg);
                    }
                  
                  //  log_error("StarCmd == bootup Mail send");
                  
                  ?>
                  

                  Your only limitation is your imagination ;)

                  Put this file in /root/yourboot.php

                  Create a Startcmd entry like :
                  /usr/local/bin/php-cgi -f /root/yourboot.php

                  Type is startcmd, not earlycmd

                  And your good.

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

                  provelsP 1 Reply Last reply Reply Quote 0
                  • provelsP
                    provels @Gertjan
                    last edited by provels

                    @gertjan
                    Sorry if I wasn't clear. I already get a "bootup complete" email notification. Maybe it's built-in to the stock notifications if they are configured, as I made no config changes after building a new VM. Only restored my config.xml.

                    Or perhaps I misunderstood the original poster. Always a possibility.

                    Peder

                    MAIN - pfSense+ 24.11-RELEASE - Adlink MXE-5401, i7, 16 GB RAM, 64 GB SSD. 500 GB HDD for SyslogNG
                    BACKUP - pfSense+ 23.01-RELEASE - Hyper-V Virtual Machine, Gen 1, 2 v-CPUs, 3 GB RAM, 8GB VHDX (Dynamic)

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

                      @provels said in mailreport - extra 'boot completed' time option?:

                      I already get a "bootup complete" email notification.

                      We all do.
                      That is, if the notification system has at least one of the smtp/telegram/whatever already working.

                      It's the last line of the all might /etc/rc.bootup that sends this notification message. It's this file that tells pfSense that it is pfSense and not some vanilla 'FreeBSD' device.

                      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 1
                      • First post
                        Last post
                      Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.