Changeset daaef3e


Ignore:
Timestamp:
Nov 24, 2014, 9:30:20 PM (9 years ago)
Author:
njw <njw@…>
Branches:
master
Children:
5ce93a3
Parents:
af9afaf
Message:

Daemonized monitoring scripts

Location:
de.wigbels.ruby
Files:
4 added
3 edited

Legend:

Unmodified
Added
Removed
  • de.wigbels.ruby/hotcoldrain/draw_graphs.sh

    raf9afaf rdaaef3e  
    33rrdtool graph web/temperatur_1tag.png -w 800 -h 500 -s 'now - 1 day' -e 'now' DEF:temps1=weather.rrd:temps1:AVERAGE LINE2:temps1#204a87:"Temperatur unten" DEF:temps2=weather.rrd:temps2:AVERAGE LINE2:temps2#f57900:"Temperatur oben" DEF:temps9=weather.rrd:temps9:AVERAGE LINE2:temps9#4e9a06:"Temperatur aussen"
    44
    5 rrdtool graph web/temperatur_1woche.png -w 800 -h 500 -s 'now - 1 week' -e 'now' DEF:temps1=weather.rrd:temps1:AVERAGE LINE2:temps1#204a87:"Temperatur unten" DEF:temps2=weather.rrd:temps2:AVERAGE LINE2:temps2#f57900:"Temperatur oben" DEF:temps9=weather.rrd:temps9:AVERAGE LINE2:temps9#4e9a06:"Temperatur aussen"
     5rrdtool graph web/temperatur_1woche.png -w 800 -h 500 -s 'now - 1 week' -e 'now' DEF:temps1=weather.rrd:temps1:AVERAGE LINE2:temps1#204a87:"Temperatur unten" DEF:temps2=weather.rrd:temps2:AVERAGE LINE2:temps2#f57900:"Temperatur oben" DEF:tempmins9=weather.rrd:temps9:MIN DEF:tempmaxs9=weather.rrd:temps9:MAX DEF:temps9=weather.rrd:temps9:AVERAGE CDEF:tempranges9=tempmaxs9,tempmins9,- LINE1:tempmins9#4e9a06 AREA:tempranges9#8ae234::STACK LINE1:tempmaxs9#4e9a06 LINE2:temps9#4e9a06:"Temperatur aussen"
    66
    7 rrdtool graph web/temperatur_1monat.png -w 800 -h 500 -s 'now - 1 month' -e 'now' DEF:temps1=weather.rrd:temps1:AVERAGE LINE2:temps1#204a87:"Temperatur unten" DEF:temps2=weather.rrd:temps2:AVERAGE LINE2:temps2#f57900:"Temperatur oben" DEF:temps9=weather.rrd:temps9:AVERAGE LINE2:temps9#4e9a06:"Temperatur aussen"
     7rrdtool graph web/temperatur_1monat.png -w 800 -h 500 -s 'now - 1 month' -e 'now' DEF:temps1=weather.rrd:temps1:AVERAGE LINE2:temps1#204a87:"Temperatur unten" DEF:temps2=weather.rrd:temps2:AVERAGE LINE2:temps2#f57900:"Temperatur oben" DEF:tempmins9=weather.rrd:temps9:MIN DEF:tempmaxs9=weather.rrd:temps9:MAX DEF:temps9=weather.rrd:temps9:AVERAGE CDEF:tempranges9=tempmaxs9,tempmins9,- LINE1:tempmins9#4e9a06 AREA:tempranges9#8ae234::STACK LINE1:tempmaxs9#4e9a06 LINE2:temps9#4e9a06:"Temperatur aussen"
    88
    99
     
    1515
    1616
    17 rrdtool graph web/regen_1monat.png -s 'now - 1 month' -e 'now' -v mm/Tag DEF:rains9=weather.rrd:rains9:AVERAGE CDEF:rainpd=rains9,3600,*,24,*,0.295,* CDEF:rainpm=rainpd,30,* VDEF:totalrain=rainpm,AVERAGE GPRINT:totalrain:"Total %6.0lf mm/Monat" LINE2:rainpd#0000FF
     17rrdtool graph web/regen_1tag.png -w 800 -h 500 -s 'now - 1 day' -e 'now' -v mm/Stunde DEF:rains9=weather.rrd:rains9:AVERAGE CDEF:rainph=rains9,3600,*,1,*,0.295,* CDEF:rainpd=rainph,24,* VDEF:totalrain=rainpd,AVERAGE GPRINT:totalrain:"Total %6.0lf mm/Tag" LINE2:rainph#729fcf
     18
     19rrdtool graph web/regen_1woche.png -w 800 -h 500 -s 'now - 1 week' -e 'now' -v mm/Stunde DEF:rains9=weather.rrd:rains9:AVERAGE CDEF:rainph=rains9,3600,*,1,*,0.295,* CDEF:rainpw=rainph,168,* VDEF:totalrain=rainpw,AVERAGE GPRINT:totalrain:"Total %6.0lf mm/Woche" LINE2:rainph#729fcf
     20
     21rrdtool graph web/regen_1monat.png -w 800 -h 500 -s 'now - 1 month' -e 'now' -v mm/Tag DEF:rains9=weather.rrd:rains9:AVERAGE CDEF:rainpd=rains9,3600,*,24,*,0.295,* CDEF:rainpm=rainpd,30,* VDEF:totalrain=rainpm,AVERAGE GPRINT:totalrain:"Total %6.0lf mm/Monat" LINE2:rainpd#729fcf
     22
     23
     24rrdtool graph web/wind_1tag.png -w 800 -h 500 -s 'now - 1 day' -e 'now' -v km/h DEF:winds9=weather.rrd:winds9:AVERAGE LINE2:winds9#2e3436:"Wind km/h"
     25
     26rrdtool graph web/wind_1woche.png -w 800 -h 500 -s 'now - 1 week' -e 'now' -v km/h DEF:winds9=weather.rrd:winds9:AVERAGE LINE2:winds9#2e3436:"Wind km/h"
     27
     28rrdtool graph web/wind_1monat.png -w 800 -h 500 -s 'now - 1 month' -e 'now' -v km/h DEF:winds9=weather.rrd:winds9:AVERAGE LINE2:winds9#2e3436:"Wind km/h"
  • de.wigbels.ruby/hotcoldrain/hotcoldrain.rb

    raf9afaf rdaaef3e  
    2121#------------------------------------------
    2222class HotColdRain < Logger::Application
    23   attr_accessor :temp1, :humidity1, :serialport
     23  attr_accessor :temp1, :humidity1, :serialport, :mypath
    2424
    2525  def initialize(application_name)
    2626    super(application_name)
    2727    @serialport = SerialPort.new("/dev/ttyUSB0", 9600, 8, 1, SerialPort::NONE)
     28    @mypath = File.expand_path(File.dirname(__FILE__))
    2829  end
    2930
     
    6263        rrddata = 'N:'+datagrams.join(':')
    6364
    64         system("rrdtool update weather.rrd #{rrddata}")
     65        system("rrdtool update #{mypath}/weather.rrd #{rrddata}")
    6566
    6667        MQTT::Client.connect('mqtt://notwist:pixies@wigbels.net') do |c|
  • de.wigbels.ruby/hothotread/hothotpiper.rb

    raf9afaf rdaaef3e  
    1818$SAFE=0
    1919
    20 
    2120#------------------------------------------
    2221require 'net/http'
     
    2524include PiPiper
    2625
     26@mypath = File.expand_path(File.dirname(__FILE__))
     27
    2728
    2829watch :pin => 4, :trigger => :falling do
    2930  puts('added 10 liter of gas to sensor-database')
    3031  Net::HTTP.get(URI.parse('http://www.wigbels.net/cgi-bin/hhw.rb?sensorid=1&data=10'))
     32  system("rrdtool update #{@mypath}/energy.rrd N:10:U:U")
    3133end
    3234
Note: See TracChangeset for help on using the changeset viewer.