You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Micke Nordin f5e9f96f1e Merge branch 'master' of hace 1 año
LICENSE Initial commit hace 1 año Add crontab example hace 1 año Fix dates hace 1 año Add nagios plugin hace 1 año Add human readable station name hace 1 año
grafana_dashboard.json Add cumulative graph hace 1 año
requirements.txt Collection of data and aggregation to mysql works hace 1 año
weather.ini Add grafana dashboard hace 1 año
weather.sql Add human readable station name hace 1 año


Some pythonscripts that get weather data from SMHI and calculates evapotranspiration. Create a user to run scripts:

useradd -s /usr/sbin/nologin -r -M -d /opt/weather weather

Clone repo:

git clone /opt/weather


chown -R weather:weather /opt/weather

Create mysql database:

mysql -e "CREATE DATABASE weather"
mysql -e "CREATE USER 'weather'@'localhost' IDENTIFIED BY 'password'"
mysql -e "GRANT ALL PRIVILEGES ON weather.* TO 'weather'@'localhost'"
mysql weather < /opt/weather/weather.sql

Install requirements:

sudo -u  weather pip3 install -r /opt/weather/requirements.txt

Configure and run:

vim /opt/weather/weather.ini

Example crontab entry for weather user:

# m h  dom mon dow   command
15 * * * * /opt/weather/
30 * * * * /opt/weather/ --station 97280
45 2,14 * * * /opt/weather/
45 3,15 * * * /opt/weather/ --station 97280