tip for users with raspberry in remote location

已查看 445 次
跳至第一个未读帖子

Flabbergast

未读,
2014年6月13日 07:33:102014/6/13
收件人 weewx...@googlegroups.com

Hi,

RaspberryPi got a watchdog that can be used to monitor status of different things. I set mine up to look for changes in the weewx log file and if there is no change for 10 minutes it will reboot the system.

This is what I did:

Install the watchdog module:

sudo modprobe bcm2708_wdog

In /etc/modules add:
bcm2708_wdog

Install watchdog daemon:
sudo apt-get install watchdog chkconfig


Edit /etc/watchdog.conf to your liking.
To watch for changes in the weewx log file like I did, uncomment the lines starting with "file" and "change", mine looks like this:
file                    = /var/weewx/log/weewx.log
change                  
= 600
You might have your log file in a different location and also you might have to take a look at the timestamps in it to set a good "change" value.

Also uncomment the line starting with "watchdog-device" and edit it to be:
watchdog-device = /dev/watchdog

Enable more checks if you want.


Add the watchdog daemon to the system services:
watchdog-device = /dev/watchdog

And start it:
sudo service watchdog start

Enjoy!

drich

未读,
2014年6月13日 11:27:292014/6/13
收件人 weewx...@googlegroups.com

I'm a big fan of monit (mmonit.com/monit) that does much of the same thing. It can restart the processes for you and notify you if config files change w/o your knowledge. I have it running most servers on my home servers, but I haven't set it up for weewx yet (waiting for my Vantage Pro to come back from a tune-up at Davis).

I'll probably get it up and running this weekend, if I do I'll post the config file here. It should be really straight-forward to setup.

 

---
Dan Rich <dr...@employees.org> | http://www.employees.org/~drich/ | "Step up to red alert!" "Are you sure, sir? | It means changing the bulb in the sign..." | - Red Dwarf (BBC)
--
You received this message because you are subscribed to the Google Groups "Weewx user's group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to weewx-user+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Thomas Keffer

未读,
2014年6月13日 11:55:082014/6/13
收件人 weewx-user
Just a little note that should you go this route, please keep sending error reports to us!

My goal is an extremely robust weewx that is very hard to crash. I recognize that some configurations make that tough and so a monitoring program may be in order, but my preference is to engineer out any failure modes.

-tk


wysiwyg

未读,
2014年6月16日 08:20:332014/6/16
收件人 weewx...@googlegroups.com
This watchdog function is good to know !

On my side I didnt face so much weewx crashes but sometime the raspberry loses the wifi connection (this raspberry is not at my home and I can access to it almost only by SSH)
To solve this, I have a very short script launched by cron every hour: it pings my modem and if no ping answer it will switch on/off the wifi.
Similar script is also launched once a day and reboot in case connection is still missing.


In case you have or fear some weewx crashes,an other solution is to launch periodically  "sudo service weewx start".
it will start weewx if stopped and just tells it is already started if it is already running.


Thomas Hackler

未读,
2023年11月3日 06:41:262023/11/3
收件人 weewx-user
Hello,
it is an old topic but currently interesting for me.
I try to use monit.
Do you have an example of your rule you use to watch weewx for me? Thank you!

Thomas Hackler

未读,
2024年3月26日 09:02:533月26日
收件人 weewx-user
回复全部
回复作者
转发
0 个新帖子