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

    Email Alert for CPU Temperature

    Scheduled Pinned Locked Moved General pfSense Questions
    8 Posts 3 Posters 998 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.
    • B
      barakath
      last edited by

      Hi all,
      Need your help email alert for CPU temperature. Currently in dashboard its showing but i need email alert once the zone warning reached. Enabled notifications currently receiving alerts for link down or up & reboot.

      1 Reply Last reply Reply Quote 0
      • viktor_gV
        viktor_g Netgate
        last edited by

        You can check this topic: https://forum.netgate.com/topic/103311/temperature-alert-script

        1 Reply Last reply Reply Quote 0
        • B
          barakath
          last edited by

          Hi Viktor,
          In these forum they told to edit notices.inc its not create an issue because pfsense is in live.
          And in which path i need to upload that .sh script file?

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

            @barakath said in Email Alert for CPU Temperature:

            And in which path i need to upload that .sh script file?

            Where ever you want.
            Typically, into the /root/ folder.

            Install also the cron package, and set up a 'cron' that calls your shell scripts file every X minutes.
            Be careful : the script will send a mail every X minutes when the temperature to is high.

            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
            • B
              barakath
              last edited by

              Hi Gertjan,
              So no need to edit notices.inc? Upload the script file and add to cron was enough?

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

                Check line 24 in the file /etc/inc/notices.inc ;)

                Upload the script into /root/ - name it, for example, temp.sh
                Be careful not to upload it which a character setting like UTF8 or something like that. It should be UNIX encoded.
                Also, make it executable using

                chmod +x /root/temp.sh
                

                Then, create a cron entry using the cron package. Use the full path to the script file as the command : /root/temp.sh

                To test drive the script : edit it, and set

                alert=55
                

                to something like

                alert=0
                

                which means you should receive mails every X minutes (Not if you're running pfSense in a fridge).

                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
                • B
                  barakath
                  last edited by

                  Hi Gertjan,
                  Thanks for your reply. How can i upload that script file. It's possible do via Diagnostics--> Edit file.

                  Please give me the steps it's best.

                  Thanks in advance

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

                    @barakath said in Email Alert for CPU Temperature:

                    Diagnostics--> Edit file.

                    Look at it, then never look or even use that option again.

                    To see / load / upload to any device - not just pfSense, but any device around you (Phones, VCR, Access Points, wall clock, coffee machine, you name it), use a SFTP (example : WINSCP, or the far superior SmartFP) to access you pfSense over port 22.
                    Also : activate the SSH access.
                    While you're at it, test also the console access, which show the same info / same access.

                    Also, install Putty (windows SSH client - MAC users have a SSH client build in).

                    Ones you have access, install a descend text editor like 'nano' (or use the good old build in editor 'vi'):

                    pkg install nano
                    

                    Copy the file using select in the Github windows and Ctrl-C - from here https://gist.githubusercontent.com/JMac87/1303f78c56a54165447568318eeca3b3/raw/8eaf407f0aa90d0134be12b51c0996bf9337da70/cpu_temp_alert.sh (the 'raw' view).

                    Then, on pfSense, - login menu option 8 - open non exiting filer with nano like :

                    nano /root/temp.sh
                    

                    and then paste ( Ctrl-V) the script.
                    Ctrl-O to write the file, Ctrl-X to exit nano.
                    'chmod' the file (see above).
                    etc etc.

                    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.