From 7b5638f4a610fd079a68f91bf2efd24fedf86a78 Mon Sep 17 00:00:00 2001 From: parix Date: Mon, 14 Dec 2009 20:38:31 +0000 Subject: [PATCH] Added Attribute "IODEVSTATS" -> Log IODEVSTATs like RSSI,MSGCOUNT git-svn-id: https://fhem.svn.sourceforge.net/svnroot/fhem/trunk/fhem@510 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- contrib/rrd/95_RRD_Log.pm | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/contrib/rrd/95_RRD_Log.pm b/contrib/rrd/95_RRD_Log.pm index c2e8de9ce..b0ab57a23 100644 --- a/contrib/rrd/95_RRD_Log.pm +++ b/contrib/rrd/95_RRD_Log.pm @@ -242,23 +242,24 @@ sub RRD_Log_Notify() { #INIT my $tsecs = time(); my $secs = 300; + my $msgcnt = $defs{$LASTIODev}{"${LASTIODev}_MSGCNT"}; if(!defined($data{RRD_LOG}{RAWMSGCOUNT}{$LASTIODev})){ $data{RRD_LOG}{RAWMSGCOUNT}{$LASTIODev}{TSECS} = $tsecs; - $data{RRD_LOG}{RAWMSGCOUNT}{$LASTIODev}{CNT} = $defs{$LASTIODev}{"${LASTIODev}_MSGCNT"}; - Log $ll,"RRDLOG|IODEVSTATS|RAWMSGCOUNT|$LASTIODev|INIT:" . $defs{$LASTIODev}{"${LASTIODev}_MSGCNT"}; + $data{RRD_LOG}{RAWMSGCOUNT}{$LASTIODev}{CNT} = $msgcnt; + Log $ll,"RRDLOG|IODEVSTATS|RAWMSGCOUNT|$LASTIODev|INIT:" . $msgcnt; } #Calculate my $calc_next = $tsecs - $data{RRD_LOG}{RAWMSGCOUNT}{$LASTIODev}{TSECS}; Log $ll,"RRDLOG|IODEVSTATS|RAWMSGCOUNT|$LASTIODev|calc_next: $calc_next"; if($calc_next > $secs) { - $iodev_msgcnt = $defs{$LASTIODev}{RAWMSGCOUNT} - $data{RRD_LOG}{RAWMSGCOUNT}{$LASTIODev}{CNT}; + $iodev_msgcnt = $msgcnt - $data{RRD_LOG}{RAWMSGCOUNT}{$LASTIODev}{CNT}; $iostat_reading = "RAWMSGCOUNT"; Log $ll,"RRDLOG|IODEVSTATS|RAWMSGCOUNT|$LASTIODev|RRD_Log_disptach_reading: $self,$LASTIODev,$iostat_reading ,$iodev_msgcnt,$timestamp"; $cul_rssi_return = &RRD_Log_disptach_reading($self,$LASTIODev,$iostat_reading ,$iodev_msgcnt,$timestamp); $data{RRD_LOG}{RAWMSGCOUNT}{$LASTIODev}{TSECS} = $tsecs; - $data{RRD_LOG}{RAWMSGCOUNT}{$LASTIODev}{CNT} = $defs{$LASTIODev}{"${LASTIODev}_MSGCNT"}; + $data{RRD_LOG}{RAWMSGCOUNT}{$LASTIODev}{CNT} = $msgcnt; $data{RRD_LOG}{RAWMSGCOUNT}{$LASTIODev}{LAST} = $iodev_msgcnt; - Log $ll,"RRDLOG|IODEVSTATS|RAWMSGCOUNT|$LASTIODev|Update: $tsecs|" . $defs{$LASTIODev}{"${LASTIODev}_MSGCNT"} . "|$iodev_msgcnt"; + Log $ll,"RRDLOG|IODEVSTATS|RAWMSGCOUNT|$LASTIODev|Update: $tsecs|" . $msgcnt . "|$iodev_msgcnt"; } } #RAWMSGCOUNT