Danke für den Hinweis der fehlerhaften Datei "Linknx.xml", ich werde mir das mal ansehen und dann im Eingangspost eine entsprechende Anmerkung hinzufügen.
Ankündigung
Einklappen
Keine Ankündigung bisher.
Wie erstelle ich ein Diagramm in der CometVisu?
Einklappen
X
-
Leider klappt es einfach nicht...
nach ausführen von rrd dump wird folgendes angezeigt:
Code:/var/www/rrd$ rrdtool dump raumtemp.rrd | grep row | grep -v NaN <pdp_per_row>1</pdp_per_row> <!-- 300 seconds --> <pdp_per_row>6</pdp_per_row> <!-- 1800 seconds --> <pdp_per_row>36</pdp_per_row> <!-- 10800 seconds --> <pdp_per_row>144</pdp_per_row> <!-- 43200 seconds --> <pdp_per_row>1008</pdp_per_row> <!-- 302400 seconds --> <pdp_per_row>4320</pdp_per_row> <!-- 1296000 seconds --> <pdp_per_row>52560</pdp_per_row> <!-- 15768000 seconds --> <pdp_per_row>525600</pdp_per_row> <!-- 157680000 seconds -->
Hier nochmal alles zur Übersicht:
RRD Script "raumtemp.sh" (/var/www/rrd/):
Code:#!/bin/bash # # update .rrd database text file from linknx # # $Id: update_cputemp 275 2013-05-16 05:20:56Z lenik $ cd /var/www/rrd # create database if not exists [ -f raumtemp.rrd ] || { /usr/bin/rrdtool create raumtemp.rrd --step 300 \ DS:Temperatur:GAUGE:1200:U:U \ RRA:AVERAGE:0.5:1:3200 \ RRA:AVERAGE:0.5:6:3200 \ RRA:AVERAGE:0.5:36:3200 \ RRA:AVERAGE:0.5:144:3200 \ RRA:AVERAGE:0.5:1008:3200 \ RRA:AVERAGE:0.5:4320:3200 \ RRA:AVERAGE:0.5:52560:3200 \ RRA:AVERAGE:0.5:525600:3200 } # Read temperature from text file temp=`cat /var/lib/linknx` # Update database rrdtool update raumtemp.rrd N:$temp
Was hat es sich mit der 5. Zeile auf sich? Warum steht da was mit CPU temp?
********************************************
Inhalt von "Linknx.xml" ( /var/lib/linknx/) :
Kopiert von Michixx, somit ohne den zuvor beschriebenen Fehler.
Code:<?xml version="1.0" ?> <config> <services> <knxconnection url="ip:127.0.0.1" /> <xmlserver type="inet" port="1028"/> <exceptiondays> <date day="1" month="1" /> <date day="1" month="5" /> <date day="15" month="8" /> <date day="25" month="12" /> <date day="25" month="4" year="2011" /> <date day="2" month="6" year="2011" /> <date day="13" month="6" year="2011" /> <date day="9" month="4" year="2012" /> <date day="17" month="5" year="2012" /> <date day="28" month="5" year="2012" /> <date day="1" month="4" year="2013" /> <date day="9" month="5" year="2013" /> <date day="20" month="5" year="2013" /> <date day="21" month="4" year="2014" /> <date day="29" month="5" year="2014" /> <date day="9" month="6" year="2014" /> </exceptiondays> <persistence type="file" path="/var/lib/linknx" /> </services> <objects> <object id="raumtemp" gad="0/4/0" type="9.001" flags="cwu" init="persist" log="false">Raumtemperatur</object> </objects> <rules> </rules> <logging output="/var/log/linknx.log" format="%d{%Y-%m-%d %H:%M:%S,%l} %5p > %c %x - %m%n" level="NOTICE" maxfilesize="100" maxfileindex="2" /> </config>
Inhalt von "crontab.sh" (/etc/ ):
Code:# /etc/crontab: system-wide crontab # Unlike any other crontab you don't have to run the `crontab' # command to install the new version when you edit this file # and files in /etc/cron.d. These files also have username fields, # that none of the other crontabs do. SHELL=/bin/sh PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin # m h dom mon dow user command 17 * * * * root cd / && run-parts --report /etc/cron.hourly 25 6 * * * root test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.daily ) 47 6 * * 7 root test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.weekly ) 52 6 1 * * root test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.monthly ) # */5 * * * * root /var/www/rrd/raumtemp
Zuletzt geändert von thomas6789; 02.12.2016, 09:42.
Kommentar
-
Ändere mal den Datentyp von 9.001 nach 9.xxx
<object id="raumtemp" gad="0/4/0" type="9.001" flags="cwu" init="persist" log="false">Raumtemperatur</object>
<object id="raumtemp" gad="0/4/0" type="9.xxx" flags="cwu" init="persist" log="false">Raumtemperatur</object>
Und was steht in dem Log von linknx?
Kommentar
-
Setze mal zum testen der Ausgabe in dein RRD Script "raumtemp.sh mal das folgende rote mit ein:
Code:#!/bin/bash # # update .rrd database text file from linknx # # $Id: update_cputemp 275 2013-05-16 05:20:56Z lenik $ cd /var/www/rrd # create database if not exists [ -f raumtemp.rrd ] || { /usr/bin/rrdtool create raumtemp.rrd --step 300 \ DS:Temperatur:GAUGE:1200:U:U \ RRA:AVERAGE:0.5:1:3200 \ RRA:AVERAGE:0.5:6:3200 \ RRA:AVERAGE:0.5:36:3200 \ RRA:AVERAGE:0.5:144:3200 \ RRA:AVERAGE:0.5:1008:3200 \ RRA:AVERAGE:0.5:4320:3200 \ RRA:AVERAGE:0.5:52560:3200 \ RRA:AVERAGE:0.5:525600:3200 } # Read temperature from text file temp=`cat /var/lib/linknx` [COLOR=#FF0000]echo $temp[/COLOR] # Update database rrdtool update raumtemp.rrd N:$temp
Code:cd /var/www/rrd ./raumtemp.sh
Kommentar
-
Hab ich gemacht. Datentyp ist auch auf "9.xxx" geändert.
Folgendes wird ausgegeben:
Code:/var/www/rrd$ ./raumtemp.sh cat: /var/lib/linknx: Ist ein Verzeichnis
Allerding nur wenn ich die raumtemp.sh händisch ausführe!
Code:/var/www/rrd$ rrdtool dump raumtemp.rrd | grep row | grep -v NaN <pdp_per_row>1</pdp_per_row> <!-- 300 seconds --> <!-- 2016-12-02 15:35:00 CET / 1480689300 --> <row><v>0.0000000000e+00</v></row> <!-- 2016-12-02 15:40:00 CET / 1480689600 --> <row><v>0.0000000000e+00</v></row> <!-- 2016-12-02 15:45:00 CET / 1480689900 --> <row><v>0.0000000000e+00</v></row> <!-- 2016-12-02 15:50:00 CET / 1480690200 --> <row><v>0.0000000000e+00</v></row> <!-- 2016-12-02 15:55:00 CET / 1480690500 --> <row><v>0.0000000000e+00</v></row> <!-- 2016-12-02 16:00:00 CET / 1480690800 --> <row><v>0.0000000000e+00</v></row> <pdp_per_row>6</pdp_per_row> <!-- 1800 seconds --> <!-- 2016-12-02 16:00:00 CET / 1480690800 --> <row><v>0.0000000000e+00</v></row> <pdp_per_row>36</pdp_per_row> <!-- 10800 seconds --> <pdp_per_row>144</pdp_per_row> <!-- 43200 seconds --> <pdp_per_row>1008</pdp_per_row> <!-- 302400 seconds --> <pdp_per_row>4320</pdp_per_row> <!-- 1296000 seconds --> <pdp_per_row>52560</pdp_per_row> <!-- 15768000 seconds --> <pdp_per_row>525600</pdp_per_row> <!-- 157680000 seconds -->
Das sieht doch schon mal ganz gut aus :-)
Scheint jetzt nur noch in der Crontab etwas nicht zu stimmen...
Außerdem bleibt die Anzeige in der Visu immer auf 0°C
image_55090.jpgZuletzt geändert von thomas6789; 02.12.2016, 17:05.
Kommentar
-
Macht leider keinen Unterschied.
Wenn ich cronjob manuel ausführe, kommen einige Fehler:
Code:Befehl '"./crontab"' fehlgeschlagen mit Beendigungscode 127 und Fehlernachricht ./crontab: Zeile 13: 17: Kommando nicht gefunden. ./crontab: Zeile 14: 25: Kommando nicht gefunden. ./crontab: Zeile 15: 47: Kommando nicht gefunden. ./crontab: Zeile 16: 52: Kommando nicht gefunden. ./crontab: Zeile 19: */5: Datei oder Verzeichnis nicht gefunden.
Kommentar
-
In der raumtemp.sh muss es auf jeden Fall so heißen
Code:temp=`cat /var/lib/linknx/raumtemp`
Der Crontab scheint zu passen da ja im 5 Minutentakt Werte eingetragen werden.
Hat deine Datei raumtemp.sh auch Schreibrechte? Wenn nicht dann folgendes ausführen : chmod +x /var/www/rrd/raumtemp.sh
Anschließenden Reboot nicht vergessen
Gruß StefanZuletzt geändert von spielkind1611; 02.12.2016, 22:13.Liebe Grüße
Stefan
Kommentar
-
Schreibrechte sind vorhanden, habe aber nochmal chmod ausgeführt und rebooted.
Es liegt definitiv am crontab. Die werte werden nur eingetragen wenn ich alle 5 min. manuel über putty die raumtemp.sh ausführe. Im Moment passt alles, bis auf die automatische ausführung durch crontab.
Wie oben erwähnt wird beim ausführen des crontab folgendes ausgegeben:
Code:Befehl '"./crontab"' fehlgeschlagen mit Beendigungscode 127 und Fehlernachricht ./crontab: Zeile 13: 17: Kommando nicht gefunden. ./crontab: Zeile 14: 25: Kommando nicht gefunden. ./crontab: Zeile 15: 47: Kommando nicht gefunden. ./crontab: Zeile 16: 52: Kommando nicht gefunden. ./crontab: Zeile 19: */5: Datei oder Verzeichnis nicht gefunden.
Code:# /etc/crontab: system-wide crontab # Unlike any other crontab you don't have to run the `crontab' # command to install the new version when you edit this file # and files in /etc/cron.d. These files also have username fields, # that none of the other crontabs do. SHELL=/bin/sh PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin # m h dom mon dow user command 17 * * * * root cd / && run-parts --report /etc/cron.hourly 25 6 * * * root test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.daily ) 47 6 * * 7 root test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.weekly ) 52 6 1 * * root test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.monthly ) # */5 * * * * root /var/www/rrd/raumtemp.sh
Angehängte Dateien
Kommentar
-
Also das händische Ausführen des crontab funktioniert bei mir auch nicht. Bekomme da die gleichen Fehler
Kann es sein dass dein crontab volle Berechtigungen hat?
Wenn ja dann änder das mal mit folgendem Befehl "chmod 644 /etc/crontab"
Mache dann wie immer einen Reboot und schau mit "grep CRON /var/log/syslog" ob der cronjob ausgeführt wird.
Gruß StefanZuletzt geändert von spielkind1611; 03.12.2016, 16:38.Liebe Grüße
Stefan
Kommentar
-
ja, crontab hatte alle berechtigungen, dachte es kann nicht schaden :-)
Ca. 15 Minuten nach dem reboot wird mit CRON /var/log/syslog folgendes ausgegeben:
Code:Dec 3 17:57:09 raspberrypi /usr/sbin/cron[1997]: (CRON) INFO (pidfile fd = 3) Dec 3 17:57:09 raspberrypi /usr/sbin/cron[1998]: (CRON) STARTUP (fork ok) Dec 3 17:57:09 raspberrypi /usr/sbin/cron[1998]: (CRON) INFO (Running @reboot jobs)
Zuletzt geändert von thomas6789; 03.12.2016, 18:45.
Kommentar
Kommentar