Email Alert for CPU Temperature



  • 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.





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



  • @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.



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



  • 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).



  • 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



  • @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.


Log in to reply