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

mailreport - extra 'boot completed' time option?

pfSense Packages
mailreport
4
9
1.1k
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 Jul 14, 2021, 12:48 AM

    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 G 2 Replies Last reply Jul 14, 2021, 10:44 AM Reply Quote 0
    • V
      viragomann @incith
      last edited by Jul 14, 2021, 10:44 AM

      @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
      • G
        Gertjan @incith
        last edited by Jul 14, 2021, 10:46 AM

        @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
        • P
          provels
          last edited by Jul 14, 2021, 12:38 PM

          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 G 2 Replies Last reply Jul 14, 2021, 12:43 PM Reply Quote 0
          • V
            viragomann @provels
            last edited by Jul 14, 2021, 12:43 PM

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

            P 1 Reply Last reply Jul 14, 2021, 1:01 PM Reply Quote 0
            • P
              provels @viragomann
              last edited by Jul 14, 2021, 1:01 PM

              @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
              • G
                Gertjan @provels
                last edited by Gertjan Jul 14, 2021, 1:42 PM Jul 14, 2021, 1:41 PM

                @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 ??

                P 1 Reply Last reply Jul 14, 2021, 1:58 PM Reply Quote 0
                • P
                  provels @Gertjan
                  last edited by provels Jul 14, 2021, 2:05 PM Jul 14, 2021, 1:58 PM

                  @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)

                  G 1 Reply Last reply Jul 14, 2021, 2:27 PM Reply Quote 0
                  • G
                    Gertjan @provels
                    last edited by Jul 14, 2021, 2:27 PM

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