Re: [weewx-user] Please can I have my bug back?

2016-10-19 Thread Glenn McKechnie
Well, that was an interesting thread. I'm punting that the following link
was your original lockup discussion.
https://groups.google.com/forum/#!msg/weewx-user/qzzcMoojY5I/qLEhUyuYBAAJ;context-place=msg/weewx-user/S1dOoMfgaXw/DYB9bc-EBAAJ


I can't offer any advice on the actual USB lockout - my WH108 has never
given any serious grief - and assuming there is no cleaner solution coming
from those more knowledgeable, then we end up at your reboot question.

You say  "periodically scan syslog and reboot if this message turns up."
Are you aware that you can use rsyslog itself to flag and act on that
message? ( I know you said no syslog, but you also mention cron and
scanning which suggest an external solution.)

https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/7/html/System_Administrators_Guide/s1-basic_configuration_of_rsyslog.html


READ WRITE : root@rorpi-2:~# tail /etc/rsyslog.conf

#
#daemon.*;mail.*;\
#news.err;\
#*.=debug;*.=info;\
#*.=notice;*.=warn|/dev/xconsole

$template weewxwatch,"%msg:::drop-last-lf%"
:msg, contains, "Caught WeeWxIOError: Cannot determine archive interval"
^/root/syslogalarm.sh; weewxwatch


then create /root/syslogalarm.sh and add the following as a testing
example...

#!/bin/bash
tymestamp=$(date +%d%m%Y-%H:%M)
logger "caught $0 execution"
echo "caught $0 execution @ $tymestamp" >> /root/weewxlogger.log

shutdown -k +2

exit 0

and make it executable with...
chmod 0700 /root/syslogalarm.sh

restart syslog...
/etc/init.d/rsyslog restart && tail -f /var/log/syslog

and from another terminal write to syslog using...

logger Caught WeeWxIOError: Cannot determine archive interval

and you should get a message informing you of an imminent shutdown (except
-k is a dummy run.)
Tweak to suit.



Cheers
 Glenn

rorpi-raspberry pi + weewx: now with scripts


-- 
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 weewx-user+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[weewx-user] Please can I have my bug back?

2016-10-19 Thread Macha
Well, not really I suppose, but ...

Some time ago I commented that my setup (Raspberry Pi + W1080 clone) 
"crashed" weewx from time to time. I found that restarting weewx didn't 
help because it couldn't read from the Console. So, I had this cron job 
which checked if weewx was running. If not, the RPi was rebooted and things 
worked fine until the next time. This event happened, on average, once a 
week.

Now, after upgrading to V3.6.0, this kind-of-lockup still occurs, but weewx 
doesn't crash and simply reports to syslog ...

Caught WeeWxIOError: Cannot determine archive interval


... each 60 seconds.


So I still need to "trap" this error in order to reboot the RPi (I have 
tried many things to "reset" the USB link to the console, but haven't found 
any solution other than a reboot). The only thing I can think of is to 
periodically scan syslog and reboot if this message turns up.


Is there any other way I can flag weewx errors other than syslog?


-- 
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 weewx-user+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.