Commit 505fa707 authored by Johannes Schilling's avatar Johannes Schilling
Browse files

add cip-grafana-tempgraph-extract

parent 1ca3f7b9
#!/bin/sh
set -eu
CURDATE=$(date +%s)
url() {
olddate=$(date --date="$1" +%s)
printf "http://localhost:3621/render/dashboard-solo/db/public-temperature?orgId=1&from=%d000&to=%d000&panelId=1&width=1000&height=500&theme=light" "${olddate}" "${CURDATE}"
}
/usr/bin/curl -H 'X-Remote-User: nobody' "$(url '24 hours ago')" > /var/www/temperature/day.png
/usr/bin/curl -H 'X-Remote-User: nobody' "$(url '7 days ago')" > /var/www/temperature/week.png
/usr/bin/curl -H 'X-Remote-User: nobody' "$(url '30 days ago')" > /var/www/temperature/month.png
/usr/bin/curl -H 'X-Remote-User: nobody' "$(url '360 days ago')" > /var/www/temperature/year.png
[Unit]
Description=CIP update temperature graph images from grafana
[Service]
Type=oneshot
User=www
ExecStart=/usr/sbin/cip-grafana-tempgraph-extract
[Unit]
Description=CIP update temperature graph images from grafana (Timer Unit)
[Timer]
# Run immediately after boot for hosts which are not running 24-7 (powersafe).
OnBootSec=1m
# Run every 5 minutes. (the expression was copied from the
# cip-monitoring-tools-run.timer unit, i don't fully understand it
# -- js 2017-08-02)
OnCalendar=*:04/5:42
[Install]
WantedBy=multi-user.target
cip-foxtemp (7) unstable; urgency=medium
* add cip-grafana-tempgraph-extract
-- Johannes Schilling <johannes.schilling@cs.fau.de> Wed, 02 Aug 2017 19:08:58 +0200
cip-foxtemp (6.2) unstable; urgency=medium
* proper restart, version bump again (commit early, build often)
......
cip-grafana-tempgraph-extract usr/sbin
cip-grafana-tempgraph-extract.service lib/systemd/system
cip-grafana-tempgraph-extract.timer lib/systemd/system
#!/bin/sh
set -e
case "$1" in
configure)
install --directory --owner www --group www /var/www/temperature
;;
esac
#DEBHELPER#
exit 0
......@@ -15,3 +15,8 @@ Description: foxtemp ds1820 host software
Original source at
https://git.informatik.uni-erlangen.de/?p=ds1820tousb/.git;a=summary, this is
just the host software packaged, without the AtTiny firmware.
Package: cip-grafana-tempgraph-extract
Architecture: any
Depends: ${misc:Depends}, curl
Description: grafana graph extraction scripts
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment