Commit graph

88 commits

Author SHA1 Message Date
Lance Edgar b887875f80 Update changelog 2023-02-12 11:22:06 -06:00
Lance Edgar 995e0dde0a Refactor Query.get() => Session.get() per SQLAlchemy 1.4 2023-02-11 22:24:56 -06:00
Lance Edgar acfc7f7d80 Update changelog 2023-02-10 21:09:51 -06:00
Lance Edgar 304cec9dd5 Address a warning from SQLAlchemy for declarative_base
as of 1.4 that has moved
2023-02-08 10:57:04 -06:00
Lance Edgar 1efdd9debd Update changelog 2022-08-06 21:10:11 -05:00
Lance Edgar 28ecdda0e6 Update changelog 2020-09-22 19:56:10 -05:00
Lance Edgar 4eebd454d5 Declare sort order for Appliance.probes relationship 2020-04-04 19:30:37 -05:00
Lance Edgar 1b03841c7f Remove config for deprecated 'tempmon_critical_temp' email
we now have critical_high and critical_low as separate emails
2019-06-13 12:06:49 -05:00
Lance Edgar 873cd3def9 Update changelog 2019-04-23 22:22:07 -05:00
Lance Edgar 353abcc172 Make sure we use zero as fallback/default timeout values 2019-04-09 12:43:00 -05:00
Lance Edgar 8187c9532f Update changelog 2019-01-28 15:48:57 -06:00
Lance Edgar cf27af81d4 Modify tempmon server logic to take "unfair" time windows into account
when a client or probe first are (re-)enabled, we can't expect to have readings
within the time window we'd normally be checking.  previously we'd get false
alarms about "probe error status" etc. when this happened; hopefully no longer!
2019-01-25 19:49:46 -06:00
Lance Edgar f31a0c4c22 Convert enabled for Client, Probe to use datetime instead of boolean
value is null if disabled, else timestamp of when it was last enabled
2019-01-25 19:33:49 -06:00
Lance Edgar c45baaed5e Add more template context for email previews
just to keep things from breaking outright..although this hasn't been given
much attention still, numbers may not make total sense
2018-10-31 17:20:35 -05:00
Lance Edgar 3b14a0b288 Update changelog 2018-10-25 09:01:19 -05:00
Lance Edgar 7212b07504 Fix bug when sending certain emails while checking probe readings
use common method to add more context for email template
2018-10-25 09:00:17 -05:00
Lance Edgar ad3e647160 Update changelog 2018-10-24 19:20:44 -05:00
Lance Edgar 8220082359 Add try/catch for client's "read temp" logic
this can isolate an error for a certain probe, so that other probes can go
ahead and take their readings during each client run.  that way only the bad
one is marked as "error" status by the server
2018-10-23 17:39:18 -05:00
Lance Edgar b644818eef Don't mark client as online unless it's also enabled 2018-10-23 17:38:38 -05:00
Lance Edgar 30f0fe0a84 Add "default" probe timeout logic for server readings check
this way we don't have to set those timeouts on every single probe
2018-10-23 10:25:08 -05:00
Lance Edgar 1f8507508a Make dummy probe use tighter pattern for random readings
to make for a more reasonable-looking graph
2018-10-20 04:17:42 -05:00
Lance Edgar 157873dc16 Update changelog 2018-10-19 20:30:07 -05:00
Lance Edgar 0ff20eb753 Add image fields for Appliance table
raw, normalized, thumbnail
2018-10-19 19:16:06 -05:00
Lance Edgar 6be6467f59 Add appliance table, and probe "location" in that context 2018-10-19 17:51:25 -05:00
Lance Edgar 871a9154da Update some timeout field docstrings, per latest refactor 2018-10-19 16:47:20 -05:00
Lance Edgar 19553edda6 Add per-status timeouts and tracking for probe status
i.e. this lets us keep track of when a probe becomes "high temp" and then later
if it becomes "critical high temp" we can still know how long it's been high
2018-10-19 14:58:30 -05:00
Lance Edgar 8be64c0580 Update changelog 2018-10-17 19:31:37 -05:00
Lance Edgar 5830c7bd15 Fix logic bug when checking readings for client
yikes! first probe whose readings were checked okay, was causing other probes
to just be skipped
2018-10-17 19:26:48 -05:00
Lance Edgar 3aa4185de9 Leverage common "now" value when sending emails from server
i.e. don't generate new "now" when sending an email, just use the "now" we
established when starting to check the readings
2018-10-17 19:18:34 -05:00
Lance Edgar 71db57b2e0 Add probe URL to email template context 2018-10-17 18:08:54 -05:00
Lance Edgar d6ab9a60f1 Update changelog 2018-10-09 16:36:07 -05:00
Lance Edgar 5bf69a0c21 Add "recent readings" to email template context 2018-10-08 00:52:16 -05:00
Lance Edgar b4c52319c6 Make client more tolerant of database restart
note that a retry is *not* attempted within a given "take readings" run.
rather, client will consider that full readings take to have failed, if any
part of it fails.

but then we keep track of type/amount of some (database connection) failures,
and will suppress logging the full error for first 3 attempts.  in practice
this lets us recover from simple database restarts, and if database becomes
truly unavailable we'll hear about it shortly.

any other type of error is immediately logged on first failure.
2018-10-07 18:47:02 -05:00
Lance Edgar 2f7fa3430a Make server more tolerant of database restart
note that a retry is *not* attempted within a given "check readings" run.
rather, server will consider that full readings check to have failed, if any
part of it fails.

but then we keep track of type/amount of some (database connection) failures,
and will suppress logging the full error for first 3 attempts.  in practice
this lets us recover from simple database restarts, and if database becomes
truly unavailable we'll hear about it shortly.

any other type of error is immediately logged on first failure.
2018-10-07 18:16:18 -05:00
Lance Edgar b4fa6a17c5 Add "status since" to template context for email alerts 2018-10-06 20:17:46 -05:00
Lance Edgar 76e40063ee Tweak server logic for checking client readings
do not check readings for "archived" clients.  do not consider the client
"offline" unless it has *no* current probe readings.  previously we were
assuming offline if any probe readings were missing, even if some were found.
2018-10-06 18:09:02 -05:00
Lance Edgar 440abf2b56 Improve docstrings for some model attributes 2018-10-06 17:39:54 -05:00
Lance Edgar 85e8ed9832 Log error when client probe takes a 185.0 reading
this indicates some power issue with the probe(s) and does not really mean
that's the temperature.  so we don't want the server to send out "high temp"
email etc. but rather just a technical error email

https://www.controlbyweb.com/support/faq/temp-sensor-reading-error.html
2018-10-05 20:53:09 -05:00
Lance Edgar 74de10e74c Log our supposed hostname on startup
just to help with troubleshooting
2018-10-05 19:30:01 -05:00
Lance Edgar 63aa29f7d7 Update changelog 2018-10-04 19:59:14 -05:00
Lance Edgar 18b224a3e0 Add Client.disk_type to track SD card vs. USB
i.e. assuming raspberry pi device for the client.  kind of a specific use case
behind this but it seemed like it could be useful generally
2018-09-28 19:14:55 -05:00
Lance Edgar 30a0f98e1d Add notes field to client and probe tables 2018-09-28 12:26:49 -05:00
Lance Edgar 152ea26c02 Add Client.archived flag, ignore archived for "disabled probes" check
this lets us keep old client config around without deleting it, but it should
not interfere with other logic etc.
2018-09-28 12:21:21 -05:00
Lance Edgar 018a9dcb08 Don't let server mark client as offline until readings fail 3 times in a row
previously we were only letting this fail once, if that
2018-09-28 11:57:27 -05:00
Lance Edgar ab38143039 Include client key in disabled probe list email 2018-09-11 18:42:00 -05:00
Lance Edgar b20c63d023 Update changelog 2018-02-07 17:53:11 -06:00
Lance Edgar 5df3379995 Send email alert when tempmon server marks a client as offline
courtesy of Cole Chaney <cole@mamajeansmarket.com>
2018-02-07 17:48:07 -06:00
Lance Edgar 8a1551e0f5 Send first alert "immediately" if critical temp status
i.e. only wait for "first email" delay if *not* critical

courtesy of Cole Chaney <cole@mamajeansmarket.com>
2018-02-07 17:47:48 -06:00
Lance Edgar f8f29a8551 Update changelog 2017-11-19 17:46:46 -06:00
Lance Edgar fd7cd5cadd Add problem report for disabled clients/probes 2017-11-18 22:12:40 -06:00