Funny, I was just thinking I need a script to monitor weewx remote
installs. Thanks!
Doug B.
On Saturday, May 13, 2023 at 11:40:14 AM UTC-7 vince wrote:
> I always recommend a standalone external program called occasionally by
> cron as the simplest way to do these kinds of things.
>
> Here's a quickie script in bash as an example
>
> #!/bin/bash
> # max time since last record in seconds
> maxDifference=3600
>
> # timestamp of the last record in the db
> lastTimestamp=`echo "select dateTime from archive order by dateTime desc
> limit 1;" | sqlite3 weewx.sdb`
>
> # current timestamp
> now=`date +%s`
>
> # difference in timestamps
> declare -i delta=${now}-${lastTimestamp}
>
> # print it out
> echo "lastTimestamp=${lastRecord} now=${now} delta=${delta}"
> if test ${delta} -gt ${maxDifference}
> then
> echo "too long since last record"
> # put something here to syslog and/or email
> else
> echo "last record check within limits"
> fi
>
> On Friday, May 12, 2023 at 7:42:35 PM UTC-7 Ryan Stasel wrote:
>
>> Hey All,
>>
>> Is there a way to have WeeWX send email alerts for when it hasn’t
>> received data from the station after X amount of time? My Weatherlink seems
>> to have gone offline a few days ago (network dropped, but kept logging data
>> thankfully), but I didn’t notice until now.
>>
>> Is there an option to have it alert? I see alarming for weather
>> conditions here:
>> https://github.com/weewx/weewx/blob/master/examples/alarm.py but not
>> really anything for “I haven’t gotten any data for X time, or “station has
>> gone offline””
>>
>> Thanks!
>>
>> -Ryan Stasel
>>
>
--
You received this message because you are subscribed to the Google Groups
"weewx-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/weewx-user/20e38ba4-3e92-4a2f-a27a-0b2280080980n%40googlegroups.com.