luckman212 / pfsense-temp-alert

Send email alerts if things get too toasty inside your firewall
4 stars 0 forks source link

Unable to get working #1

Closed dastrix80 closed 1 year ago

dastrix80 commented 1 year ago

Hi there, thanks for writing this! Im trying to use it but I cant get an alert.

My email alert in pfsense works correctly as a test.

I've copied the contents of your script, into the same file name and used chmod. I have no root/bin, so I've got this instead:

[2.6.0-RELEASE][admin@pfSense.home.arpa]/root: ls -la total 40 drwxr-xr-x 2 root wheel 512 Jan 4 13:04 . drwxr-xr-x 22 root wheel 1024 Dec 19 21:58 .. -rw-r--r-- 2 root wheel 1023 Feb 1 2022 .cshrc -rw-r--r-- 1 root wheel 0 Jan 4 12:05 .hushlogin -rw-r--r-- 1 root wheel 80 Feb 1 2022 .k5login -rw-r--r-- 1 root wheel 328 Feb 1 2022 .login -rw-r--r-- 2 root wheel 1067 Jan 4 12:05 .profile -rw------- 1 root wheel 1024 Jan 4 13:03 .rnd -rw-r--r-- 1 root wheel 1943 Jan 4 12:05 .shrc -rw-r--r-- 1 root wheel 3090 Jan 4 12:05 .tcshrc -rwxr-xr-x 1 root wheel 1452 Jan 4 12:28 temp_alert.php [2.6.0-RELEASE][admin@pfSense.home.arpa]/root:

Any suggestions? I lowered the temp to 35 to do a test but nada.

Attached is my cron

Screenshot 2023-01-04 at 13-12-21 pfSense home arpa - Services Cron Settings

Cheers

luckman212 commented 1 year ago

Go to console or ssh in and select option 8.

Then type /root/temp_alert.php and post the output here

dastrix80 commented 1 year ago

Thanks Luke, I got no output :(

[2.6.0-RELEASE][admin@pfSense.home.arpa]/root: /root/temp_alert.php [2.6.0-RELEASE][admin@pfSense.home.arpa]/root:

luckman212 commented 1 year ago

Okay, next we need to check your sensors. Run this from the console:

sysctl -a | grep temperature

What platform are you running your pfSense on? Is this Netgate hardware, or something else? Virtual machine?

dastrix80 commented 1 year ago

Thanks Luke, its a HP desktop (intel)

[2.6.0-RELEASE][admin@pfSense.home.arpa]/root: sysctl -a | grep temperature hw.acpi.thermal.tz1.temperature: 29.9C hw.acpi.thermal.tz0.temperature: 27.9C dev.cpu.7.temperature: 35.0C dev.cpu.6.temperature: 35.0C dev.cpu.5.temperature: 36.0C dev.cpu.4.temperature: 37.0C dev.cpu.3.temperature: 43.0C dev.cpu.2.temperature: 43.0C dev.cpu.1.temperature: 40.0C dev.cpu.0.temperature: 40.0C

luckman212 commented 1 year ago

@dastrix80 I added some debug logging and uploaded a new version of the script.

Can you download this new version and give it a try? It should pinpoint where the problem is. Specifically, after the script runs, there should be a log file at /tmp/temp_alert.log

Can you drop to a console and execute the following commands, and paste all the output here?

/root/temp_alert.php
cat /tmp/temp_alert.log
dastrix80 commented 1 year ago

Thank you! Ive put the new script in and run the commands

[2.6.0-RELEASE][admin@pfSense.home.arpa]/root: /root/temp_alert.php /root/temp_alert.php: 1: Syntax error: word unexpected (expecting ")")

No file has been created for the log as yet, will report back if its created once cron runs

luckman212 commented 1 year ago

No need to wait for the cron... if you're getting a Syntax error when trying to execute the script, then something's gone wrong in the copy/paste or however you saved the file.

Try downloading the script directly from the firewall itself by executing this command at the console shell (option 8):

fetch -o /root/temp_alert.php https://raw.githubusercontent.com/luckman212/pfsense-temp-alert/main/temp_alert.php
dastrix80 commented 1 year ago

fetch -o /root/temp_alert.php https://raw.githubusercontent.com/luckman212/pfsense-temp-alert/main/temp_alert.php

Likely, OK , have downloaded that and can see it there. Updated the temp value, chmod etc

Looks good from the log point of view!

[2.6.0-RELEASE][admin@pfSense.home.arpa]/tmp: cat temp_alert.log [05-Jan-2023 08:40:46 Australia/Sydney] === script begin === [05-Jan-2023 08:40:46 Australia/Sydney] no sensor specified, trying to auto-detect [05-Jan-2023 08:40:46 Australia/Sydney] temp: 36 alarm_temp: 30 alarm state: 1 [05-Jan-2023 08:40:46 Australia/Sydney] in do_notify(): alarm_temp=30 temp=36 alarm=1 [05-Jan-2023 08:40:46 Australia/Sydney] alarm state is true but notification was already sent (sentinel exists) [05-Jan-2023 08:40:46 Australia/Sydney] === script end ===

Ive got it set to 30, nothing new in the log after waiting for cron

luckman212 commented 1 year ago

Ok nice, logs are looking good now.

Only problem is you've got a stale sentinel file that must have been leftover from a previous failed run or corrupt script.

Just delete /tmp/temp_alarm from the console:

rm /tmp/temp_alarm

And then you should be good to go...

dastrix80 commented 1 year ago

Closer! :)

[05-Jan-2023 12:40:35 Australia/Sydney] === script begin === [05-Jan-2023 12:40:35 Australia/Sydney] no sensor specified, trying to auto-detect [05-Jan-2023 12:40:35 Australia/Sydney] temp: 42 alarm_temp: 30 alarm state: 1 [05-Jan-2023 12:40:35 Australia/Sydney] in do_notify(): alarm_temp=30 temp=42 alarm=1 [05-Jan-2023 12:40:35 Australia/Sydney] alarm state changing from false to true, notification will be sent [05-Jan-2023 12:40:35 Australia/Sydney] sending notification via smtp: Temperature of dev.cpu.3.temperature (42C) exceeded alarm threshold (30C) [05-Jan-2023 12:40:35 Australia/Sydney] PHP Notice: Undefined index: booting in /etc/inc/globals.inc on line 194 [05-Jan-2023 12:40:35 Australia/Sydney] === script end ===

luckman212 commented 1 year ago

Ok, that looks "good" - I get the same warning from /etc/inc/globals.inc (it's a side effect of having the extra PHP debug logging enabled)

According to the log above, you should have received an email alert if your SMTP config is valid in the pfSense GUI. Did you not get it? Check your spam folder?

dastrix80 commented 1 year ago

It runs every 5 but no email and then the sentinel issue reappears. Ive updated the google app password, sent a test and that worked but after 5mins, no email.

[2.6.0-RELEASE][admin@pfSense.home.arpa]/tmp: cat temp_alert.log [05-Jan-2023 13:00:00 Australia/Sydney] === script begin === [05-Jan-2023 13:00:00 Australia/Sydney] no sensor specified, trying to auto-detect [05-Jan-2023 13:00:00 Australia/Sydney] temp: 49 alarm_temp: 30 alarm state: 1 [05-Jan-2023 13:00:00 Australia/Sydney] in do_notify(): alarm_temp=30 temp=49 alarm=1 [05-Jan-2023 13:00:00 Australia/Sydney] alarm state changing from false to true, notification will be sent [05-Jan-2023 13:00:00 Australia/Sydney] sending notification via smtp: Temperature of dev.cpu.3.temperature (49C) exceeded alarm threshold (30C) [05-Jan-2023 13:00:00 Australia/Sydney] PHP Notice: Undefined index: booting in /etc/inc/globals.inc on line 194 [05-Jan-2023 13:00:00 Australia/Sydney] === script end ===

[05-Jan-2023 13:05:00 Australia/Sydney] === script begin === [05-Jan-2023 13:05:00 Australia/Sydney] no sensor specified, trying to auto-detect [05-Jan-2023 13:05:00 Australia/Sydney] temp: 48 alarm_temp: 30 alarm state: 1 [05-Jan-2023 13:05:00 Australia/Sydney] in do_notify(): alarm_temp=30 temp=48 alarm=1 [05-Jan-2023 13:05:00 Australia/Sydney] alarm state is true but notification was already sent (sentinel exists) [05-Jan-2023 13:05:00 Australia/Sydney] === script end ===

[05-Jan-2023 13:10:00 Australia/Sydney] === script begin === [05-Jan-2023 13:10:00 Australia/Sydney] no sensor specified, trying to auto-detect [05-Jan-2023 13:10:00 Australia/Sydney] temp: 49 alarm_temp: 30 alarm state: 1 [05-Jan-2023 13:10:00 Australia/Sydney] in do_notify(): alarm_temp=30 temp=49 alarm=1 [05-Jan-2023 13:10:00 Australia/Sydney] alarm state is true but notification was already sent (sentinel exists) [05-Jan-2023 13:10:00 Australia/Sydney] === script end ===

[05-Jan-2023 13:15:00 Australia/Sydney] === script begin === [05-Jan-2023 13:15:00 Australia/Sydney] no sensor specified, trying to auto-detect [05-Jan-2023 13:15:00 Australia/Sydney] temp: 47 alarm_temp: 30 alarm state: 1 [05-Jan-2023 13:15:00 Australia/Sydney] in do_notify(): alarm_temp=30 temp=47 alarm=1 [05-Jan-2023 13:15:00 Australia/Sydney] alarm state is true but notification was already sent (sentinel exists) [05-Jan-2023 13:15:00 Australia/Sydney] === script end ===

luckman212 commented 1 year ago

You said in the beginning that your SMTP notifications were working, right? i.e. you can send a test email from the Notifications -> Test SMTP button?

Also, what's in your regular System Log after the script runs? tail -n 100 /var/log/system.log or a screenshot from the GUI might help.

dastrix80 commented 1 year ago

Yes, tests work. Its weird as hell, now I'm not seeing any logs related to the SMTP message nor it even running every 5mins

Screenshot 2023-01-06 at 09-32-47 pfSense home arpa - Services Cron Settings Screenshot 2023-01-06 at 09-32-15 pfSense home arpa - System Advanced Notifications

luckman212 commented 1 year ago

Repeating - can you post the below detail

what's in your regular System Log after the script runs? tail -n 100 /var/log/system.log or a screenshot from the GUI (system log page) might help.

dastrix80 commented 1 year ago

Sorry my apologies, seems the script isnt running

syslog

luckman212 commented 1 year ago

You won't really see any evidence of the script running in the regular system log anymore. I moved all the logging to the debug log at /tmp/temp_alert.log. You should however be seeing a message about the SMTP message going out (or failing to).

Can you try executing this line of code from your console option 8 and let me know if you receive the test email? Also check your system log for any errors.

php -r 'include("notices.inc"); notify_via_smtp("test");'
luckman212 commented 1 year ago

Also, I uploaded a new version of the script, with some changes and slightly better logging. It also has the capability to automatically purge stale sentinel files after a selectable amount of time (default 1h).

Please download the latest one with fetch -o /root/temp_alert.php https://raw.githubusercontent.com/luckman212/pfsense-temp-alert/main/temp_alert.php and report back when you can.

dastrix80 commented 1 year ago

Thanks Luke, downloaded the new script and the tests came through with the PHP test command. Will monitor and let you know

dastrix80 commented 1 year ago

Not sure whats going on, the only way I get an email is via that test PHP command or via the Test Email button in the GUI. Even running it manually I dont get an entry in the system log in the GUI or an email

luckman212 commented 1 year ago

@dastrix80 What's the latest? Also, double checking: you did change the value of $alarm_temp = 58 at line 14 to your preferred value, correct?

dastrix80 commented 1 year ago

Hi sorry for the delay. Yes I updated the line but whilst the test email function works, I never receive the emails from the script :(

luckman212 commented 1 year ago

This is so mysterious.

Please run the following commands from the console and post the full output from that session.

tail -n200 /var/log/system.log
tail -n100 /tmp/temp_alert.log
stat /tmp/temp_alarm
stat /root/temp_alert.php
cat /tmp/temp_alarm
php -v
dastrix80 commented 1 year ago

Seems the alarms show, but no email :/

[2.6.0-RELEASE][root@pfSense.home.arpa]/root: tail -n200 /var/log/system.log Jan 11 07:16:00 pfSense sshguard[55903]: Exiting on signal. Jan 11 07:16:00 pfSense sshguard[1687]: Now monitoring attacks. Jan 11 07:28:00 pfSense sshguard[1687]: Exiting on signal. Jan 11 07:28:00 pfSense sshguard[70234]: Now monitoring attacks. Jan 11 07:40:00 pfSense sshguard[70234]: Exiting on signal. Jan 11 07:40:00 pfSense sshguard[44481]: Now monitoring attacks. Jan 11 07:41:46 pfSense kernel: arp: 192.168.0.62 moved from 00:03:ac:09:43:d4 to 00:06:c6:85:d9:39 on em1 Jan 11 07:51:00 pfSense sshguard[44481]: Exiting on signal. Jan 11 07:51:00 pfSense sshguard[66249]: Now monitoring attacks. Jan 11 08:00:00 pfSense php[75956]: [pfBlockerNG] Starting cron process. Jan 11 08:00:00 pfSense php[75956]: [pfBlockerNG] No changes to Firewall rules, skipping Filter Reload Jan 11 08:00:00 pfSense php[75956]: Jan 11 08:03:00 pfSense sshguard[66249]: Exiting on signal. Jan 11 08:03:00 pfSense sshguard[54705]: Now monitoring attacks. Jan 11 08:11:47 pfSense kernel: arp: 192.168.0.62 moved from 00:03:ac:09:43:d4 to 00:06:c6:85:d9:39 on em1 Jan 11 08:14:00 pfSense sshguard[54705]: Exiting on signal. Jan 11 08:14:00 pfSense sshguard[10742]: Now monitoring attacks. Jan 11 08:28:00 pfSense sshguard[10742]: Exiting on signal. Jan 11 08:28:00 pfSense sshguard[7000]: Now monitoring attacks. Jan 11 08:38:00 pfSense sshguard[7000]: Exiting on signal. Jan 11 08:38:00 pfSense sshguard[34334]: Now monitoring attacks. Jan 11 08:49:00 pfSense sshguard[34334]: Exiting on signal. Jan 11 08:49:00 pfSense sshguard[82692]: Now monitoring attacks. Jan 11 09:00:00 pfSense php[5798]: [pfBlockerNG] Starting cron process. Jan 11 09:00:00 pfSense php[5798]: [pfBlockerNG] No changes to Firewall rules, skipping Filter Reload Jan 11 09:00:00 pfSense php[5798]: Jan 11 09:02:00 pfSense sshguard[82692]: Exiting on signal. Jan 11 09:02:00 pfSense sshguard[59821]: Now monitoring attacks. Jan 11 09:14:00 pfSense sshguard[59821]: Exiting on signal. Jan 11 09:14:00 pfSense sshguard[32268]: Now monitoring attacks. Jan 11 09:25:00 pfSense sshguard[32268]: Exiting on signal. Jan 11 09:25:00 pfSense sshguard[84443]: Now monitoring attacks. Jan 11 09:26:47 pfSense kernel: arp: 192.168.0.62 moved from 00:03:ac:09:43:d4 to 00:06:c6:85:d9:39 on em1 Jan 11 09:37:00 pfSense sshguard[84443]: Exiting on signal. Jan 11 09:37:00 pfSense sshguard[44461]: Now monitoring attacks. Jan 11 09:49:00 pfSense sshguard[44461]: Exiting on signal. Jan 11 09:49:00 pfSense sshguard[14962]: Now monitoring attacks. Jan 11 09:56:47 pfSense kernel: arp: 192.168.0.62 moved from 00:03:ac:09:43:d4 to 00:06:c6:85:d9:39 on em1 Jan 11 10:00:00 pfSense php[71055]: [pfBlockerNG] Starting cron process. Jan 11 10:00:00 pfSense php[71055]: [pfBlockerNG] No changes to Firewall rules, skipping Filter Reload Jan 11 10:00:00 pfSense php[71055]: Jan 11 10:02:00 pfSense sshguard[14962]: Exiting on signal. Jan 11 10:02:00 pfSense sshguard[25275]: Now monitoring attacks. Jan 11 10:14:00 pfSense sshguard[25275]: Exiting on signal. Jan 11 10:14:00 pfSense sshguard[71090]: Now monitoring attacks. Jan 11 10:28:00 pfSense sshguard[71090]: Exiting on signal. Jan 11 10:28:00 pfSense sshguard[93238]: Now monitoring attacks. Jan 11 10:40:00 pfSense sshguard[93238]: Exiting on signal. Jan 11 10:40:00 pfSense sshguard[47848]: Now monitoring attacks. Jan 11 10:53:00 pfSense sshguard[47848]: Exiting on signal. Jan 11 10:53:00 pfSense sshguard[34591]: Now monitoring attacks. Jan 11 11:00:00 pfSense php[94004]: [pfBlockerNG] Starting cron process. Jan 11 11:00:01 pfSense php[94004]: [pfBlockerNG] No changes to Firewall rules, skipping Filter Reload Jan 11 11:00:01 pfSense php[94004]: Jan 11 11:05:00 pfSense sshguard[34591]: Exiting on signal. Jan 11 11:05:00 pfSense sshguard[15861]: Now monitoring attacks. Jan 11 11:11:47 pfSense kernel: arp: 192.168.0.62 moved from 00:03:ac:09:43:d4 to 00:06:c6:85:d9:39 on em1 Jan 11 11:18:00 pfSense sshguard[15861]: Exiting on signal. Jan 11 11:18:00 pfSense sshguard[87962]: Now monitoring attacks. Jan 11 11:30:00 pfSense sshguard[87962]: Exiting on signal. Jan 11 11:30:00 pfSense sshguard[61835]: Now monitoring attacks. Jan 11 11:41:47 pfSense kernel: arp: 192.168.0.62 moved from 00:03:ac:09:43:d4 to 00:06:c6:85:d9:39 on em1 Jan 11 11:42:00 pfSense sshguard[61835]: Exiting on signal. Jan 11 11:42:00 pfSense sshguard[25672]: Now monitoring attacks. Jan 11 11:56:00 pfSense sshguard[25672]: Exiting on signal. Jan 11 11:56:00 pfSense sshguard[20495]: Now monitoring attacks. Jan 11 12:00:00 pfSense php[10723]: [pfBlockerNG] Starting cron process. Jan 11 12:00:00 pfSense php[10723]: [pfBlockerNG] No changes to Firewall rules, skipping Filter Reload Jan 11 12:00:00 pfSense php[10723]: Jan 11 12:08:00 pfSense sshguard[20495]: Exiting on signal. Jan 11 12:08:00 pfSense sshguard[3918]: Now monitoring attacks. Jan 11 12:19:00 pfSense sshguard[3918]: Exiting on signal. Jan 11 12:19:00 pfSense sshguard[51909]: Now monitoring attacks. Jan 11 12:30:00 pfSense php[79725]: rc.update_urltables: /etc/rc.update_urltables: Starting up. Jan 11 12:30:00 pfSense php[79725]: rc.update_urltables: /etc/rc.update_urltables: Sleeping for 12 seconds. Jan 11 12:30:12 pfSense php[79725]: rc.update_urltables: /etc/rc.update_urltables: Starting URL table alias updates Jan 11 12:30:12 pfSense php[79725]: rc.update_urltables: /etc/rc.update_urltables: pfB_DNSBLIP does not need updating. Jan 11 12:30:12 pfSense php[79725]: rc.update_urltables: /etc/rc.update_urltables: pfB_Oceania_v4 does not need updating. Jan 11 12:30:12 pfSense php[79725]: rc.update_urltables: /etc/rc.update_urltables: pfB_Oceania_v6 does not need updating. Jan 11 12:31:00 pfSense sshguard[51909]: Exiting on signal. Jan 11 12:31:00 pfSense sshguard[2951]: Now monitoring attacks. Jan 11 12:45:00 pfSense sshguard[2951]: Exiting on signal. Jan 11 12:45:00 pfSense sshguard[29736]: Now monitoring attacks. Jan 11 12:56:48 pfSense kernel: arp: 192.168.0.62 moved from 00:03:ac:09:43:d4 to 00:06:c6:85:d9:39 on em1 Jan 11 12:57:00 pfSense sshguard[29736]: Exiting on signal. Jan 11 12:57:00 pfSense sshguard[7368]: Now monitoring attacks. Jan 11 13:00:00 pfSense php[54302]: [pfBlockerNG] Starting cron process. Jan 11 13:00:00 pfSense php[54302]: [pfBlockerNG] No changes to Firewall rules, skipping Filter Reload Jan 11 13:00:00 pfSense php[54302]: Jan 11 13:01:00 pfSense sshguard[7368]: Exiting on signal. Jan 11 13:01:00 pfSense sshguard[84853]: Now monitoring attacks. Jan 11 13:10:00 pfSense sshguard[84853]: Exiting on signal. Jan 11 13:10:00 pfSense sshguard[78986]: Now monitoring attacks. Jan 11 13:24:00 pfSense sshguard[78986]: Exiting on signal. Jan 11 13:24:00 pfSense sshguard[2702]: Now monitoring attacks. Jan 11 13:26:48 pfSense kernel: arp: 192.168.0.62 moved from 00:03:ac:09:43:d4 to 00:06:c6:85:d9:39 on em1 Jan 11 13:36:00 pfSense sshguard[2702]: Exiting on signal. Jan 11 13:36:00 pfSense sshguard[54369]: Now monitoring attacks. Jan 11 13:49:00 pfSense sshguard[54369]: Exiting on signal. Jan 11 13:49:00 pfSense sshguard[52954]: Now monitoring attacks. Jan 11 14:00:00 pfSense php[636]: [pfBlockerNG] Starting cron process. Jan 11 14:00:00 pfSense php[636]: [pfBlockerNG] No changes to Firewall rules, skipping Filter Reload Jan 11 14:00:00 pfSense php[636]: Jan 11 14:02:00 pfSense sshguard[52954]: Exiting on signal. Jan 11 14:02:00 pfSense sshguard[54231]: Now monitoring attacks. Jan 11 14:15:00 pfSense sshguard[54231]: Exiting on signal. Jan 11 14:15:00 pfSense sshguard[22976]: Now monitoring attacks. Jan 11 14:26:00 pfSense sshguard[22976]: Exiting on signal. Jan 11 14:26:00 pfSense sshguard[69962]: Now monitoring attacks. Jan 11 14:38:00 pfSense sshguard[69962]: Exiting on signal. Jan 11 14:38:00 pfSense sshguard[44223]: Now monitoring attacks. Jan 11 14:41:48 pfSense kernel: arp: 192.168.0.62 moved from 00:03:ac:09:43:d4 to 00:06:c6:85:d9:39 on em1 Jan 11 14:50:00 pfSense sshguard[44223]: Exiting on signal. Jan 11 14:50:00 pfSense sshguard[4137]: Now monitoring attacks. Jan 11 15:00:00 pfSense php[38237]: [pfBlockerNG] Starting cron process. Jan 11 15:00:00 pfSense php[38237]: [pfBlockerNG] No changes to Firewall rules, skipping Filter Reload Jan 11 15:00:00 pfSense php[38237]: Jan 11 15:02:00 pfSense sshguard[4137]: Exiting on signal. Jan 11 15:02:00 pfSense sshguard[91153]: Now monitoring attacks. Jan 11 15:11:48 pfSense kernel: arp: 192.168.0.62 moved from 00:03:ac:09:43:d4 to 00:06:c6:85:d9:39 on em1 Jan 11 15:14:00 pfSense sshguard[91153]: Exiting on signal. Jan 11 15:14:00 pfSense sshguard[60637]: Now monitoring attacks. Jan 11 15:28:00 pfSense sshguard[60637]: Exiting on signal. Jan 11 15:28:00 pfSense sshguard[57422]: Now monitoring attacks. Jan 11 15:37:00 pfSense sshguard[57422]: Exiting on signal. Jan 11 15:37:00 pfSense sshguard[59111]: Now monitoring attacks. Jan 11 15:40:00 pfSense sshguard[59111]: Exiting on signal. Jan 11 15:40:00 pfSense sshguard[28431]: Now monitoring attacks. Jan 11 15:53:00 pfSense sshguard[28431]: Exiting on signal. Jan 11 15:53:00 pfSense sshguard[20581]: Now monitoring attacks. Jan 11 16:00:00 pfSense php[67326]: [pfBlockerNG] Starting cron process. Jan 11 16:00:01 pfSense php[67326]: [pfBlockerNG] No changes to Firewall rules, skipping Filter Reload Jan 11 16:00:01 pfSense php[67326]: Jan 11 16:06:00 pfSense sshguard[20581]: Exiting on signal. Jan 11 16:06:00 pfSense sshguard[11963]: Now monitoring attacks. Jan 11 16:18:00 pfSense sshguard[11963]: Exiting on signal. Jan 11 16:18:00 pfSense sshguard[79416]: Now monitoring attacks. Jan 11 16:26:48 pfSense kernel: arp: 192.168.0.62 moved from 00:03:ac:09:43:d4 to 00:06:c6:85:d9:39 on em1 Jan 11 16:30:00 pfSense sshguard[79416]: Exiting on signal. Jan 11 16:30:00 pfSense sshguard[33323]: Now monitoring attacks. Jan 11 16:43:00 pfSense sshguard[33323]: Exiting on signal. Jan 11 16:43:00 pfSense sshguard[33721]: Now monitoring attacks. Jan 11 16:55:00 pfSense sshguard[33721]: Exiting on signal. Jan 11 16:55:00 pfSense sshguard[13947]: Now monitoring attacks. Jan 11 16:56:49 pfSense kernel: arp: 192.168.0.62 moved from 00:03:ac:09:43:d4 to 00:06:c6:85:d9:39 on em1 Jan 11 17:00:00 pfSense php[28508]: [pfBlockerNG] Starting cron process. Jan 11 17:00:00 pfSense php[28508]: [pfBlockerNG] No changes to Firewall rules, skipping Filter Reload Jan 11 17:00:00 pfSense php[28508]: Jan 11 17:08:00 pfSense sshguard[13947]: Exiting on signal. Jan 11 17:08:00 pfSense sshguard[96672]: Now monitoring attacks. Jan 11 17:21:00 pfSense sshguard[96672]: Exiting on signal. Jan 11 17:21:00 pfSense sshguard[95203]: Now monitoring attacks. Jan 11 17:34:00 pfSense sshguard[95203]: Exiting on signal. Jan 11 17:34:00 pfSense sshguard[91442]: Now monitoring attacks. Jan 11 17:46:00 pfSense sshguard[91442]: Exiting on signal. Jan 11 17:46:00 pfSense sshguard[42024]: Now monitoring attacks. Jan 11 18:00:00 pfSense sshguard[42024]: Exiting on signal. Jan 11 18:00:00 pfSense sshguard[64570]: Now monitoring attacks. Jan 11 18:00:00 pfSense php[62349]: [pfBlockerNG] Starting cron process. Jan 11 18:00:00 pfSense php[62349]: [pfBlockerNG] No changes to Firewall rules, skipping Filter Reload Jan 11 18:00:00 pfSense php[62349]: Jan 11 18:11:00 pfSense sshguard[64570]: Exiting on signal. Jan 11 18:11:00 pfSense sshguard[16490]: Now monitoring attacks. Jan 11 18:11:48 pfSense kernel: arp: 192.168.0.62 moved from 00:03:ac:09:43:d4 to 00:06:c6:85:d9:39 on em1 Jan 11 18:22:00 pfSense sshguard[16490]: Exiting on signal. Jan 11 18:22:00 pfSense sshguard[43311]: Now monitoring attacks. Jan 11 18:33:00 pfSense sshguard[43311]: Exiting on signal. Jan 11 18:33:00 pfSense sshguard[92630]: Now monitoring attacks. Jan 11 18:41:49 pfSense kernel: arp: 192.168.0.62 moved from 00:03:ac:09:43:d4 to 00:06:c6:85:d9:39 on em1 Jan 11 18:44:00 pfSense sshguard[92630]: Exiting on signal. Jan 11 18:44:00 pfSense sshguard[47159]: Now monitoring attacks. Jan 11 18:56:00 pfSense sshguard[47159]: Exiting on signal. Jan 11 18:56:00 pfSense sshguard[94420]: Now monitoring attacks. Jan 11 19:00:00 pfSense php[86004]: [pfBlockerNG] Starting cron process. Jan 11 19:00:00 pfSense php[86004]: [pfBlockerNG] No changes to Firewall rules, skipping Filter Reload Jan 11 19:00:00 pfSense php[86004]: Jan 11 19:07:00 pfSense sshguard[94420]: Exiting on signal. Jan 11 19:07:00 pfSense sshguard[50522]: Now monitoring attacks. Jan 11 19:19:00 pfSense sshguard[50522]: Exiting on signal. Jan 11 19:19:00 pfSense sshguard[22691]: Now monitoring attacks. Jan 11 19:29:00 pfSense sshguard[22691]: Exiting on signal. Jan 11 19:29:00 pfSense sshguard[30575]: Now monitoring attacks. Jan 11 19:40:00 pfSense sshguard[30575]: Exiting on signal. Jan 11 19:40:00 pfSense sshguard[80242]: Now monitoring attacks. Jan 11 19:51:00 pfSense sshguard[80242]: Exiting on signal. Jan 11 19:51:00 pfSense sshguard[34737]: Now monitoring attacks. Jan 11 19:56:49 pfSense kernel: arp: 192.168.0.62 moved from 00:03:ac:09:43:d4 to 00:06:c6:85:d9:39 on em1 Jan 11 20:00:00 pfSense php[27562]: [pfBlockerNG] Starting cron process. Jan 11 20:00:00 pfSense php[27562]: [pfBlockerNG] No changes to Firewall rules, skipping Filter Reload Jan 11 20:00:00 pfSense php[27562]: Jan 11 20:03:00 pfSense sshguard[34737]: Exiting on signal. Jan 11 20:03:00 pfSense sshguard[89769]: Now monitoring attacks. Jan 11 20:14:00 pfSense sshguard[89769]: Exiting on signal. Jan 11 20:14:00 pfSense sshguard[44750]: Now monitoring attacks. Jan 11 20:25:00 pfSense sshguard[44750]: Exiting on signal. Jan 11 20:25:00 pfSense sshguard[99072]: Now monitoring attacks. Jan 11 20:26:49 pfSense kernel: arp: 192.168.0.62 moved from 00:03:ac:09:43:d4 to 00:06:c6:85:d9:39 on em1 Jan 11 20:36:00 pfSense sshguard[99072]: Exiting on signal. Jan 11 20:36:00 pfSense sshguard[39623]: Now monitoring attacks. Jan 11 20:37:04 pfSense sshd[63600]: Accepted keyboard-interactive/pam for root from 192.168.0.10 port 51618 ssh2 [2.6.0-RELEASE][root@pfSense.home.arpa]/root: tail -n100 /tmp/temp_alert.log [11-Jan-2023 19:25:00 Australia/Sydney] === script end ===

[11-Jan-2023 19:30:00 Australia/Sydney] === script begin === [11-Jan-2023 19:30:00 Australia/Sydney] no sensor specified, trying to auto-detect [11-Jan-2023 19:30:00 Australia/Sydney] detected sensor: dev.cpu.3.temperature [11-Jan-2023 19:30:00 Australia/Sydney] in do_notify(): temp=47 alarm_temp=58 alarm=0 [11-Jan-2023 19:30:00 Australia/Sydney] alarm state is false; everything is OK [11-Jan-2023 19:30:00 Australia/Sydney] === script end ===

[11-Jan-2023 19:35:00 Australia/Sydney] === script begin === [11-Jan-2023 19:35:00 Australia/Sydney] no sensor specified, trying to auto-detect [11-Jan-2023 19:35:00 Australia/Sydney] detected sensor: dev.cpu.3.temperature [11-Jan-2023 19:35:00 Australia/Sydney] in do_notify(): temp=46 alarm_temp=58 alarm=0 [11-Jan-2023 19:35:00 Australia/Sydney] alarm state is false; everything is OK [11-Jan-2023 19:35:00 Australia/Sydney] === script end ===

[11-Jan-2023 19:40:00 Australia/Sydney] === script begin === [11-Jan-2023 19:40:00 Australia/Sydney] no sensor specified, trying to auto-detect [11-Jan-2023 19:40:00 Australia/Sydney] detected sensor: dev.cpu.3.temperature [11-Jan-2023 19:40:00 Australia/Sydney] in do_notify(): temp=47 alarm_temp=58 alarm=0 [11-Jan-2023 19:40:00 Australia/Sydney] alarm state is false; everything is OK [11-Jan-2023 19:40:00 Australia/Sydney] === script end ===

[11-Jan-2023 19:45:00 Australia/Sydney] === script begin === [11-Jan-2023 19:45:00 Australia/Sydney] no sensor specified, trying to auto-detect [11-Jan-2023 19:45:00 Australia/Sydney] detected sensor: dev.cpu.3.temperature [11-Jan-2023 19:45:00 Australia/Sydney] in do_notify(): temp=48 alarm_temp=58 alarm=0 [11-Jan-2023 19:45:00 Australia/Sydney] alarm state is false; everything is OK [11-Jan-2023 19:45:00 Australia/Sydney] === script end ===

[11-Jan-2023 19:50:00 Australia/Sydney] === script begin === [11-Jan-2023 19:50:00 Australia/Sydney] no sensor specified, trying to auto-detect [11-Jan-2023 19:50:00 Australia/Sydney] detected sensor: dev.cpu.3.temperature [11-Jan-2023 19:50:00 Australia/Sydney] in do_notify(): temp=46 alarm_temp=58 alarm=0 [11-Jan-2023 19:50:00 Australia/Sydney] alarm state is false; everything is OK [11-Jan-2023 19:50:00 Australia/Sydney] === script end ===

[11-Jan-2023 19:55:00 Australia/Sydney] === script begin === [11-Jan-2023 19:55:00 Australia/Sydney] no sensor specified, trying to auto-detect [11-Jan-2023 19:55:00 Australia/Sydney] detected sensor: dev.cpu.3.temperature [11-Jan-2023 19:55:00 Australia/Sydney] in do_notify(): temp=46 alarm_temp=58 alarm=0 [11-Jan-2023 19:55:00 Australia/Sydney] alarm state is false; everything is OK [11-Jan-2023 19:55:00 Australia/Sydney] === script end ===

[11-Jan-2023 20:00:00 Australia/Sydney] === script begin === [11-Jan-2023 20:00:00 Australia/Sydney] no sensor specified, trying to auto-detect [11-Jan-2023 20:00:00 Australia/Sydney] detected sensor: dev.cpu.3.temperature [11-Jan-2023 20:00:00 Australia/Sydney] in do_notify(): temp=47 alarm_temp=58 alarm=0 [11-Jan-2023 20:00:00 Australia/Sydney] alarm state is false; everything is OK [11-Jan-2023 20:00:00 Australia/Sydney] === script end ===

[11-Jan-2023 20:05:00 Australia/Sydney] === script begin === [11-Jan-2023 20:05:00 Australia/Sydney] no sensor specified, trying to auto-detect [11-Jan-2023 20:05:00 Australia/Sydney] detected sensor: dev.cpu.3.temperature [11-Jan-2023 20:05:00 Australia/Sydney] in do_notify(): temp=44 alarm_temp=58 alarm=0 [11-Jan-2023 20:05:00 Australia/Sydney] alarm state is false; everything is OK [11-Jan-2023 20:05:00 Australia/Sydney] === script end ===

[11-Jan-2023 20:10:00 Australia/Sydney] === script begin === [11-Jan-2023 20:10:00 Australia/Sydney] no sensor specified, trying to auto-detect [11-Jan-2023 20:10:00 Australia/Sydney] detected sensor: dev.cpu.3.temperature [11-Jan-2023 20:10:00 Australia/Sydney] in do_notify(): temp=43 alarm_temp=58 alarm=0 [11-Jan-2023 20:10:00 Australia/Sydney] alarm state is false; everything is OK [11-Jan-2023 20:10:00 Australia/Sydney] === script end ===

[11-Jan-2023 20:15:00 Australia/Sydney] === script begin === [11-Jan-2023 20:15:00 Australia/Sydney] no sensor specified, trying to auto-detect [11-Jan-2023 20:15:00 Australia/Sydney] detected sensor: dev.cpu.3.temperature [11-Jan-2023 20:15:00 Australia/Sydney] in do_notify(): temp=45 alarm_temp=58 alarm=0 [11-Jan-2023 20:15:00 Australia/Sydney] alarm state is false; everything is OK [11-Jan-2023 20:15:00 Australia/Sydney] === script end ===

[11-Jan-2023 20:20:00 Australia/Sydney] === script begin === [11-Jan-2023 20:20:00 Australia/Sydney] no sensor specified, trying to auto-detect [11-Jan-2023 20:20:00 Australia/Sydney] detected sensor: dev.cpu.3.temperature [11-Jan-2023 20:20:00 Australia/Sydney] in do_notify(): temp=45 alarm_temp=58 alarm=0 [11-Jan-2023 20:20:00 Australia/Sydney] alarm state is false; everything is OK [11-Jan-2023 20:20:00 Australia/Sydney] === script end ===

[11-Jan-2023 20:25:00 Australia/Sydney] === script begin === [11-Jan-2023 20:25:00 Australia/Sydney] no sensor specified, trying to auto-detect [11-Jan-2023 20:25:00 Australia/Sydney] detected sensor: dev.cpu.3.temperature [11-Jan-2023 20:25:00 Australia/Sydney] in do_notify(): temp=44 alarm_temp=58 alarm=0 [11-Jan-2023 20:25:00 Australia/Sydney] alarm state is false; everything is OK [11-Jan-2023 20:25:00 Australia/Sydney] === script end ===

[11-Jan-2023 20:30:00 Australia/Sydney] === script begin === [11-Jan-2023 20:30:00 Australia/Sydney] no sensor specified, trying to auto-detect [11-Jan-2023 20:30:00 Australia/Sydney] detected sensor: dev.cpu.2.temperature [11-Jan-2023 20:30:00 Australia/Sydney] in do_notify(): temp=45 alarm_temp=58 alarm=0 [11-Jan-2023 20:30:00 Australia/Sydney] alarm state is false; everything is OK [11-Jan-2023 20:30:00 Australia/Sydney] === script end ===

[11-Jan-2023 20:35:00 Australia/Sydney] === script begin === [11-Jan-2023 20:35:00 Australia/Sydney] no sensor specified, trying to auto-detect [11-Jan-2023 20:35:00 Australia/Sydney] detected sensor: dev.cpu.3.temperature [11-Jan-2023 20:35:00 Australia/Sydney] in do_notify(): temp=45 alarm_temp=58 alarm=0 [11-Jan-2023 20:35:00 Australia/Sydney] alarm state is false; everything is OK [11-Jan-2023 20:35:00 Australia/Sydney] === script end ===

[2.6.0-RELEASE][root@pfSense.home.arpa]/root: stat /tmp/temp_alarm stat: /tmp/temp_alarm: stat: No such file or directory [2.6.0-RELEASE][root@pfSense.home.arpa]/root: stat /root/temp_alert.php 128 33707526 -rwxr-xr-x 1 root wheel 67322663 3064 "Jan 6 13:03:09 2023" "Jan 6 13:03:09 2023" "Jan 6 13:03:09 2023" "Jan 6 13:03:09 2023" 32768 8 0 /root/temp_alert.php [2.6.0-RELEASE][root@pfSense.home.arpa]/root: cat /tmp/temp_alarm cat: /tmp/temp_alarm: No such file or directory [2.6.0-RELEASE][root@pfSense.home.arpa]/root: php -v PHP 7.4.26 (cli) (built: Jan 12 2022 15:25:10) ( NTS ) Copyright (c) The PHP Group Zend Engine v3.4.0, Copyright (c) Zend Technologies with Zend OPcache v7.4.26, Copyright (c), by Zend Technologies [2.6.0-RELEASE][root@pfSense.home.arpa]/root:

luckman212 commented 1 year ago

Ok, but in the log output above, the alarm_temp appears to be set to 58, so no alarm is being triggered since your temps are all in the mid-40s.

Please edit line 14 to something that will trigger an alarm on your system, e.g. 44

dastrix80 commented 1 year ago

Working! I'm an idiot. Seems I didnt update it after the update you made to the script. Sorry !! But thank you so very much - does exactly what I need. Great work!

luckman212 commented 1 year ago

Alright! 🚀 That's good news, because I was just about out of ideas.

I hope to release this as a proper package soon to make installation and configuration easier.