A monitor program for WeeWx running on Raspberry Pi

316 views
Skip to first unread message

re...@eau.net

unread,
Apr 22, 2020, 9:05:27 PM4/22/20
to weewx-user
I'm not real familiar with Raspberry Pi and have looked in both the user guide and the Wiki for an answer but didn't find anything.

I wonder if WeeWx is running on the Pi.

Is there a 'monitoring' program that I can open in the command line by typing some command, and having it tell me that WeeWx is indeed running?

In Windows there is a Task Manager that does sort of like that, telling if a program is running, how much CPU and memory usage there is. It would be nice to have it also tell me the accumulated network traffic, even though limits on traffic aren't as common as the once were with ISPs, it is still a point of curiosity for me.

I don't have to run it in a command line window, as I also have the graphic interface available on this little box, too.

Suggestions?

Dale

rich T

unread,
Apr 22, 2020, 9:14:40 PM4/22/20
to weewx-user
Dale

In the command prompt type: htop 
You should see what is running and the memory usage.

Rich

Daniel Rich

unread,
Apr 22, 2020, 9:42:12 PM4/22/20
to weewx-user
The simplest way from the command line is to use either service or systemctl — depending on which OS you have on the Pi.

> systemctl status weewx
● weewx.service - LSB: weewx weather system
   Loaded: loaded (/etc/init.d/weewx; generated; vendor preset: enabled)
   Active: active (running) since Wed 2020-04-22 00:03:07 PDT; 18h ago
     Docs: man:systemd-sysv-generator(8)
   CGroup: /system.slice/weewx.service
           └─3359 python /usr/bin/weewxd --daemon --pidfile=/var/run/weewx.pid /etc/weewx/weewx.conf
or
> service weewx status

If you want to see the process you can also us ps, that is roughly equivalent to the Windows task manager. Something like this will show you the weewx process:
> ps -efwww| grep weewx
root 3359 1 10 00:03 ? 01:59:47 python /usr/bin/weewxd --daemon --pidfile=/var/run/weewx.pid /etc/weewx/weewx.conf

Leave off the “| grep weewx” if you want to see everything running on the Pi.

Network traffic is trickier, as weewx generates very little traffic. If you are serving a web site, that traffic is going to be running through your web server, which could be all sorts of things like libhttpd, apache, nginx, or others. There are very few command line tools for network traffic, sar can do it if you have the systat package installed and enabled. There are lots of other tools like bmon, slurm, tcptrack, iftop, iptraf - each with a different set of plusses and minuses and features. Or if you’re a metrics geek like me you set up telegraf, influxdb, and feed it all into grafana dashboards — not something a normal person would do. :-)


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" group.
To unsubscribe from this group and stop receiving emails from it, send an email to weewx-user+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/weewx-user/242c4f50-8d1a-4bcd-9e61-c563f1634063%40googlegroups.com.

Xant

unread,
Apr 23, 2020, 12:20:42 AM4/23/20
to weewx-user

Yes, you can always check if Weewx is running by regular rPi "status" command prompt, but is not a "monitoring" thing per say.

A nifty trick - which almost work as a "monitoring" - is to upload your wx data to WeatherCloud,

WeatherCloud will notify you by email, if stop receiving your data... for weewx, rPi, network, or whatever would be. But you get notified to check on what is wrong...


It saved me many times already...

Xant

Rob Hopper

unread,
Apr 23, 2020, 7:31:04 PM4/23/20
to weewx-user
Yep. This has worked for me too.

 --Rob

Wes Witt

unread,
Apr 24, 2020, 10:17:25 AM4/24/20
to weewx-user
on linux a great way to monitor services is to use monit:  https://mmonit.com/monit/, many great features and works great

John Burricelli

unread,
Apr 25, 2020, 7:48:29 AM4/25/20
to weewx-user
A simple shell script will do the same thing.  I put something similar below in my cron to run every 10 minutes.

#!/bin/bash

a=`ps -ef | grep weewxd | wc -l`
        if [ "$a" -gt "1" ]
        then exit
        else
        ** Your alerting/email command goes here **
        fi 

Xant

unread,
Apr 25, 2020, 8:07:41 PM4/25/20
to weewx-user

I still recommend WeatherCloud "trick", and all should use, regardless...

But this posting caught my attention for a real monitoring... so, I went to research.

So, here is my current status:
Xant

Xant

unread,
May 13, 2020, 12:13:00 AM5/13/20
to weewx-user
Got RPi Grafana monitor working through the following tutorial:


It looks great upon all RPi stats, but still searching how to track a specific process (as WeeWX).

Would appreciate feedback.

Xant
Message has been deleted

Mikael Fredriksson

unread,
May 14, 2020, 9:31:53 AM5/14/20
to weewx-user
I have this script running on my setup, watchdog, works perfectly. Sends email and tries to restart weewx if it has stopped! Running as cronjob.
https://groups.google.com/d/msg/weewx-user/vkorG7zt3Bo/pro8mGNOCgAJ

Mikael Fredriksson

unread,
May 14, 2020, 9:34:14 AM5/14/20
to weewx-user
Here's the link to Github where you can find it.
https://github.com/UberEclectic/weewx/tree/watchdog/examples/watchdog

Xant

unread,
May 24, 2020, 1:58:17 PM5/24/20
to weewx-user
Reply all
Reply to author
Forward
0 new messages