diff --git a/fhem/FHEM/42_SYSMON.pm b/fhem/FHEM/42_SYSMON.pm index 6b5685eb5..867e94b05 100644 --- a/fhem/FHEM/42_SYSMON.pm +++ b/fhem/FHEM/42_SYSMON.pm @@ -4154,544 +4154,6 @@ sub SYSMON_Log($$$) { Log3 $hash, $loglevel, "SYSMON $instName: $sub.$xline " . $text; } -#sub trim($) -#{ -# my $string = shift; -# $string =~ s/^\s+//; -# $string =~ s/\s+$//; -# return $string; -#} - - -# --- SNX --------------------------------------------------------------------- - -# SYSMON_ShowBarChartHtml(,); -# device: name of the linked sysmon instance -# options: perl hash { key=>value, key=>value, .. } containing options. possible keys are: -# - bars: comma separated list of bars to show. possible bars are: -# - us: uptime system -# - uf: uptime fhem -# - cf[|]: cpu frequency - is the target cpu core number [0..n] -# - cl[|]: cpu load - is the target cpu core number [0..n] -# - ct: cpu temperature -# - mr: memory ram -# - ms: memory swap -# - fs| file system - is the target reading name -# the default value (if you do not provide bars option) is: us,uf,cl,ct,cf,mr,ms,fs:fs_root -# a bar won't displayed if the appropriate reading doesn't exist (e.g. cpu_freq @ fritzbox) or is empty (e.g. cpu_temp @ fritz box), even if you defined the bar to show. -# - title_: bar title. if you use a bar in the bars option, but do not provide a title the default title will be displayed. possible bar names and their default title are: -# - us: uptime -# - uf: uptime fhem -# - cf: cpu% freq -# - cl: cpu% load -# - ct: cpu temp -# - mr: mem ram -# - ms: mem swap -# - fs: fs % -# - fsx: {fs_root=>"fs root"} -# - cfx: -# - clx: -# you can use the variable % within: -# - cf,cl: % will be replaced by the cpu core number -# - fs: % will be replaced by the reading name -# using bar names ending with x you can provide title for specific bars (e.g. cpu1, cpu2, fs_root, fs_boot). -# it has to be a perl hash too, where key is depending of the type: -# - fsx: name of the filesystem reading (e.g. fs_root, fs_boot) -# - cfx: cpu core number -# - clx: cpu core number -# - ctx: cpu core number -# if you provide a title for a specific bar (e.g title_cfx=>{1=>"cpu1 freq"}), this will be prefered and 'override' the general title (e.g. title_cf=>"cpu freq") -# - stat: display of statistic data [min, max, avg]. possible values: -# - 0: no statistic data -# - 1: colored ranges (min to avg, avg to max) as bar overlay, hover-info for pc, click-info for tablet/mobile -# - weblink: name of a weblink instance. if you use this method inside a weblink you can provide the name if the weblink instance. due to that the title will appear as a link targeting the weblink instance detail page. -# - title: the title of the chart. the default title is the name of the linked sysmon instance. if you supplied the weblink option this will be the default title. -# supply empty value to prevent title output. -# - color: html/css color definition. possible type names and their default colors are: -# - Border: bar border (black) -# - Fill: bar content (tan) -# - Text: bar text (empty -> css style default) -# - Stat: statistic data [min, max, avg] indicatator (=border -> if you change border, this will changed as well) -# - MinAvg: statistic data range1 - min to avg -# - AvgMax: staristic data range2 - avg to max -# color can be any html/css color definition: -# - name: red -# - hex: #ff0000 -# - rgb: rgb(255,0,0) -# rgba(255,0,0,.5) -# -# example usage inside a weblink instance: -# - no customization.. -# define wlRasPi1 weblink htmlCode {SYSMON_ShowBarChartHtml("sysRaspi")} -# - define which bars to show (cpu load, cpu temperature and filesystem fs_root).. -# define wlRasPi2 weblink htmlCode {SYSMON_ShowBarChartHtml("sysRaspi",{bars=>"cl,ct,fs|fs_root"})} -# - show bars for each cpu core (in this case we've got 4 cores).. -# define wlRasPi3 weblink htmlCode {SYSMON_ShowBarChartHtml("sysRaspi",{bars=>"ct,cl,cl|0,cl|1,cl|2,cl|3"})} -# - customize bar titles (cpu load => CPULoad, uptime system => System Uptime, common filesystem FileSystem and the specific root filesystem (reading fs_root) => Root).. -# define wlRasPi4 weblink htmlCode {SYSMON_ShowBarChartHtml("sysRaspi",{title_cl=>"CPULoad",title_us=>"System Uptime",title_fs=>"FileSystem %",title_fs2=>{fs_root=>"Root"}})} -# - customize colors (bar will be filled red, the text will be white) -# define wlRasPi5 weblink htmlCode {SYSMON_ShowBarChartHtml("sysRaspi",{colorFill=>"red",colorText=>"#fff"})} -# - let the chart title become a link to the weblink instance -# define wlRasPi6 weblink htmlCode {SYSMON_ShowBarChartHtml("sysRaspi",{weblink=>"wlRasPi6"})} -# - customize chart title -# define wlRasPi7 weblink htmlCode {SYSMON_ShowBarChartHtml("sysRaspi",{title=>"This is my Chart"})} -# - disable statistical data -# define wlRasPi8 weblink htmlCode {SYSMON_ShowBarChartHtml("sysRaspi",{stat=>0})} -# - mix previous options -# define wlRasPi9 weblink htmlCode {SYSMON_ShowBarChartHtml("sysRaspi",{weblink=>"wlRasPi9", title=>"Rasperry Pi", stat=>0, bars=>"cl,ct,us,fs|fs_root,fs|fs_boot", title_cl=>"CPU load", title_ct=>"CPU temperature", title_fs=>"FileSystem %", title_fsx=>{fs_root=>"Root"}, colorBorder=>"blue", colorFill=>"lightgray" ,colorText=>"blue"})} - - -sub SYSMON_ShowBarChartHtml($;$) { - my ($dev,$opt) = @_; - # extend with default options.. - $opt->{colorBorder} = $opt->{colorBorder} || 'black'; - $opt->{colorFill} = $opt->{colorFill} || 'tan'; - $opt->{colorText} = $opt->{colorText} || ''; # use font color by style.. - $opt->{colorStat} = $opt->{colorStat} || $opt->{colorBorder}; - $opt->{colorMinAvg} = $opt->{colorMinAvg} || 'lightsalmon'; - $opt->{colorAvgMax} = $opt->{colorAvgMax} || 'lightgreen'; - $opt->{title} = defined($opt->{title}) ? $opt->{title} : ( $opt->{weblink} || $dev ); - $opt->{weblink} = $opt->{weblink} || ''; - $opt->{bars} = $opt->{bars} || 'uf,us,cl,ct,cf,mr,ms,fs|fs_root'; - $opt->{title_uf} = $opt->{title_uf} || 'uptime fhem'; - $opt->{title_us} = $opt->{title_us} || 'uptime'; - $opt->{title_ct} = $opt->{title_ct} || 'cpu temp'; - $opt->{title_cf} = $opt->{title_cf} || 'cpu% freq'; - $opt->{title_cl} = $opt->{title_cl} || 'cpu% load'; - $opt->{title_mr} = $opt->{title_mr} || 'mem ram'; - $opt->{title_ms} = $opt->{title_ms} || 'mem swap'; - $opt->{title_fs} = $opt->{title_fs} || 'fs %'; - $opt->{title_fsx} = $opt->{title_fsx} || {fs_root=>'fs root'}; - $opt->{stat} = defined($opt->{stat}) ? $opt->{stat} : 1; - # bar string to array/hash.. - $opt->{barList} = (); - foreach my $bar (split(/\s*,+\s*/,$opt->{bars})){ - my ($type,$param) = split(/\|/,$bar); - #push(@{$opt->{barList}},{id=>Data::GUID->new->as_string,type=>$type,param=>$param},); - push(@{$opt->{barList}},{id=>time=~s/[^0-9]//gr,type=>$type,param=>$param},); - } - # html templates.. - my $htmlTitleSimple = '
#TITLE#
'; - my $htmlTitleWeblink = ''; - my $htmlRow = '' - . '' - . ' #NAME#' - . ' #VALUE#' - . ''; - my $htmlBarSimple = '' - . '
' - . '
' - . '
' - . '
#CURT#
' - . '
' - . '
'; - my $htmlBarStat = '' - . '
' - . '
' - . '
' - . '
#CURT#
' - . '
' - . '
' - . '
' - . '
' - . '
' - . '
' - . '
' - . '
' - . '
' - . '
' - . '
' - . '
' - . '
' - . '
' - . '
#MINT# < #AVGT# < #MAXT#
' - . '
' - . '
'; - my $htmlScript .= '' - . ''; - # access sysmon data.. - #my $sysmon = SYSMON_getValues($dev); - my $sysmon = {}; - my $html=''; - if(defined($main::defs{$dev}{READINGS})) { - foreach my $r (keys %{$main::defs{$dev}->{READINGS}}){ - $sysmon->{$r} = $main::defs{$dev}{READINGS}{$r}{VAL}; - } - } else { - $html = 'Unknown device: '.$dev; - } - # build bar chart html.. - - # ..title - if (defined($opt->{title}) and $opt->{title} ne ''){ - if (defined($opt->{weblink}) and $opt->{weblink} ne ''){ - $html .= $htmlTitleWeblink =~ s/#TITLE#/$opt->{title}/r =~ s/#WEBLINK#/$opt->{weblink}/r; - } - else{ - $html .= $htmlTitleSimple =~ s/#TITLE#/$opt->{title}/r; - } - } - # ..bars - my $htmlBar = ($opt->{stat} eq 1) ? $htmlBarStat : $htmlBarSimple; - $html .= ''; - foreach my $bar (@{$opt->{barList}}){ - $bar->{param} = $bar->{param} || ''; - my $title = $opt->{'title_'.$bar->{type}.'x'}{$bar->{param}} || $opt->{'title_'.$bar->{type}}; - if ($bar->{type} eq 'us'){ - # uptime system / idle.. - if (defined($sysmon->{uptime})){ - my $upSystem = SYSMON_secsToReadable($sysmon->{uptime}); - # idle.. - if (defined($sysmon->{idletime})){ - #25386 99.32 % - my (undef,$idleP,undef) = split(/\s+/,$sysmon->{idletime}); - $upSystem .= " ($idleP % idle)"; - } - $html .= $htmlRow - =~ s/#NAME#/$title/gr - =~ s/#VALUE#/$upSystem/gr; - } - } - elsif ($bar->{type} eq 'uf'){ - # uptime fhem.. - if (defined($sysmon->{fhemuptime})){ - my $upFhem = SYSMON_secsToReadable($sysmon->{fhemuptime}); - $html .= $htmlRow - =~ s/#NAME#/$title/gr - =~ s/#VALUE#/$upFhem/gr; - } - } - elsif ($bar->{type} eq 'cf'){ - my $name = 'cpu'.$bar->{param}.'_freq'; - my $nameS = $name.'_stat'; - # cpu freq.. - if (defined($sysmon->{$name})){ - my %cf = (); - # min max avg.. - if (defined($sysmon->{$nameS})){ - #600.00 900.00 845.36 - ($cf{min}, $cf{max}, $cf{avg}) = split(/\s+/,$sysmon->{$nameS}); - } - $cf{curP} = sprintf("%.1f",$sysmon->{$name}/10); - $cf{curT} = sprintf("%.0f",$sysmon->{$name})." MHz"; - $cf{minP} = sprintf("%.1f",($cf{min}/10)); - $cf{minT} = sprintf("%.0f",$cf{min})." MHz"; - $cf{maxP} = sprintf("%.1f",($cf{max}/10)); - $cf{maxT} = sprintf("%.0f",$cf{max})." MHz"; - $cf{avgP} = sprintf("%.1f",($cf{avg}/10)); - $cf{avgT} = sprintf("%.0f",$cf{avg})." MHz"; - $cf{title} = $title =~ s/%/$bar->{param}/gr; - $html .= $htmlRow - =~ s/#NAME#/$cf{title}/gr - =~ s/#VALUE#/$htmlBar/gr - =~ s/#ID#/$bar->{id}/gr - =~ s/#CURP#/$cf{curP}/gr =~ s/#CURT#/$cf{curT}/gr - =~ s/#MINP#/$cf{minP}/gr =~ s/#MINT#/$cf{minT}/gr - =~ s/#MAXP#/$cf{maxP}/gr =~ s/#MAXT#/$cf{maxT}/gr - =~ s/#AVGP#/$cf{avgP}/gr =~ s/#AVGT#/$cf{avgT}/gr; - } - } - elsif ($bar->{type} eq 'ct'){ - # cpu temp.. - if (defined($sysmon->{cpu_temp}) and $sysmon->{cpu_temp} > 0){ - my %ct = (); - # min max avg.. - if (defined($sysmon->{cpu_temp_stat})){ - #40.62 42.24 41.54 - ($ct{min}, $ct{max}, $ct{avg}) = split(/\s+/,$sysmon->{cpu_temp_stat}); - } - $ct{curP} = sprintf("%.1f",$sysmon->{cpu_temp}); - $ct{curT} = $ct{curP}." °C"; - $ct{minP} = sprintf("%.1f",$ct{min}); - $ct{minT} = $ct{minP}." °C"; - $ct{maxP} = sprintf("%.1f",$ct{max}); - $ct{maxT} = $ct{maxP}." °C"; - $ct{avgP} = sprintf("%.1f",$ct{avg}); - $ct{avgT} = $ct{avgP}." °C"; - $ct{title} = $title =~ s/%/$bar->{param}/gr; - $html .= $htmlRow - =~ s/#NAME#/$ct{title}/gr - =~ s/#VALUE#/$htmlBar/gr - =~ s/#ID#/$bar->{id}/gr - =~ s/#CURP#/$ct{curP}/gr =~ s/#CURT#/$ct{curT}/gr - =~ s/#MINP#/$ct{minP}/gr =~ s/#MINT#/$ct{minT}/gr - =~ s/#MAXP#/$ct{maxP}/gr =~ s/#MAXT#/$ct{maxT}/gr - =~ s/#AVGP#/$ct{avgP}/gr =~ s/#AVGT#/$ct{avgT}/gr; - } - } - elsif ($bar->{type} eq 'cl'){ - my $name = 'stat_cpu'.$bar->{param}.'_percent'; - my $nameS = 'cpu'.$bar->{param}.'_idle_stat'; - # cpu load.. - if (defined($sysmon->{$name})){ - my %cl = (); - #0.28 0.00 0.20 99.43 0.02 0.00 0.07 - (undef,undef,undef,$cl{I},undef,undef,undef) = split(/\s+/,$sysmon->{$name}); - # min max avg.. - if ($opt->{stat} eq 1 and defined($sysmon->{$nameS})){ - #92.53 99.75 98.84 - ($cl{min},$cl{max},$cl{avg}) = split(/\s+/,$sysmon->{$nameS}); - } - $cl{curP} = sprintf("%.1f",100-$cl{I}); - $cl{curT} = $cl{curP}." %"; - $cl{minP} = sprintf("%.1f",100-$cl{max}); - $cl{minT} = $cl{minP}." %"; - $cl{maxP} = sprintf("%.1f",100-$cl{min}); - $cl{maxT} = $cl{maxP}." %"; - $cl{avgP} = sprintf("%.1f",100-$cl{avg}); - $cl{avgT} = $cl{avgP}." %"; - $cl{title} = $title =~ s/%/$bar->{param}/gr; - $html .= $htmlRow - =~ s/#NAME#/$cl{title}/gr - =~ s/#VALUE#/$htmlBar/gr - =~ s/#ID#/$bar->{id}/gr - =~ s/#CURP#/$cl{curP}/gr =~ s/#CURT#/$cl{curT}/gr - =~ s/#MINP#/$cl{minP}/gr =~ s/#MINT#/$cl{minT}/gr - =~ s/#MAXP#/$cl{maxP}/gr =~ s/#MAXT#/$cl{maxT}/gr - =~ s/#AVGP#/$cl{avgP}/gr =~ s/#AVGT#/$cl{avgT}/gr; - } - } - elsif ($bar->{type} =~ /^m[r|s]$/){ - my $name = ($bar->{type} eq 'mr') ? 'ram' : 'swap'; - my $nameS = $name.'_used_stat'; - #mem ram / swap.. - if (defined($sysmon->{$name})){ - my %mx = (); - #Total: 927.08 MB, Used: 47.86 MB, 5.16 %, Free: 879.22 MB - if($sysmon->{$name} ne 'n/a') { - (undef,$mx{T},$mx{Un},undef,$mx{U},undef,$mx{P},undef,undef,$mx{F},undef) = split(/[\s,]+/,$sysmon->{$name}); - # min max avg.. - if (defined($sysmon->{$nameS})){ - #.. - ($mx{min},$mx{max},$mx{avg}) = split(/\s+/,$sysmon->{$nameS}); - } - #if ($mx{T} gt 1024){ # geht ned.. - #if (int($mx{T}) gt 1024){ # geht ned.. - if (length($mx{T}) gt 6){ - $mx{U} /= 1024; - $mx{T} /= 1024; - $mx{min} /= 1024; - $mx{max} /= 1024; - $mx{avg} /= 1024; - $mx{Un} = 'GB'; - } - $mx{curP} = sprintf("%.1f",$mx{U}/$mx{T}*100); - $mx{curT} = sprintf("%.0f",$mx{U})." / ".sprintf("%.0f",$mx{T})." ".$mx{Un}; - $mx{minP} = sprintf("%.1f",$mx{min}/$mx{T}*100); - $mx{minT} = sprintf("%.0f",$mx{min})." ".$mx{Un}; - $mx{maxP} = sprintf("%.1f",$mx{max}/$mx{T}*100); - $mx{maxT} = sprintf("%.0f",$mx{max})." ".$mx{Un}; - $mx{avgP} = sprintf("%.1f",$mx{avg}/$mx{T}*100); - $mx{avgT} = sprintf("%.0f",$mx{avg})." ".$mx{Un}; - $html .= $htmlRow - =~ s/#NAME#/$title/gr - =~ s/#VALUE#/$htmlBar/gr - =~ s/#ID#/$bar->{id}/gr - =~ s/#CURP#/$mx{curP}/gr =~ s/#CURT#/$mx{curT}/gr - =~ s/#MINP#/$mx{minP}/gr =~ s/#MINT#/$mx{minT}/gr - =~ s/#MAXP#/$mx{maxP}/gr =~ s/#MAXT#/$mx{maxT}/gr - =~ s/#AVGP#/$mx{avgP}/gr =~ s/#AVGT#/$mx{avgT}/gr; - } - } - } - elsif ($bar->{type} eq 'fs'){ - #storage.. - if (defined($sysmon->{$bar->{param}})){ - my %fs = (); - #Total: 14831 MB, Used: 2004 MB, 15 %, Available: 12176 MB at / - (undef,$fs{T},$fs{Un},undef,$fs{U},undef,$fs{P},undef,undef,$fs{F},undef) = split(/[\s,]+/,$sysmon->{$bar->{param}}); - if ($fs{T} gt 0){ - if (scalar($fs{T}) > 10000){ # geht ned.. - #if (int($fs{T}) gt 1024){ # geht ned.. - #if (length($fs{T}) gt 4){ - $fs{U} /= 1024; - $fs{T} /= 1024; - $fs{Un} = 'GB'; - } - $fs{curP} = sprintf("%.1f",$fs{U}/$fs{T}*100); - $fs{curT} = sprintf("%.1f",$fs{U})." / ".sprintf("%.1f",$fs{T})." ".$fs{Un}; - #$fs{minP} = sprintf("%.1f",($fs{min}/$fs{T}*100)); - #$fs{minT} = sprintf("%.0f",$fs{min})." ".$fs{Un}; - #$fs{maxP} = sprintf("%.1f",$fs{max}/$fs{T}*100); - #$fs{maxT} = sprintf("%.0f",$fs{max})." ".$fs{Un}; - #$fs{avgP} = sprintf("%.1f",$fs{avg}/$fs{T}*100); - #$fs{avgT} = sprintf("%.0f",$fs{avg})." ".$fs{Un}; - $fs{title} = $title =~ s/%/$bar->{param}/gr; - $html .= $htmlRow - =~ s/#NAME#/$fs{title}/gr - =~ s/#VALUE#/$htmlBarSimple/gr - =~ s/#ID#/$bar->{id}/gr - =~ s/#CURP#/$fs{curP}/gr =~ s/#CURT#/$fs{curT}/gr; - #=~ s/#MINP#/$fs{minP}/gr =~ s/#MINT#/$fs{minT}/gr - #=~ s/#MAXP#/$fs{maxP}/gr =~ s/#MAXT#/$fs{maxT}/gr - #=~ s/#AVGP#/$fs{avgP}/gr =~ s/#AVGT#/$fs{avgT}/gr; - } - } - } - } - $html .= '
'; - $html .= $htmlScript if ($opt->{stat} eq 1); - return $html; -} - - -#sub SYSMON_secsToReadable($){ -# my $secs = shift; -# my $y = floor($secs / 60/60/24/365); -# my $d = floor($secs/60/60/24) % 365; -# my $h = floor(($secs / 3600) % 24); -# my $m = floor(($secs / 60) % 60); -# my $s = $secs % 60; -# my $string = ''; -# $string .= $y.'y ' if ($y > 0); -# $string .= $d.'d ' if ($d > 0); -# $string .= $h.'h ' if ($h > 0); -# $string .= $m.'m ' if ($m > 0); -# $string .= $s.'s' if ($s > 0); -# return $string; -#} - -# --- SNX --------------------------------------------------------------------- - -## ----------------------------------------------------------------------------- -## Visualisation module. provided by snx. -## -## usage: -## SYSMON_weblinkHeader([,]) : create a clickable device header -## SYSMON_ShowBarChartHtml([,[,]]) : create a bar chart for sysmon device -## -## example: -## define wlSysmon weblink htmlCode {SYSMON_weblinkHeader('wlSysmon').SYSMON_ShowBarChartHtml('sysmon')} -## define wlSysmon weblink htmlCode {SYSMON_weblinkHeader('wlSysmon','Cubietruck').SYSMON_ShowBarChartHtml('sysmon','steelblue','gray')} -## -## ----------------------------------------------------------------------------- -sub SYSMON_weblinkHeader_alt($;$){ - my $dev = shift; - my $text = shift||$dev; - return ''; -} - -sub SYSMON_ShowBarChartHtml_alt($;$$){ - my $dev = shift; - - my $colFill = shift || 'lightCoral'; - my $colBorder = shift || 'black'; - - my $htmlRow .= '' - . '' - . ' #NAME#' - . ' #VALUE#' - . ''; - my $htmlBar .= '' - . '
' - . '
' - . '
' - . '

#TEXT#

' - . '
'; - - # access sysmon data.. - #my $sysmon = SYSMON_getValues($dev); - my $sysmon = {}; - foreach my $r (keys %{$main::defs{$dev}->{READINGS}}){ - $sysmon->{$r} = $main::defs{$dev}{READINGS}{$r}{VAL}; - } - - my $html = ''; - - # cpu load.. - if (defined($sysmon->{'stat_cpu_percent'})){ - #0.28 0.00 0.20 99.43 0.02 0.00 0.07 - my (undef,undef,undef,$cpuI,undef,undef,undef) = split(/\s+/,$sysmon->{'stat_cpu_percent'}); - my $cpuLoadP = sprintf("%.1f",(100-$cpuI)); - my $cpuLoadT = $cpuLoadP." %"; - $html .= $htmlRow =~ s/#NAME#/cpu load/r =~ s/#VALUE#/$htmlBar/r =~ s/#PERC#/$cpuLoadP/r =~ s/#TEXT#/$cpuLoadT/r; - } - - # cpu temp.. - if (defined($sysmon->{'cpu_temp'})){ - my $cpuTempT = $sysmon->{'cpu_temp'}." °C"; - my $cpuTempP = $sysmon->{'cpu_temp'}; - $html .= $htmlRow =~ s/#NAME#/cpu temp/r =~ s/#VALUE#/$htmlBar/r =~ s/#PERC#/$cpuTempP/r =~ s/#TEXT#/$cpuTempT/r; - } - - # cpu freq.. - if (defined($sysmon->{'cpu_freq'})){ - my $cpuFreqT = $sysmon->{'cpu_freq'}." MHz"; - my $cpuFreqP = $sysmon->{'cpu_freq'}/10; - $html .= $htmlRow =~ s/#NAME#/cpu freq/r =~ s/#VALUE#/$htmlBar/r =~ s/#PERC#/$cpuFreqP/r =~ s/#TEXT#/$cpuFreqT/r; - } - - #mem ram.. - if (defined($sysmon->{'ram'})){ - #Total: 927.08 MB, Used: 47.86 MB, 5.16 %, Free: 879.22 MB - my (undef,$ramT,$ramUn,undef,$ramU,undef,$ramP,undef,undef,$ramF,undef) = split(/[\s,]+/,$sysmon->{'ram'}); - $ramT = sprintf("%.0f",$ramU)." / ".sprintf("%.0f",$ramT)." ".$ramUn; - $html .= $htmlRow =~ s/#NAME#/mem ram/r =~ s/#VALUE#/$htmlBar/r =~ s/#PERC#/$ramP/r =~ s/#TEXT#/$ramT/r; - } - - #mem swap.. - if (defined($sysmon->{'swap'})){ - #Total: 100.00 MB, Used: 0.00 MB, 0.00 %, Free: 100.00 MB - my (undef,$swapT,$swapUn,undef,$swapU,undef,$swapP,undef,undef,$swapF,undef) = split(/[\s,]+/,$sysmon->{'swap'}); - $swapT = sprintf("%.0f",$swapU)." / ".sprintf("%.0f",$swapT)." ".$swapUn; - $html .= $htmlRow =~ s/#NAME#/mem swap/r =~ s/#VALUE#/$htmlBar/r =~ s/#PERC#/$swapP/r =~ s/#TEXT#/$swapT/r; - } - - #sd-card.. - if (defined($sysmon->{'fs_root'})){ - #Total: 14831 MB, Used: 2004 MB, 15 %, Available: 12176 MB at / - #my $sd = R("$dev:fs_root"); - my (undef,$sdT,undef,undef,$sdU,undef,$sdP,undef,undef,$sdF,undef) = split(/[\s,]+/,$sysmon->{'fs_root'}); - $sdT = sprintf("%.1f",($sdU/1024))." / ".sprintf("%.1f",($sdT/1024))." GB"; - $html .= $htmlRow =~ s/#NAME#/root fs/r =~ s/#VALUE#/$htmlBar/r =~ s/#PERC#/$sdP/r =~ s/#TEXT#/$sdT/r; - } - - # uptime system / idle.. - if (defined($sysmon->{'uptime'})){ - my $upSystem = SYSMON_secsToReadable($sysmon->{'uptime'}); - if (defined($sysmon->{uptime})){ - #25386 99.32 % - my (undef,$idle,undef) = split(/\s+/,$sysmon->{'idletime'}); - $upSystem .= " ($idle % idle)"; - } - $html .= $htmlRow =~ s/#NAME#/system uptime/r =~ s/#VALUE#/$upSystem/r; - } - - # uptime fhem.. - if (defined($sysmon->{'fhemuptime'})){ - my $upFhem = SYSMON_secsToReadable($sysmon->{'fhemuptime'}); - $html .= $htmlRow =~ s/#NAME#/fhem uptime/r =~ s/#VALUE#/$upFhem/r; - } - - $html .= '
'; - return $html; -} - - -sub SYSMON_secsToReadable($){ - my $secs = shift; - my $y = floor($secs / 60/60/24/365); - my $d = floor($secs/60/60/24) % 365; - my $h = floor(($secs / 3600) % 24); - my $m = floor(($secs / 60) % 60); - my $s = $secs % 60; - my $string = ''; - $string .= $y.'y ' if ($y > 0); - $string .= $d.'d ' if ($d > 0); - $string .= $h.'h ' if ($h > 0); - $string .= $m.'m ' if ($m > 0); - $string .= $s.'s' if ($s > 0); - return $string; -} - # ----------------------------------------------------------------------------- 1; @@ -4704,555 +4166,456 @@ sub SYSMON_secsToReadable($){

SYSMON

(en | de)
    -This module provides statistics about the system running FHEM server. Furthermore, remote systems can be accessed (Telnet). Only Linux-based systems are supported. -Some informations are hardware specific and are not available on every platform. -So far, this module has been tested on the following systems: -Raspberry Pi (Debian Wheezy), BeagleBone Black, FritzBox 7390, WR703N under OpenWrt, CubieTruck and some others. -

    - For more information on a FritzBox check other moduls: FRITZBOX and FB_CALLMONITOR. -
    + This module provides statistics about the system running FHEM server. Furthermore, remote systems can be accessed (Telnet). Only Linux-based systems are supported. + Some informations are hardware specific and are not available on every platform. + So far, this module has been tested on the following systems: + Raspberry Pi (Debian Wheezy), BeagleBone Black, FritzBox 7390, WR703N under OpenWrt, CubieTruck and some others. +

    + For more information on a FritzBox check other moduls: FRITZBOX and FB_CALLMONITOR. +
    The modul uses the Perl modul 'Net::Telnet' for remote access. Please make sure that this module is installed. -

    - Define -

    - define <name> SYSMON [MODE[:[USER@]HOST][:PORT]] [<M1>[ <M2>[ <M3>[ <M4>]]]]
    -
    - -This statement creates a new SYSMON instance. The parameters M1 to M4 define the refresh interval for various Readings (statistics). The parameters are to be understood as multipliers for the time defined by INTERVAL_BASE. Because this time is fixed at 60 seconds, the Mx-parameter can be considered as time intervals in minutes.
    -If one (or more) of the multiplier is set to zero, the corresponding readings is deactivated. -
    -
    - The parameters are responsible for updating the readings according to the following scheme: -
      -
    • M1: (Default: 1)
      - cpu_freq, cpu_temp, cpu_temp_avg, loadavg, stat_cpu, stat_cpu_diff, stat_cpu_percent, stat_cpu_text, power readings

      -
    • -
    • M2: (Default: M1)
      - ram, swap
      -
    • -
    • M3: (Default: M1)
      - eth0, eth0_diff, wlan0, wlan0_diff

      -
    • -
    • M4: (Default: 10*M1)
      - Filesystem informations

      -
    • -
    • The following parameters are always updated with the base interval (regardless of the Mx-parameter):
      - fhemuptime, fhemuptime_text, idletime, idletime_text, uptime, uptime_text, starttime, starttime_text

      -
    • -
    - To query a remote system at least the address (HOST) must be specified. Accompanied by the port and / or user name, if necessary. The password (if needed) has to be defined once with the command 'set password '. For MODE parameter are 'telnet' and 'local' only allowed. 'local' does not require any other parameters and can also be omitted. -
    -
    +

    + Define +

    + define <name> SYSMON [MODE[:[USER@]HOST][:PORT]] [<M1>[ <M2>[ <M3>[ <M4>]]]]
    +
    + This statement creates a new SYSMON instance. The parameters M1 to M4 define the refresh interval for various Readings (statistics). The parameters are to be understood as multipliers for the time defined by INTERVAL_BASE. Because this time is fixed at 60 seconds, the Mx-parameter can be considered as time intervals in minutes.
    + If one (or more) of the multiplier is set to zero, the corresponding readings is deactivated. +
    +
    + The parameters are responsible for updating the readings according to the following scheme: +
      +
    • M1: (Default: 1)
      + cpu_freq, cpu_temp, cpu_temp_avg, loadavg, stat_cpu, stat_cpu_diff, stat_cpu_percent, stat_cpu_text, power readings

      +
    • +
    • M2: (Default: M1)
      + ram, swap
      +
    • +
    • M3: (Default: M1)
      + eth0, eth0_diff, wlan0, wlan0_diff

      +
    • +
    • M4: (Default: 10*M1)
      + Filesystem informations

      +
    • +
    • The following parameters are always updated with the base interval (regardless of the Mx-parameter):
      + fhemuptime, fhemuptime_text, idletime, idletime_text, uptime, uptime_text, starttime, starttime_text

      +
    • +
    + To query a remote system at least the address (HOST) must be specified. Accompanied by the port and / or user name, if necessary. The password (if needed) has to be defined once with the command 'set password <password>'. For MODE parameter are 'telnet' and 'local' only allowed. 'local' does not require any other parameters and can also be omitted. +
    +
    + Readings: +

    +
      +
    • cpu_core_count
      + CPU core count +
    • +
    • cpu_model_name
      + CPU model name +
    • +
    • cpu_bogomips
      + CPU Speed: BogoMIPS +
    • +
    • cpu_freq (and cpu1_freq for dual core systems)
      + CPU frequency +
    • +
      +
    • cpu_temp
      + CPU temperature +
    • +
      +
    • cpu_temp_avg
      + Average of the CPU temperature, formed over the last 4 values. +
    • +
      +
    • fhemuptime
      + Time (in seconds) since the start of FHEM server. +
    • +
      +
    • fhemuptime_text
      + Time since the start of the FHEM server: human-readable output (text representation). +
    • +
      +
    • fhemstarttime
      + Start time (in seconds since 1.1.1970 1:00:00) of FHEM server. +
    • +
      +
    • fhemstarttime_text
      + Start time of the FHEM server: human-readable output (text representation). +
    • +
      +
    • idletime
      + Time spent by the system since the start in the idle mode (period of inactivity). +
    • +
      +
    • idletime_text
      + The inactivity time of the system since system start in human readable form. +
    • +
      +
    • loadavg
      + System load (load average): 1 minute, 5 minutes and 15 minutes. +
    • +
      +
    • ram
      + memory usage. +
    • +
      +
    • swap
      + swap usage. +
    • +
      +
    • uptime
      + System uptime. +
    • +
      +
    • uptime_text
      + System uptime (human readable). +
    • +
      +
    • starttime
      + System starttime. +
    • +
      +
    • starttime_text
      + System starttime (human readable). +
    • +
      +
    • Network statistics
      + Statistics for the specified network interface about the data volumes transferred and the difference since the previous measurement. +
      + Examples:
      + Amount of the transmitted data via interface eth0.
      + eth0: RX: 940.58 MB, TX: 736.19 MB, Total: 1676.77 MB
      + Change of the amount of the transferred data in relation to the previous call (for eth0).
      + eth0_diff: RX: 0.66 MB, TX: 0.06 MB, Total: 0.72 MB
      + IP and IP v6 adresses + eth0_ip 192.168.0.15
      + eth0_ip6 fe85::49:4ff:fe85:f885/64
      +
    • +
      +
    • Network Speed (if avialable)
      + speed of the network connection. +
      + Examples:
      + eth0_speed 100
      +
    • +
      +
    • File system information
      + Usage of the desired file systems.
      + Example:
      + fs_root: Total: 7340 MB, Used: 3573 MB, 52 %, Available: 3425 MB at / +
    • +
      +
    • CPU utilization
      + Information about the utilization of CPUs.
      + Example:
      + stat_cpu: 10145283 0 2187286 90586051 542691 69393 400342
      + stat_cpu_diff: 2151 0 1239 2522 10 3 761
      + stat_cpu_percent: 4.82 0.00 1.81 93.11 0.05 0.00 0.20
      + stat_cpu_text: user: 32.17 %, nice: 0.00 %, sys: 18.53 %, idle: 37.72 %, io: 0.15 %, irq: 0.04 %, sirq: 11.38 % +
    • +
      +
    • user defined
      + These readings provide output of commands, which are passed to the operating system or delivered by user defined functions. +
    • +
      + FritzBox specific Readings +
    • wlan_state
      + WLAN state: on/off +
    • +
      +
    • wlan_guest_state
      + GuestWLAN state: on/off +
    • +
      +
    • internet_ip
      + current IP-Adresse +
    • +
      +
    • internet_state
      + state of the Internet connection: connected/disconnected +
    • +
      +
    • night_time_ctrl
      + state night time control (do not disturb): on/off +
    • +
      +
    • num_new_messages
      + Number of new Voice Mail messages +
    • +
      +
    • fw_version_info
      + Information on the installed firmware version: <VersionNum> <creation date> <time> +
    • +
      + DSL Informations (FritzBox) +
    • dsl_rate
      + Information about the down und up stream rate +
    • +
      +
    • dsl_synctime
      + sync time with DSLAM +
    • +
      +
    • dsl_crc_15
      + number of uncorrectable errors (CRC) for the last 15 minutes +
    • +
      +
    • dsl_fec_15
      + number of correctable errors (FEC) for the last 15 minutes +
    • +
      + Power Supply Readings +
    • power_ac_stat
      + status information to the AC socket: online (0|1), present (0|1), voltage, current
      + Example:
      + power_ac_stat: 1 1 4.807 264
      +
    • +
      +
    • power_ac_text
      + human readable status information to the AC socket
      + Example:
      + power_ac_text ac: present / online, voltage: 4.807 V, current: 264 mA
      +
    • +
      +
    • power_usb_stat
      + status information to the USB socket +
    • +
      +
    • power_usb_text
      + human readable status information to the USB socket +
    • +
      +
    • power_battery_stat
      + status information to the battery (if installed): online (0|1), present (0|1), voltage, current, actual capacity
      + Example:
      + power_battery_stat: 1 1 4.807 264 100
      +
    • +
      +
    • power_battery_text
      + human readable status information to the battery (if installed) +
    • +
      +
    • power_battery_info
      + human readable additional information to the battery (if installed): technology, capacity, status, health, total capacity
      + Example:
      + power_battery_info: battery info: Li-Ion , capacity: 100 %, status: Full , health: Good , total capacity: 2100 mAh
      + The capacity must be defined in script.bin (e.g. ct-hdmi.bin). Parameter name pmu_battery_cap. Convert with bin2fex (bin2fex -> script.fex -> edit -> fex2bin -> script.bin).
      +
    • +
      +
    • cpuX_freq_stat
      + Frequency statistics for CPU X: minimum, maximum and average values
      + Example:
      + cpu0_freq_stat: 100 1000 900
      +
    • +
      +
    • cpuX_idle_stat
      + Idle statistik for CPU X: minimum, maximum and average values
      + Example:
      + cpu0_freq_stat: 23.76 94.74 90.75
      +
    • +
      +
    • cpu[X]_temp_stat
      + Temperature statistik for CPU: minimum, maximum and average values
      + Example:
      + cpu_temp_stat: 41.00 42.50 42.00
      +
    • +
      +
    • ram_used_stat
      + RAM usage statistics: minimum, maximum and average values
      + Example:
      + ram_used_stat: 267.55 1267.75 855.00
      +
    • +
      +
    • swap_used_stat
      + SWAP usage statistics: minimum, maximum and average values
      + Example:
      + swap_used_stat: 0 1024.00 250.00
      +
    • +
      +
      +
    - Readings: -

    -
      -
    • cpu_core_count
      - CPU core count -
    • -
    • cpu_model_name
      - CPU model name -
    • -
    • cpu_bogomips
      - CPU Speed: BogoMIPS -
    • -
    • cpu_freq (and cpu1_freq for dual core systems)
      - CPU frequency -
    • -
      -
    • cpu_temp
      - CPU temperature -
    • -
      -
    • cpu_temp_avg
      - Average of the CPU temperature, formed over the last 4 values. -
    • -
      -
    • fhemuptime
      - Time (in seconds) since the start of FHEM server. -
    • -
      -
    • fhemuptime_text
      - Time since the start of the FHEM server: human-readable output (text representation). -
    • -
      -
    • fhemstarttime
      - Start time (in seconds since 1.1.1970 1:00:00) of FHEM server. -
    • -
      -
    • fhemstarttime_text
      - Start time of the FHEM server: human-readable output (text representation). -
    • -
      -
    • idletime
      - Time spent by the system since the start in the idle mode (period of inactivity). -
    • -
      -
    • idletime_text
      - The inactivity time of the system since system start in human readable form. -
    • -
      -
    • loadavg
      - System load (load average): 1 minute, 5 minutes and 15 minutes. -
    • -
      -
    • ram
      - memory usage. -
    • -
      -
    • swap
      - swap usage. -
    • -
      -
    • uptime
      - System uptime. -
    • -
      -
    • uptime_text
      - System uptime (human readable). -
    • -
      -
    • starttime
      - System starttime. -
    • -
      -
    • starttime_text
      - System starttime (human readable). -
    • -
      -
    • Network statistics
      - Statistics for the specified network interface about the data volumes transferred and the difference since the previous measurement. -
      - Examples:
      - Amount of the transmitted data via interface eth0.
      - eth0: RX: 940.58 MB, TX: 736.19 MB, Total: 1676.77 MB
      - Change of the amount of the transferred data in relation to the previous call (for eth0).
      - eth0_diff: RX: 0.66 MB, TX: 0.06 MB, Total: 0.72 MB
      - IP and IP v6 adresses - eth0_ip 192.168.0.15
      - eth0_ip6 fe85::49:4ff:fe85:f885/64
      -
    • -
      -
    • Network Speed (if avialable)
      - speed of the network connection. -
      - Examples:
      - eth0_speed 100
      -
    • -
      -
    • File system information
      - Usage of the desired file systems.
      - Example:
      - fs_root: Total: 7340 MB, Used: 3573 MB, 52 %, Available: 3425 MB at / -
    • -
      -
    • CPU utilization
      - Information about the utilization of CPUs.
      - Example:
      - stat_cpu: 10145283 0 2187286 90586051 542691 69393 400342
      - stat_cpu_diff: 2151 0 1239 2522 10 3 761
      - stat_cpu_percent: 4.82 0.00 1.81 93.11 0.05 0.00 0.20
      - stat_cpu_text: user: 32.17 %, nice: 0.00 %, sys: 18.53 %, idle: 37.72 %, io: 0.15 %, irq: 0.04 %, sirq: 11.38 % -
    • -
      -
    • user defined
      - These readings provide output of commands, which are passed to the operating system or delivered by user defined functions. -
    • -
      - FritzBox specific Readings -
    • wlan_state
      - WLAN state: on/off -
    • -
      -
    • wlan_guest_state
      - GuestWLAN state: on/off -
    • -
      -
    • internet_ip
      - current IP-Adresse -
    • -
      -
    • internet_state
      - state of the Internet connection: connected/disconnected -
    • -
      -
    • night_time_ctrl
      - state night time control (do not disturb): on/off -
    • -
      -
    • num_new_messages
      - Number of new Voice Mail messages -
    • -
      -
    • fw_version_info
      - Information on the installed firmware version:
    • -
      - DSL Informations (FritzBox) -
    • dsl_rate
      - Information about the down und up stream rate -
    • -
      -
    • dsl_synctime
      - sync time with DSLAM -
    • -
      -
    • dsl_crc_15
      - number of uncorrectable errors (CRC) for the last 15 minutes -
    • -
      -
    • dsl_fec_15
      - number of correctable errors (FEC) for the last 15 minutes -
    • -
      - Power Supply Readings -
    • power_ac_stat
      - status information to the AC socket: online (0|1), present (0|1), voltage, current
      - Example:
      - power_ac_stat: 1 1 4.807 264
      -
    • -
      -
    • power_ac_text
      - human readable status information to the AC socket
      - Example:
      - power_ac_text ac: present / online, voltage: 4.807 V, current: 264 mA
      -
    • -
      -
    • power_usb_stat
      - status information to the USB socket -
    • -
      -
    • power_usb_text
      - human readable status information to the USB socket -
    • -
      -
    • power_battery_stat
      - status information to the battery (if installed): online (0|1), present (0|1), voltage, current, actual capacity
      - Example:
      - power_battery_stat: 1 1 4.807 264 100
      -
    • -
      -
    • power_battery_text
      - human readable status information to the battery (if installed) -
    • -
      -
    • power_battery_info
      - human readable additional information to the battery (if installed): technology, capacity, status, health, total capacity
      - Example:
      - power_battery_info: battery info: Li-Ion , capacity: 100 %, status: Full , health: Good , total capacity: 2100 mAh
      - The capacity must be defined in script.bin (e.g. ct-hdmi.bin). Parameter name pmu_battery_cap. Convert with bin2fex (bin2fex -> script.fex -> edit -> fex2bin -> script.bin).
      -
    • -
      -
    • cpuX_freq_stat
      - Frequency statistics for CPU X: minimum, maximum and average values
      - Example:
      - cpu0_freq_stat: 100 1000 900
      -
    • -
      -
    • cpuX_idle_stat
      - Idle statistik for CPU X: minimum, maximum and average values
      - Example:
      - cpu0_freq_stat: 23.76 94.74 90.75
      -
    • -
      -
    • cpu[X]_temp_stat
      - Temperature statistik for CPU: minimum, maximum and average values
      - Example:
      - cpu_temp_stat: 41.00 42.50 42.00
      -
    • -
      -
    • ram_used_stat
      - RAM usage statistics: minimum, maximum and average values
      - Example:
      - ram_used_stat: 267.55 1267.75 855.00
      -
    • -
      -
    • swap_used_stat
      - SWAP usage statistics: minimum, maximum and average values
      - Example:
      - swap_used_stat: 0 1024.00 250.00
      -
    • -
      -
      -
    - - Sample output:
    -
      - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
      cpu_freq
      900
      2013-11-27 00:05:36
      cpu_temp
      49.77
      2013-11-27 00:05:36
      cpu_temp_avg
      49.7
      2013-11-27 00:05:36
      eth0
      RX: 2954.22 MB, TX: 3469.21 MB, Total: 6423.43 MB
      2013-11-27 00:05:36
      eth0_diff
      RX: 6.50 MB, TX: 0.23 MB, Total: 6.73 MB
      2013-11-27 00:05:36
      fhemuptime
      11231
      2013-11-27 00:05:36
      fhemuptime_text  
      0 days, 03 hours, 07 minutes
      2013-11-27 00:05:36
      idletime
      931024 88.35 %
      2013-11-27 00:05:36
      idletime_text
      10 days, 18 hours, 37 minutes (88.35 %)
      2013-11-27 00:05:36
      loadavg
      0.14 0.18 0.22
      2013-11-27 00:05:36
      ram
      Total: 485 MB, Used: 140 MB, 28.87 %, Free: 345 MB
      2013-11-27 00:05:36
      swap
      n/a
      2013-11-27 00:05:36
      uptime
      1053739
      2013-11-27 00:05:36
      uptime_text
      12 days, 04 hours, 42 minutes
      2013-11-27 00:05:36
      wlan0
      RX: 0.00 MB, TX: 0.00 MB, Total: 0 MB
      2013-11-27 00:05:36
      wlan0_diff
      RX: 0.00 MB, TX: 0.00 MB, Total: 0.00 MB
      2013-11-27 00:05:36
      fs_root
      Total: 7404 MB, Used: 3533 MB, 50 %, Available: 3545 MB at /
      2013-11-27 00:05:36
      fs_boot
      Total: 56 MB, Used: 19 MB, 33 %, Available: 38 MB at /boot
      2013-11-27 00:05:36
      fs_usb1
      Total: 30942 MB, Used: 6191 MB, 21 %, Available: 24752 MB at /media/usb1  
      2013-11-27 00:05:36
      stat_cpu
      10145283 0 2187286 90586051 542691 69393 400342  
      2013-11-27 00:05:36
      stat_cpu_diff
      2151 0 1239 2522 10 3 761  
      2013-11-27 00:05:36
      stat_cpu_percent
      4.82 0.00 1.81 93.11 0.05 0.00 0.20  
      2013-11-27 00:05:36
      stat_cpu_text
      user: 32.17 %, nice: 0.00 %, sys: 18.53 %, idle: 37.72 %, io: 0.15 %, irq: 0.04 %, sirq: 11.38 %  
      2013-11-27 00:05:36
      -

    - - Get:

    -
      -
    • interval_base
      - Lists the specified polling intervalls. -
    • -
      -
    • interval_multipliers
      - Displays update intervals. -
    • -
      -
    • list
      - Lists all readings. -
    • -
      -
    • update
      - Refreshs all readings. -
    • -
      -
    • version
      - Displays the version of SYSMON module. -
    • -
      -
    • list_lan_devices
      - Displays known LAN Devices (FritzBox only). -
    • -
      - -

    - - Set:

    -
      -
    • interval_multipliers
      - Defines update intervals (as in the definition of the device). -
    • -
      -
    • clean
      - Clears user-definable Readings. After an update (manual or automatic) new readings are generated.
      -
    • -
      -
    • clear <reading name>
      - Deletes the Reading entry with the given name. After an update this entry is possibly re-created (if defined). This mechanism allows the selective deleting unnecessary custom entries.
      -
    • -
      -
    • password <Passwort>
      - Specify the password for remote access (usually only necessary once). -
    • -
      -

    - - Attributes:

    -
      -
    • filesystems <reading name>[:<mountpoint>[:<comment>]],...
      - Specifies the file system to be monitored (a comma-separated list).
      - Reading-name is used in the display and logging, the mount point is the basis of the evaluation, comment is relevant to the HTML display (see SYSMON_ShowValuesHTML)
      - Examples:
      - /boot,/,/media/usb1
      - fs_boot:/boot,fs_root:/:Root,fs_usb1:/media/usb1:USB-Stick
      -
    • -
      -
    • network-interfaces <name>[:<interface>[:<comment>]],...
      - Comma-separated list of network interfaces that are to be monitored. Each entry consists of the Reading-name, the name of the Netwerk adapter and a comment for the HTML output (see SYSMON_ShowValuesHTML). If no colon is used, the value is used simultaneously as a Reading-name and interface name.
      - Example ethernet:eth0:Ethernet,wlan:wlan0:WiFi
      -
    • -
      -
    • user-defined <readingsName>:<Interval_Minutes>:<Comment>:<Cmd>,...
      - This comma-separated list defines user defined Readings with the following data: Reading name, refresh interval (in minutes), a Comment, and operating system command. -
      The os commands are executed according to the specified Intervals and are noted as Readings with the specified name. Comments are used for the HTML output (see SYSMON_ShowValuesHTML).. -
      All parameter parts are required! -
      It is important that the specified commands are executed quickly, because at this time the entire FHEM server is blocked!
      - If results of the long-running operations required, these should be set up as a CRON job and store results as a text file.

      - Example: Display of package updates for the operating system:
      - cron-Job:
      - sudo apt-get update 2>/dev/null >/dev/null - apt-get upgrade --dry-run| perl -ne '/(\d*)\s[upgraded|aktualisiert]\D*(\d*)\D*install|^ \S+.*/ and print "$1 aktualisierte, $2 neue Pakete"' 2>/dev/null > /opt/fhem/data/updatestatus.txt -
      - uder-defined attribute
      sys_updates:1440:System Aktualisierungen:cat /opt/fhem/data/updatestatus.txt
      - the number of available updates is daily recorded as 'sys_updates'. -
    • -
      -
    • user-fn <fn_name>:<interval_minutes>:<reading_name1>:<reading_name2>...[:<reading_nameX>], ...
      - List of perl user subroutines.
      - As <fn_name> can be used either the name of a Perl subroutine or a Perl expression. - The perl function gets the device hash as parameter and must provide an array of values. - These values are taken according to the parameter <reading_nameX> in Readings.
      - A Perl expression must be enclosed in curly braces and can use the following parameters: $ HASH (device hash) and $ NAME (device name). - Return is expected analogous to a Perl subroutine.
      - Important! The separation between multiple user functions must be done with a comma AND a space! Within the function definition commas may not be followed by spaces. -
    • -
      -
    • disable
      - Possible values: 0 and 1. '1' means that the update is stopped. -
    • -
      -
    • telnet-prompt-regx, telnet-login-prompt-regx
      - RegExp to detect login and command line prompt. (Only for access via Telnet.) -
    • -
      -
    • exclude
      - Allows to suppress reading certain information.
      - supported values: user-defined (s. user-defined und user-fn), cpucount, uptime, fhemuptime, - loadavg, cputemp, cpufreq, cpuinfo, diskstat, cpustat, ramswap, filesystem, network, - fbwlan, fbnightctrl, fbnewmessages, fbdecttemp, fbversion, fbdsl, powerinfo -
    • -
      -

    - - Plots:

    -
      - predefined gplot files:
      -
        - FileLog versions:
        +
        + Get:

        +
          +
        • interval_base
          + Lists the specified polling intervalls. +
        • +
          +
        • interval_multipliers
          + Displays update intervals. +
        • +
          +
        • list
          + Lists all readings. +
        • +
          +
        • update
          + Refreshs all readings. +
        • +
          +
        • version
          + Displays the version of SYSMON module. +
        • +
          +
        • list_lan_devices
          + Displays known LAN Devices (FritzBox only). +
        • +
          +
        +
        + Set:

        +
          +
        • interval_multipliers
          + Defines update intervals (as in the definition of the device). +
        • +
          +
        • clean
          + Clears user-definable Readings. After an update (manual or automatic) new readings are generated.
          +
        • +
          +
        • clear <reading name>
          + Deletes the Reading entry with the given name. After an update this entry is possibly re-created (if defined). This mechanism allows the selective deleting unnecessary custom entries.
          +
        • +
          +
        • password <Passwort>
          + Specify the password for remote access (usually only necessary once). +
        • +
          +
        +
        + Attributes:

        +
          +
        • filesystems <reading name>[:<mountpoint>[:<comment>]],...
          + Specifies the file system to be monitored (a comma-separated list).
          + Reading-name is used in the display and logging, the mount point is the basis of the evaluation, comment is relevant to the HTML display (see SYSMON_ShowValuesHTML)
          + Examples:
          + /boot,/,/media/usb1
          + fs_boot:/boot,fs_root:/:Root,fs_usb1:/media/usb1:USB-Stick
          +
        • +
          +
        • network-interfaces <name>[:<interface>[:<comment>]],...
          + Comma-separated list of network interfaces that are to be monitored. Each entry consists of the Reading-name, the name of the Netwerk adapter and a comment for the HTML output (see SYSMON_ShowValuesHTML). If no colon is used, the value is used simultaneously as a Reading-name and interface name.
          + Example ethernet:eth0:Ethernet,wlan:wlan0:WiFi
          +
        • +
          +
        • user-defined <readingsName>:<Interval_Minutes>:<Comment>:<Cmd>,...
          + This comma-separated list defines user defined Readings with the following data: Reading name, refresh interval (in minutes), a Comment, and operating system command. +
          The os commands are executed according to the specified Intervals and are noted as Readings with the specified name. Comments are used for the HTML output (see SYSMON_ShowValuesHTML).. +
          All parameter parts are required! +
          It is important that the specified commands are executed quickly, because at this time the entire FHEM server is blocked!
          + If results of the long-running operations required, these should be set up as a CRON job and store results as a text file.

          + Example: Display of package updates for the operating system:
          + cron-Job:
          + sudo apt-get update 2>/dev/null >/dev/null + apt-get upgrade --dry-run| perl -ne '/(\d*)\s[upgraded|aktualisiert]\D*(\d*)\D*install|^ \S+.*/ and print "$1 aktualisierte, $2 neue Pakete"' 2>/dev/null > /opt/fhem/data/updatestatus.txt +
          + uder-defined attribute
          sys_updates:1440:System Aktualisierungen:cat /opt/fhem/data/updatestatus.txt
          + the number of available updates is daily recorded as 'sys_updates'. +
        • +
          +
        • user-fn <fn_name>:<interval_minutes>:<reading_name1>:<reading_name2>...[:<reading_nameX>], ...
          + List of perl user subroutines.
          + As <fn_name> can be used either the name of a Perl subroutine or a Perl expression. + The perl function gets the device hash as parameter and must provide an array of values. + These values are taken according to the parameter <reading_nameX> in Readings.
          + A Perl expression must be enclosed in curly braces and can use the following parameters: $ HASH (device hash) and $ NAME (device name). + Return is expected analogous to a Perl subroutine.
          + Important! The separation between multiple user functions must be done with a comma AND a space! Within the function definition commas may not be followed by spaces. +
        • +
          +
        • disable
          + Possible values: 0 and 1. '1' means that the update is stopped. +
        • +
          +
        • telnet-prompt-regx, telnet-login-prompt-regx
          + RegExp to detect login and command line prompt. (Only for access via Telnet.) +
        • +
          +
        • exclude
          + Allows to suppress reading certain information.
          + supported values: user-defined (s. user-defined und user-fn), cpucount, uptime, fhemuptime, + loadavg, cputemp, cpufreq, cpuinfo, diskstat, cpustat, ramswap, filesystem, network, + fbwlan, fbnightctrl, fbnewmessages, fbdecttemp, fbversion, fbdsl, powerinfo +
        • +
          +
        +
        + Plots:

        +
          + predefined gplot files:
          +
            + FileLog versions:
            + + SM_RAM.gplot
            + SM_CPUTemp.gplot
            + SM_FS_root.gplot
            + SM_FS_usb1.gplot
            + SM_Load.gplot
            + SM_Network_eth0.gplot
            + SM_Network_eth0t.gplot
            + SM_Network_wlan0.gplot
            + SM_CPUStat.gplot
            + SM_CPUStatSum.gplot
            + SM_CPUStatTotal.gplot
            + SM_power_ac.gplot
            + SM_power_usb.gplot
            + SM_power_battery.gplot
            +
            + DbLog versions:
            + + SM_DB_all.gplot
            + SM_DB_CPUFreq.gplot
            + SM_DB_CPUTemp.gplot
            + SM_DB_Load.gplot
            + SM_DB_Network_eth0.gplot
            + SM_DB_RAM.gplot
            +
            +
          +
        +
        + HTML output method (see Weblink): SYSMON_ShowValuesHTML(<SYSMON-Instance>[,<Liste>])

        +
          + The module provides a function that returns selected Readings as HTML.
          + As a parameter the name of the defined SYSMON device is expected.
          + It can also Reading Group, Clone dummy or other modules be used. Their readings are simple used for display.
          + The second parameter is optional and specifies a list of readings to be displayed in the format <ReadingName>[:<Comment>[:<Postfix>[:<FormatString>]]].
          + ReadingName is the Name of desired Reading, Comment is used as the display name and postfix is displayed after the value (such as units or as MHz can be displayed). + If FormatString is specified, the output is formatted with sprintf (s. sprintf in Perl documentation).
          + If no Comment is specified, an internally predefined description is used.
          + If no list specified, a predefined selection is used (all values are displayed).

          + define sysv1 weblink htmlCode {SYSMON_ShowValuesHTML('sysmon')}
          + define sysv2 weblink htmlCode {SYSMON_ShowValuesHTML('sysmon', ('date:Datum', 'cpu_temp:CPU Temperatur: °C:%.1f'', 'cpu_freq:CPU Frequenz: MHz'))} +
        +
        + Text output method (see Weblink): SYSMON_ShowValuesHTMLTitled(<SYSMON-Instance>[,<Title>,<Liste>])

        +
          + According to SYSMON_ShowValuesHTML, but with a Title text above. If no title provided, device alias will be used (if any)
          +
        +
        + Text output method (see Weblink): SYSMON_ShowValuesText(<SYSMON-Instance>[,<Liste>])

        +
          + According to SYSMON_ShowValuesHTML, but formatted as plain text.
          +
        +
        + Text output method (see Weblink): SYSMON_ShowValuesTextTitled(<SYSMON-Instance>[,<Title>,<Liste>])

        +
          + According to SYSMON_ShowValuesHTMLTitled, but formatted as plain text.
          +
        +
        + Reading values with perl: SYSMON_getValues(<name>[, <array of desired keys>])

        +
          + Returns a hash ref with desired values. If no array is passed, all values are returned.
          + {(SYSMON_getValues("sysmon"))->{'cpu_temp'}}
          + {(SYSMON_getValues("sysmon",("cpu_freq","cpu_temp")))->{"cpu_temp"}}
          + {join(" ", values (SYSMON_getValues("sysmon")))}
          + {join(" ", values (SYSMON_getValues("sysmon",("cpu_freq","cpu_temp"))))}
          +
        +
        + Examples:

        +
          - SM_RAM.gplot
          - SM_CPUTemp.gplot
          - SM_FS_root.gplot
          - SM_FS_usb1.gplot
          - SM_Load.gplot
          - SM_Network_eth0.gplot
          - SM_Network_eth0t.gplot
          - SM_Network_wlan0.gplot
          - SM_CPUStat.gplot
          - SM_CPUStatSum.gplot
          - SM_CPUStatTotal.gplot
          - SM_power_ac.gplot
          - SM_power_usb.gplot
          - SM_power_battery.gplot
          -
          - DbLog versions:
          - - SM_DB_all.gplot
          - SM_DB_CPUFreq.gplot
          - SM_DB_CPUTemp.gplot
          - SM_DB_Load.gplot
          - SM_DB_Network_eth0.gplot
          - SM_DB_RAM.gplot
          -
          -
        -

      - - HTML output method (see Weblink): SYSMON_ShowValuesHTML(<SYSMON-Instance>[,<Liste>])

      -
        - The module provides a function that returns selected Readings as HTML.
        - As a parameter the name of the defined SYSMON device is expected.
        - It can also Reading Group, Clone dummy or other modules be used. Their readings are simple used for display.
        - The second parameter is optional and specifies a list of readings to be displayed in the format <ReadingName>[:<Comment>[:<Postfix>[:<FormatString>]]].
        - ReadingName is the Name of desired Reading, Comment is used as the display name and postfix is displayed after the value (such as units or as MHz can be displayed). - If FormatString is specified, the output is formatted with sprintf (s. sprintf in Perl documentation).
        - If no Comment is specified, an internally predefined description is used.
        - If no list specified, a predefined selection is used (all values are displayed).

        - define sysv1 weblink htmlCode {SYSMON_ShowValuesHTML('sysmon')}
        - define sysv2 weblink htmlCode {SYSMON_ShowValuesHTML('sysmon', ('date:Datum', 'cpu_temp:CPU Temperatur: °C:%.1f'', 'cpu_freq:CPU Frequenz: MHz'))} -

      - Text output method (see Weblink): SYSMON_ShowValuesHTMLTitled(<SYSMON-Instance>[,<Title>,<Liste>])

      -
        - According to SYSMON_ShowValuesHTML, but with a Title text above. If no title provided, device alias will be used (if any)
        -

      - - Text output method (see Weblink): SYSMON_ShowValuesText(<SYSMON-Instance>[,<Liste>])

      -
        - According to SYSMON_ShowValuesHTML, but formatted as plain text.
        -

      - Text output method (see Weblink): SYSMON_ShowValuesTextTitled(<SYSMON-Instance>[,<Title>,<Liste>])

      -
        - According to SYSMON_ShowValuesHTMLTitled, but formatted as plain text.
        -

      - - Reading values with perl: SYSMON_getValues(<name>[, <array of desired keys>])

      -
        - Returns a hash ref with desired values. If no array is passed, all values are returned.
        - {(SYSMON_getValues("sysmon"))->{'cpu_temp'}}
        - {(SYSMON_getValues("sysmon",("cpu_freq","cpu_temp")))->{"cpu_temp"}}
        - {join(" ", values (SYSMON_getValues("sysmon")))}
        - {join(" ", values (SYSMON_getValues("sysmon",("cpu_freq","cpu_temp"))))}
        -

      - - Examples:

      -
        - # Modul-Definition
        define sysmon SYSMON 1 1 1 10
        #attr sysmon event-on-update-reading cpu_temp,cpu_temp_avg,cpu_freq,eth0_diff,loadavg,ram,^~ /.*usb.*,~ /$
        @@ -5342,12 +4705,10 @@ If one (or more) of the multiplier is set to zero, the corresponding readings is attr wl_sysmon_power_bat label "Stromversorgung (bat) Spannung: $data{min1} - $data{max1} V, Strom: $data{min2} - $data{max2} mA"
        attr wl_sysmon_power_bat room Technik
        attr wl_sysmon_power_bat group system
        -
        -
      - -
    + +
+ - =end html =begin html_DE @@ -5355,579 +4716,480 @@ If one (or more) of the multiplier is set to zero, the corresponding readings is

SYSMON

(en | de)
    - Dieses Modul liefert diverse Informationen und Statistiken zu dem System, auf dem FHEM-Server ausgeführt wird. - Weiterhin können auch Remote-Systeme abgefragt werden (Telnet). - Es werden nur Linux-basierte Systeme unterstützt. Manche Informationen sind hardwarespezifisch und sind daher nicht auf jeder Plattform - verfügbar. - Bis jetzt wurde dieses Modul auf folgenden Systemen getestet: Raspberry Pi (Debian Wheezy), BeagleBone Black, - FritzBox 7390, WR703N unter OpenWrt, CubieTruck und einige andere. -
    -
    - Für Informationen zu einer FritzBox beachten Sie bitte auch Module: FRITZBOX und FB_CALLMONITOR. - Das Modul nutzt das Perlmodule 'Net::Telnet' für den Fernzugriff. Dieses muss ggf. nachinstalliert werden. -

    - Define -

    - define <name> SYSMON [MODE[:[USER@]HOST][:PORT]] [<M1>[ <M2>[ <M3>[ <M4>]]]]
    -
    - Diese Anweisung erstellt eine neue SYSMON-Instanz. - Die Parameter M1 bis M4 legen die Aktualisierungsintervalle für verschiedenen Readings (Statistiken) fest. - Die Parameter sind als Multiplikatoren für die Zeit, die durch INTERVAL_BASE definiert ist, zu verstehen. - Da diese Zeit fest auf 60 Sekunden gesetzt ist, können die Mx-Parameters als Zeitintervalle in Minuten angesehen werden.
    - Wird einer (oder mehrere) Multiplikatoren auf Null gesetzt werden, wird das entsprechende Readings deaktiviert.
    -
    - Die Parameter sind für die Aktualisierung der Readings nach folgender Schema zuständig: -
      -
    • M1: (Default-Wert: 1)
      - cpu_freq, cpu_temp, cpu_temp_avg, loadavg, stat_cpu, stat_cpu_diff, stat_cpu_percent, stat_cpu_text, power readings

      -
    • -
    • M2: (Default-Wert: M1)
      - ram, swap
      -
    • -
    • M3: (Default-Wert: M1)
      - eth0, eth0_diff, wlan0, wlan0_diff

      -
    • -
    • M4: (Default-Wert: 10*M1)
      - Filesystem-Informationen

      -
    • -
    • folgende Parameter werden immer anhand des Basisintervalls (unabhängig von den Mx-Parameters) aktualisiert:
      - fhemuptime, fhemuptime_text, idletime, idletime_text, uptime, uptime_text, starttime, starttime_text

      -
    • -
    - Für Abfrage eines entfernten Systems muss mindestens deren Adresse (HOST) angegeben werden, bei Bedarf ergänzt durch den Port und/oder den Benutzernamen. - Das eventuell benötigte Passwort muss einmalig mit dem Befehl 'set password <pass>' definiert werden. - Als MODE sind derzeit 'telnet' und 'local' erlaubt. 'local' erfordert keine weiteren Angaben und kann auch ganz weggelassen werden. -
    -
    + Dieses Modul liefert diverse Informationen und Statistiken zu dem System, auf dem FHEM-Server ausgeführt wird. + Weiterhin können auch Remote-Systeme abgefragt werden (Telnet). + Es werden nur Linux-basierte Systeme unterstützt. Manche Informationen sind hardwarespezifisch und sind daher nicht auf jeder Plattform + verfügbar. + Bis jetzt wurde dieses Modul auf folgenden Systemen getestet: Raspberry Pi (Debian Wheezy), BeagleBone Black, + FritzBox 7390, WR703N unter OpenWrt, CubieTruck und einige andere. +
    +
    + Für Informationen zu einer FritzBox beachten Sie bitte auch Module: FRITZBOX und FB_CALLMONITOR. + Das Modul nutzt das Perlmodule 'Net::Telnet' für den Fernzugriff. Dieses muss ggf. nachinstalliert werden. +

    + Define +

    + define <name> SYSMON [MODE[:[USER@]HOST][:PORT]] [<M1>[ <M2>[ <M3>[ <M4>]]]]
    +
    + Diese Anweisung erstellt eine neue SYSMON-Instanz. + Die Parameter M1 bis M4 legen die Aktualisierungsintervalle für verschiedenen Readings (Statistiken) fest. + Die Parameter sind als Multiplikatoren für die Zeit, die durch INTERVAL_BASE definiert ist, zu verstehen. + Da diese Zeit fest auf 60 Sekunden gesetzt ist, können die Mx-Parameters als Zeitintervalle in Minuten angesehen werden.
    + Wird einer (oder mehrere) Multiplikatoren auf Null gesetzt werden, wird das entsprechende Readings deaktiviert.
    +
    + Die Parameter sind für die Aktualisierung der Readings nach folgender Schema zuständig: +
      +
    • M1: (Default-Wert: 1)
      + cpu_freq, cpu_temp, cpu_temp_avg, loadavg, stat_cpu, stat_cpu_diff, stat_cpu_percent, stat_cpu_text, power readings

      +
    • +
    • M2: (Default-Wert: M1)
      + ram, swap
      +
    • +
    • M3: (Default-Wert: M1)
      + eth0, eth0_diff, wlan0, wlan0_diff

      +
    • +
    • M4: (Default-Wert: 10*M1)
      + Filesystem-Informationen

      +
    • +
    • folgende Parameter werden immer anhand des Basisintervalls (unabhängig von den Mx-Parameters) aktualisiert:
      + fhemuptime, fhemuptime_text, idletime, idletime_text, uptime, uptime_text, starttime, starttime_text

      +
    • +
    + Für Abfrage eines entfernten Systems muss mindestens deren Adresse (HOST) angegeben werden, bei Bedarf ergänzt durch den Port und/oder den Benutzernamen. + Das eventuell benötigte Passwort muss einmalig mit dem Befehl 'set password <pass>' definiert werden. + Als MODE sind derzeit 'telnet' und 'local' erlaubt. 'local' erfordert keine weiteren Angaben und kann auch ganz weggelassen werden. +
    +
    + Readings: +

    +
      +
    • cpu_core_count
      + Anzahl der CPU Kerne +
    • +
    • cpu_model_name
      + CPU Modellname +
    • +
    • cpu_bogomips
      + CPU Speed: BogoMIPS +
    • +
    • cpu_freq (auf den DualCore-Systemen wie Cubietruck auch cpu1_freq)
      + CPU-Frequenz +
    • +
      +
    • cpu_temp
      + CPU-Temperatur +
    • +
      +
    • cpu_temp_avg
      + Durchschnitt der CPU-Temperatur, gebildet über die letzten 4 Werte. +
    • +
      +
    • fhemuptime
      + Zeit (in Sekunden) seit dem Start des FHEM-Servers. +
    • +
      +
    • fhemuptime_text
      + Zeit seit dem Start des FHEM-Servers: Menschenlesbare Ausgabe (texttuelle Darstellung). +
    • +
      +
    • fhemstarttime
      + Startzeit (in Sekunden seit 1.1.1970 1:00:00) des FHEM-Servers. +
    • +
      +
    • fhemstarttime_text
      + Startzeit des FHEM-Servers: Menschenlesbare Ausgabe (texttuelle Darstellung). +
    • +
      +
    • idletime
      + Zeit (in Sekunden und in Prozent), die das System (nicht der FHEM-Server!) + seit dem Start in dem Idle-Modus verbracht hat. Also die Zeit der Inaktivität. +
    • +
      +
    • idletime_text
      + Zeit der Inaktivität des Systems seit dem Systemstart in menschenlesbarer Form. +
    • +
      +
    • loadavg
      + Ausgabe der Werte für die Systemauslastung (load average): 1 Minute-, 5 Minuten- und 15 Minuten-Werte. +
    • +
      +
    • ram
      + Ausgabe der Speicherauslastung. +
    • +
      +
    • swap
      + Benutzung und Auslastung der SWAP-Datei (bzw. Partition). +
    • +
      +
    • uptime
      + Zeit (in Sekenden) seit dem Systemstart. +
    • +
      +
    • uptime_text
      + Zeit seit dem Systemstart in menschenlesbarer Form. +
    • +
      +
    • starttime
      + Systemstart (Sekunden seit Thu Jan 1 01:00:00 1970). +
    • +
      +
    • starttime_text
      + Systemstart in menschenlesbarer Form. +
    • +
      +
    • Netzwerkinformationen
      + Informationen zu den über die angegebene Netzwerkschnittstellen übertragene Datenmengen + und der Differenz zu der vorherigen Messung. +
      + Beispiele:
      + Menge der übertragenen Daten über die Schnittstelle eth0.
      + eth0: RX: 940.58 MB, TX: 736.19 MB, Total: 1676.77 MB
      + Änderung der übertragenen Datenmenge in Bezug auf den vorherigen Aufruf (für eth0).
      + eth0_diff: RX: 0.66 MB, TX: 0.06 MB, Total: 0.72 MB
      + IP and IP v6 Adressen + eth0_ip 192.168.0.15
      + eth0_ip6 fe85::49:4ff:fe85:f885/64
      +
    • +
      +
    • Network Speed (wenn verfügbar)
      + Geschwindigkeit der aktuellen Netzwerkverbindung. +
      + Beispiel:
      + eth0_speed 100
      +
    • +
      +
    • Dateisysteminformationen
      + Informationen zu der Größe und der Belegung der gewünschten Dateisystemen.
      + Seit Version 1.1.0 können Dateisysteme auch benannt werden (s.u.).
      + In diesem Fall werden für die diese Readings die angegebenen Namen verwendet.
      + Dies soll die Übersicht verbessern und die Erstellung von Plots erleichten.
      + Beispiel:
      + fs_root: Total: 7340 MB, Used: 3573 MB, 52 %, Available: 3425 MB at / +
    • +
      +
    • CPU Auslastung
      + Informationen zu der Auslastung der CPU(s).
      + Beispiel:
      + stat_cpu: 10145283 0 2187286 90586051 542691 69393 400342
      + stat_cpu_diff: 2151 0 1239 2522 10 3 761
      + stat_cpu_percent: 4.82 0.00 1.81 93.11 0.05 0.00 0.20
      + stat_cpu_text: user: 32.17 %, nice: 0.00 %, sys: 18.53 %, idle: 37.72 %, io: 0.15 %, irq: 0.04 %, sirq: 11.38 % +
    • +
      +
    • Benutzerdefinierte Einträge
      + Diese Readings sind Ausgaben der Kommanden, die an das Betriebssystem übergeben werden. + Die entsprechende Angaben werden durch Attributen user-defined und user-fn definiert. +
    • +
      + FritzBox-spezifische Readings +
    • wlan_state
      + WLAN-Status: on/off +
    • +
      +
    • wlan_guest_state
      + Gast-WLAN-Status: on/off +
    • +
      +
    • internet_ip
      + aktuelle IP-Adresse +
    • +
      +
    • internet_state
      + Status der Internetverbindung: connected/disconnected +
    • +
      +
    • night_time_ctrl
      + Status der Klingelsperre on/off +
    • +
      +
    • num_new_messages
      + Anzahl der neuen Anrufbeantworter-Meldungen +
    • +
      +
    • fw_version_info
      + Angaben zu der installierten Firmware-Version: <VersionNr> <Erstelldatum> <Zeit> +
    • +
      + DSL Informationen (FritzBox) +
    • dsl_rate
      + Down/Up Verbindungsgeschwindigkeit +
    • +
      +
    • dsl_synctime
      + Sync-Zeit mit Vermittlungsstelle +
    • +
      +
    • dsl_crc_15
      + Nicht behebbare Übertragungsfehler in den letzten 15 Minuten +
    • +
      +
    • dsl_fec_15
      + Behebbare Übertragungsfehler in den letzten 15 Minuten +
    • +
      + Readings zur Stromversorgung +
    • power_ac_stat
      + Statusinformation für die AC-Buchse: online (0|1), present (0|1), voltage, current
      + Beispiel:
      + power_ac_stat: 1 1 4.807 264
      +
    • +
      +
    • power_ac_text
      + Statusinformation für die AC-Buchse in menschenlesbarer Form
      + Beispiel:
      + power_ac_text ac: present / online, Voltage: 4.807 V, Current: 264 mA
      +
    • +
      +
    • power_usb_stat
      + Statusinformation für die USB-Buchse +
    • +
      +
    • power_usb_text
      + Statusinformation für die USB-Buchse in menschenlesbarer Form +
    • +
      +
    • power_battery_stat
      + Statusinformation für die Batterie (wenn vorhanden): online (0|1), present (0|1), voltage, current, actual capacity
      + Beispiel:
      + power_battery_stat: 1 1 4.807 264 100
      +
    • +
      +
    • power_battery_text
      + Statusinformation für die Batterie (wenn vorhanden) in menschenlesbarer Form +
    • +
      +
    • power_battery_info
      + Menschenlesbare Zusatzinformationen für die Batterie (wenn vorhanden): Technologie, Kapazität, Status, Zustand, Gesamtkapazität
      + Beispiel:
      + power_battery_info: battery info: Li-Ion , capacity: 100 %, status: Full , health: Good , total capacity: 2100 mAh
      + Die Kapazität soll in script.bin (z.B. ct-hdmi.bin) eingestellt werden (Parameter pmu_battery_cap). Mit bin2fex konvertieren (bin2fex -> script.fex -> edit -> fex2bin -> script.bin)
      +
    • +
      +
    • cpuX_freq_stat
      + Frequenz-Statistik für die CPU X: Minimum, Maximum und Durchschnittswert
      + Beispiel:
      + cpu0_freq_stat: 100 1000 900
      +
    • +
      +
    • cpuX_idle_stat
      + Leerlaufzeit-Statistik für die CPU X: Minimum, Maximum und Durchschnittswert
      + Beispiel:
      + cpu0_freq_stat: 23.76 94.74 90.75
      +
    • +
      +
    • cpu[X]_temp_stat
      + Temperatur-Statistik für CPU: Minimum, Maximum und Durchschnittswert
      + Beispiel:
      + cpu_temp_stat: 41.00 42.50 42.00
      +
    • +
      +
    • ram_used_stat
      + Statistik der RAM-Nutzung: Minimum, Maximum und Durchschnittswert
      + Example:
      + ram_used_stat: 267.55 1267.75 855.00
      +
    • +
      +
    • swap_used_stat
      + Statistik der SWAP-Nutzung: Minimum, Maximum und Durchschnittswert
      + Example:
      + swap_used_stat: 0 1024.00 250.00
      +
    • +
      +
      +
    - Readings: -

    -
      -
    • cpu_core_count
      - Anzahl der CPU Kerne -
    • -
    • cpu_model_name
      - CPU Modellname -
    • -
    • cpu_bogomips
      - CPU Speed: BogoMIPS -
    • -
    • cpu_freq (auf den DualCore-Systemen wie Cubietruck auch cpu1_freq)
      - CPU-Frequenz -
    • -
      -
    • cpu_temp
      - CPU-Temperatur -
    • -
      -
    • cpu_temp_avg
      - Durchschnitt der CPU-Temperatur, gebildet über die letzten 4 Werte. -
    • -
      -
    • fhemuptime
      - Zeit (in Sekunden) seit dem Start des FHEM-Servers. -
    • -
      -
    • fhemuptime_text
      - Zeit seit dem Start des FHEM-Servers: Menschenlesbare Ausgabe (texttuelle Darstellung). -
    • -
      -
    • fhemstarttime
      - Startzeit (in Sekunden seit 1.1.1970 1:00:00) des FHEM-Servers. -
    • -
      -
    • fhemstarttime_text
      - Startzeit des FHEM-Servers: Menschenlesbare Ausgabe (texttuelle Darstellung). -
    • -
      -
    • idletime
      - Zeit (in Sekunden und in Prozent), die das System (nicht der FHEM-Server!) - seit dem Start in dem Idle-Modus verbracht hat. Also die Zeit der Inaktivität. -
    • -
      -
    • idletime_text
      - Zeit der Inaktivität des Systems seit dem Systemstart in menschenlesbarer Form. -
    • -
      -
    • loadavg
      - Ausgabe der Werte für die Systemauslastung (load average): 1 Minute-, 5 Minuten- und 15 Minuten-Werte. -
    • -
      -
    • ram
      - Ausgabe der Speicherauslastung. -
    • -
      -
    • swap
      - Benutzung und Auslastung der SWAP-Datei (bzw. Partition). -
    • -
      -
    • uptime
      - Zeit (in Sekenden) seit dem Systemstart. -
    • -
      -
    • uptime_text
      - Zeit seit dem Systemstart in menschenlesbarer Form. -
    • -
      -
    • starttime
      - Systemstart (Sekunden seit Thu Jan 1 01:00:00 1970). -
    • -
      -
    • starttime_text
      - Systemstart in menschenlesbarer Form. -
    • -
      -
    • Netzwerkinformationen
      - Informationen zu den über die angegebene Netzwerkschnittstellen übertragene Datenmengen - und der Differenz zu der vorherigen Messung. -
      - Beispiele:
      - Menge der übertragenen Daten über die Schnittstelle eth0.
      - eth0: RX: 940.58 MB, TX: 736.19 MB, Total: 1676.77 MB
      - Änderung der übertragenen Datenmenge in Bezug auf den vorherigen Aufruf (für eth0).
      - eth0_diff: RX: 0.66 MB, TX: 0.06 MB, Total: 0.72 MB
      - IP and IP v6 Adressen - eth0_ip 192.168.0.15
      - eth0_ip6 fe85::49:4ff:fe85:f885/64
      -
    • -
      -
    • Network Speed (wenn verfügbar)
      - Geschwindigkeit der aktuellen Netzwerkverbindung. -
      - Beispiel:
      - eth0_speed 100
      -
    • -
      -
    • Dateisysteminformationen
      - Informationen zu der Größe und der Belegung der gewünschten Dateisystemen.
      - Seit Version 1.1.0 können Dateisysteme auch benannt werden (s.u.).
      - In diesem Fall werden für die diese Readings die angegebenen Namen verwendet.
      - Dies soll die Übersicht verbessern und die Erstellung von Plots erleichten.
      - Beispiel:
      - fs_root: Total: 7340 MB, Used: 3573 MB, 52 %, Available: 3425 MB at / -
    • -
      -
    • CPU Auslastung
      - Informationen zu der Auslastung der CPU(s).
      - Beispiel:
      - stat_cpu: 10145283 0 2187286 90586051 542691 69393 400342
      - stat_cpu_diff: 2151 0 1239 2522 10 3 761
      - stat_cpu_percent: 4.82 0.00 1.81 93.11 0.05 0.00 0.20
      - stat_cpu_text: user: 32.17 %, nice: 0.00 %, sys: 18.53 %, idle: 37.72 %, io: 0.15 %, irq: 0.04 %, sirq: 11.38 % -
    • -
      -
    • Benutzerdefinierte Einträge
      - Diese Readings sind Ausgaben der Kommanden, die an das Betriebssystem übergeben werden. - Die entsprechende Angaben werden durch Attributen user-defined und user-fn definiert. -
    • -
      - FritzBox-spezifische Readings -
    • wlan_state
      - WLAN-Status: on/off -
    • -
      -
    • wlan_guest_state
      - Gast-WLAN-Status: on/off -
    • -
      -
    • internet_ip
      - aktuelle IP-Adresse -
    • -
      -
    • internet_state
      - Status der Internetverbindung: connected/disconnected -
    • -
      -
    • night_time_ctrl
      - Status der Klingelsperre on/off -
    • -
      -
    • num_new_messages
      - Anzahl der neuen Anrufbeantworter-Meldungen -
    • -
      -
    • fw_version_info
      - Angaben zu der installierten Firmware-Version: -
    • -
      - DSL Informationen (FritzBox) -
    • dsl_rate
      - Down/Up Verbindungsgeschwindigkeit -
    • -
      -
    • dsl_synctime
      - Sync-Zeit mit Vermittlungsstelle -
    • -
      -
    • dsl_crc_15
      - Nicht behebbare Übertragungsfehler in den letzten 15 Minuten -
    • -
      -
    • dsl_fec_15
      - Behebbare Übertragungsfehler in den letzten 15 Minuten -
    • -
      - Readings zur Stromversorgung -
    • power_ac_stat
      - Statusinformation für die AC-Buchse: online (0|1), present (0|1), voltage, current
      - Beispiel:
      - power_ac_stat: 1 1 4.807 264
      -
    • -
      -
    • power_ac_text
      - Statusinformation für die AC-Buchse in menschenlesbarer Form
      - Beispiel:
      - power_ac_text ac: present / online, Voltage: 4.807 V, Current: 264 mA
      -
    • -
      -
    • power_usb_stat
      - Statusinformation für die USB-Buchse -
    • -
      -
    • power_usb_text
      - Statusinformation für die USB-Buchse in menschenlesbarer Form -
    • -
      -
    • power_battery_stat
      - Statusinformation für die Batterie (wenn vorhanden): online (0|1), present (0|1), voltage, current, actual capacity
      - Beispiel:
      - power_battery_stat: 1 1 4.807 264 100
      -
    • -
      -
    • power_battery_text
      - Statusinformation für die Batterie (wenn vorhanden) in menschenlesbarer Form -
    • -
      -
    • power_battery_info
      - Menschenlesbare Zusatzinformationen für die Batterie (wenn vorhanden): Technologie, Kapazität, Status, Zustand, Gesamtkapazität
      - Beispiel:
      - power_battery_info: battery info: Li-Ion , capacity: 100 %, status: Full , health: Good , total capacity: 2100 mAh
      - Die Kapazität soll in script.bin (z.B. ct-hdmi.bin) eingestellt werden (Parameter pmu_battery_cap). Mit bin2fex konvertieren (bin2fex -> script.fex -> edit -> fex2bin -> script.bin)
      -
    • -
      -
    • cpuX_freq_stat
      - Frequenz-Statistik für die CPU X: Minimum, Maximum und Durchschnittswert
      - Beispiel:
      - cpu0_freq_stat: 100 1000 900
      -
    • -
      -
    • cpuX_idle_stat
      - Leerlaufzeit-Statistik für die CPU X: Minimum, Maximum und Durchschnittswert
      - Beispiel:
      - cpu0_freq_stat: 23.76 94.74 90.75
      -
    • -
      -
    • cpu[X]_temp_stat
      - Temperatur-Statistik für CPU: Minimum, Maximum und Durchschnittswert
      - Beispiel:
      - cpu_temp_stat: 41.00 42.50 42.00
      -
    • -
      -
    • ram_used_stat
      - Statistik der RAM-Nutzung: Minimum, Maximum und Durchschnittswert
      - Example:
      - ram_used_stat: 267.55 1267.75 855.00
      -
    • -
      -
    • swap_used_stat
      - Statistik der SWAP-Nutzung: Minimum, Maximum und Durchschnittswert
      - Example:
      - swap_used_stat: 0 1024.00 250.00
      -
    • -
      -
      -
    - - Beispiel-Ausgabe:
    -
      - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
      cpu_freq
      900
      2013-11-27 00:05:36
      cpu_temp
      49.77
      2013-11-27 00:05:36
      cpu_temp_avg
      49.7
      2013-11-27 00:05:36
      eth0
      RX: 2954.22 MB, TX: 3469.21 MB, Total: 6423.43 MB
      2013-11-27 00:05:36
      eth0_diff
      RX: 6.50 MB, TX: 0.23 MB, Total: 6.73 MB
      2013-11-27 00:05:36
      fhemuptime
      11231
      2013-11-27 00:05:36
      fhemuptime_text  
      0 days, 03 hours, 07 minutes
      2013-11-27 00:05:36
      idletime
      931024 88.35 %
      2013-11-27 00:05:36
      idletime_text
      10 days, 18 hours, 37 minutes (88.35 %)
      2013-11-27 00:05:36
      loadavg
      0.14 0.18 0.22
      2013-11-27 00:05:36
      ram
      Total: 485 MB, Used: 140 MB, 28.87 %, Free: 345 MB
      2013-11-27 00:05:36
      swap
      n/a
      2013-11-27 00:05:36
      uptime
      1053739
      2013-11-27 00:05:36
      uptime_text
      12 days, 04 hours, 42 minutes
      2013-11-27 00:05:36
      wlan0
      RX: 0.00 MB, TX: 0.00 MB, Total: 0 MB
      2013-11-27 00:05:36
      wlan0_diff
      RX: 0.00 MB, TX: 0.00 MB, Total: 0.00 MB
      2013-11-27 00:05:36
      fs_root
      Total: 7404 MB, Used: 3533 MB, 50 %, Available: 3545 MB at /
      2013-11-27 00:05:36
      fs_boot
      Total: 56 MB, Used: 19 MB, 33 %, Available: 38 MB at /boot
      2013-11-27 00:05:36
      fs_usb1
      Total: 30942 MB, Used: 6191 MB, 21 %, Available: 24752 MB at /media/usb1  
      2013-11-27 00:05:36
      stat_cpu
      10145283 0 2187286 90586051 542691 69393 400342  
      2013-11-27 00:05:36
      stat_cpu_diff
      2151 0 1239 2522 10 3 761  
      2013-11-27 00:05:36
      stat_cpu_percent
      4.82 0.00 1.81 93.11 0.05 0.00 0.20  
      2013-11-27 00:05:36
      stat_cpu_text
      user: 32.17 %, nice: 0.00 %, sys: 18.53 %, idle: 37.72 %, io: 0.15 %, irq: 0.04 %, sirq: 11.38 %  
      2013-11-27 00:05:36
      -

    - - Get:

    -
      -
    • interval
      - Listet die bei der Definition angegebene Polling-Intervalle auf. -
    • -
      -
    • interval_multipliers
      - Listet die definierten Multipliers. -
    • -
      -
    • list
      - Gibt alle Readings aus. -
    • -
      -
    • update
      - Aktualisiert alle Readings. Alle Werte werden neu abgefragt. -
    • -
      -
    • version
      - Zeigt die Version des SYSMON-Moduls. -
    • -
      -
      -
    • list_lan_devices
      - Listet bekannte Geräte im LAN (nur FritzBox). -
    • -

    - - Set:

    -
      -
    • interval_multipliers
      - Definiert Multipliers (wie bei der Definition des Gerätes). -
    • -
      -
    • clean
      - Löscht benutzerdefinierbare Readings. Nach einem Update (oder nach der automatischen Aktualisierung) werden neue Readings generiert.
      -
    • -
      -
    • clear <reading name>
      - Löscht den Reading-Eintrag mit dem gegebenen Namen. Nach einem Update (oder nach der automatischen Aktualisierung) - wird dieser Eintrag ggf. neu erstellt (falls noch definiert). Dieses Mechanismus erlaubt das gezielte Löschen nicht mehr benötigter - benutzerdefinierten Einträge.
      -
    • -
      -
    • password <Passwort>
      - Definiert das Passwort für den Remote-Zugriff (i.d.R. nur einmalig notwendig). -
    • -
      -

    - - Attributes:

    -
      -
    • filesystems <reading name>[:<mountpoint>[:<comment>]],...
      - Gibt die zu überwachende Dateisysteme an. Es wird eine kommaseparierte Liste erwartet.
      - Reading-Name wird bei der Anzeige und Logging verwendet, Mount-Point ist die Grundlage der Auswertung, - Kommentar ist relevant für die HTML-Anzeige (s. SYSMON_ShowValuesHTML)
      - Beispiel: /boot,/,/media/usb1
      - oder: fs_boot:/boot,fs_root:/:Root,fs_usb1:/media/usb1:USB-Stick
      - Im Sinne der besseren Übersicht sollten zumindest Name und MountPoint angegeben werden. -
    • -
      -
    • network-interfaces <name>[:<interface>[:<comment>]],...
      - Kommaseparierte Liste der Netzwerk-Interfaces, die überwacht werden sollen. - Jeder Eintrag besteht aus dem Reading-Namen, dem Namen - des Netwerk-Adapters und einem Kommentar für die HTML-Anzeige (s. SYSMON_ShowValuesHTML). Wird kein Doppelpunkt verwendet, - wird der Wert gleichzeitig als Reading-Name und Interface-Name verwendet.
      - Beispiel ethernet:eth0:Ethernet,wlan:wlan0:WiFi
      -
    • -
      -
    • user-defined <readingsName>:<Interval_Minutes>:<Comment>:<Cmd>,...
      - Diese kommaseparierte Liste definiert Einträge mit jeweils folgenden Daten: - Reading-Name, Aktualisierungsintervall in Minuten, Kommentar und Betriebssystem-Commando. -
      Die BS-Befehle werden entsprechend des angegebenen Intervalls ausgeführt und als Readings mit den angegebenen Namen vermerkt. - Kommentare werden für die HTML-Ausgaben (s. SYSMON_ShowValuesHTML) benötigt. -
      Alle Parameter sind nicht optional! -
      Es ist wichtig, dass die angegebenen Befehle schnell ausgeführt werden, denn in dieser Zeit wird der gesamte FHEM-Server blockiert! -
      Werden Ergebnisse der lang laufenden Operationen benötigt, sollten diese z.B als CRON-Job eingerichtet werden - und in FHEM nur die davor gespeicherten Ausgaben visualisiert.

      - Beispiel: Anzeige der vorliegenden Paket-Aktualisierungen für das Betriebssystem:
      - In einem cron-Job wird folgendes täglich ausgeführt:
      - sudo apt-get update 2>/dev/null >/dev/null - apt-get upgrade --dry-run| perl -ne '/(\d*)\s[upgraded|aktualisiert]\D*(\d*)\D*install|^ \S+.*/ and print "$1 aktualisierte, $2 neue Pakete"' 2>/dev/null > /opt/fhem/data/updatestatus.txt -
      - Das Attribute uder-defined wird auf
      sys_updates:1440:System Aktualisierungen:cat /opt/fhem/data/updatestatus.txt
      gesetzt. - Danach wird die Anzahl der verfügbaren Aktualisierungen täglich als Reading 'sys_updates' protokolliert. -
    • -
      -
    • user-fn <fn_name>:<Interval_Minutes>:<reading_name1>:<reading_name2>...[:<reading_nameX>],...
      - Liste der benutzerdefinierten Perlfunktionen.
      - Als <fn_name> können entweder Name einer Perlfunktion oder ein Perlausdruck verwendet werden. - Die Perlfunktion bekommt den Device-Hash als Übergabeparameter und muss ein Array mit Werte liefern. - Diese Werte werden entsprechend den Parameter <reading_nameX> in Readings übernommen.
      - Ein Perlausdruck muss in geschweifte Klammer eingeschlossen werden und kann folgende Paramter verwenden: $HASH (Device-Hash) und $NAME (Device-Name). - Rückgabe wird analog einer Perlfunktion erwartet.
      - Wichtig! Die Trennung zwischen mehreren Benutzerfunktionen muss mit einem Komma UND einem Leerzeichen erfolgen! Innerhalb der Funktiondefinition dürfen Kommas nicht durch Leerzeichen gefolgt werden. -
    • -
      -
    • disable
      - Mögliche Werte: 0,1. Bei 1 wird die Aktualisierung gestoppt. -
    • -
      -
    • telnet-prompt-regx, telnet-login-prompt-regx
      - RegExp zur Erkennung von Login- und Kommandozeile-Prompt. (Nur für Zugriffe über Telnet relevant.) -
    • -
      -
    • exclude
      - Erlaubt das Abfragen bestimmten Informationen zu unterbinden.
      - Mögliche Werte: user-defined (s. user-defined und user-fn), cpucount, uptime, fhemuptime, - loadavg, cputemp, cpufreq, cpuinfo, diskstat, cpustat, ramswap, filesystem, network, - fbwlan, fbnightctrl, fbnewmessages, fbdecttemp, fbversion, fbdsl, powerinfo -
    • -
      -

    - - Plots:

    -
      - Für dieses Modul sind bereits einige gplot-Dateien vordefiniert:
      -
        - FileLog-Versionen:
        +
        + Get:

        +
          +
        • interval
          + Listet die bei der Definition angegebene Polling-Intervalle auf. +
        • +
          +
        • interval_multipliers
          + Listet die definierten Multipliers. +
        • +
          +
        • list
          + Gibt alle Readings aus. +
        • +
          +
        • update
          + Aktualisiert alle Readings. Alle Werte werden neu abgefragt. +
        • +
          +
        • version
          + Zeigt die Version des SYSMON-Moduls. +
        • +
          +
          +
        • list_lan_devices
          + Listet bekannte Geräte im LAN (nur FritzBox). +
        • +
        +
        + Set:

        +
          +
        • interval_multipliers
          + Definiert Multipliers (wie bei der Definition des Gerätes). +
        • +
          +
        • clean
          + Löscht benutzerdefinierbare Readings. Nach einem Update (oder nach der automatischen Aktualisierung) werden neue Readings generiert.
          +
        • +
          +
        • clear <reading name>
          + Löscht den Reading-Eintrag mit dem gegebenen Namen. Nach einem Update (oder nach der automatischen Aktualisierung) + wird dieser Eintrag ggf. neu erstellt (falls noch definiert). Dieses Mechanismus erlaubt das gezielte Löschen nicht mehr benötigter + benutzerdefinierten Einträge.
          +
        • +
          +
        • password <Passwort>
          + Definiert das Passwort für den Remote-Zugriff (i.d.R. nur einmalig notwendig). +
        • +
          +
        +
        + Attributes:

        +
          +
        • filesystems <reading name>[:<mountpoint>[:<comment>]],...
          + Gibt die zu überwachende Dateisysteme an. Es wird eine kommaseparierte Liste erwartet.
          + Reading-Name wird bei der Anzeige und Logging verwendet, Mount-Point ist die Grundlage der Auswertung, + Kommentar ist relevant für die HTML-Anzeige (s. SYSMON_ShowValuesHTML)
          + Beispiel: /boot,/,/media/usb1
          + oder: fs_boot:/boot,fs_root:/:Root,fs_usb1:/media/usb1:USB-Stick
          + Im Sinne der besseren Übersicht sollten zumindest Name und MountPoint angegeben werden. +
        • +
          +
        • network-interfaces <name>[:<interface>[:<comment>]],...
          + Kommaseparierte Liste der Netzwerk-Interfaces, die überwacht werden sollen. + Jeder Eintrag besteht aus dem Reading-Namen, dem Namen + des Netwerk-Adapters und einem Kommentar für die HTML-Anzeige (s. SYSMON_ShowValuesHTML). Wird kein Doppelpunkt verwendet, + wird der Wert gleichzeitig als Reading-Name und Interface-Name verwendet.
          + Beispiel ethernet:eth0:Ethernet,wlan:wlan0:WiFi
          +
        • +
          +
        • user-defined <readingsName>:<Interval_Minutes>:<Comment>:<Cmd>,...
          + Diese kommaseparierte Liste definiert Einträge mit jeweils folgenden Daten: + Reading-Name, Aktualisierungsintervall in Minuten, Kommentar und Betriebssystem-Commando. +
          Die BS-Befehle werden entsprechend des angegebenen Intervalls ausgeführt und als Readings mit den angegebenen Namen vermerkt. + Kommentare werden für die HTML-Ausgaben (s. SYSMON_ShowValuesHTML) benötigt. +
          Alle Parameter sind nicht optional! +
          Es ist wichtig, dass die angegebenen Befehle schnell ausgeführt werden, denn in dieser Zeit wird der gesamte FHEM-Server blockiert! +
          Werden Ergebnisse der lang laufenden Operationen benötigt, sollten diese z.B als CRON-Job eingerichtet werden + und in FHEM nur die davor gespeicherten Ausgaben visualisiert.

          + Beispiel: Anzeige der vorliegenden Paket-Aktualisierungen für das Betriebssystem:
          + In einem cron-Job wird folgendes täglich ausgeführt:
          + sudo apt-get update 2>/dev/null >/dev/null + apt-get upgrade --dry-run| perl -ne '/(\d*)\s[upgraded|aktualisiert]\D*(\d*)\D*install|^ \S+.*/ and print "$1 aktualisierte, $2 neue Pakete"' 2>/dev/null > /opt/fhem/data/updatestatus.txt +
          + Das Attribute uder-defined wird auf
          sys_updates:1440:System Aktualisierungen:cat /opt/fhem/data/updatestatus.txt
          gesetzt. + Danach wird die Anzahl der verfügbaren Aktualisierungen täglich als Reading 'sys_updates' protokolliert. +
        • +
          +
        • user-fn <fn_name>:<Interval_Minutes>:<reading_name1>:<reading_name2>...[:<reading_nameX>],...
          + Liste der benutzerdefinierten Perlfunktionen.
          + Als <fn_name> können entweder Name einer Perlfunktion oder ein Perlausdruck verwendet werden. + Die Perlfunktion bekommt den Device-Hash als Übergabeparameter und muss ein Array mit Werte liefern. + Diese Werte werden entsprechend den Parameter <reading_nameX> in Readings übernommen.
          + Ein Perlausdruck muss in geschweifte Klammer eingeschlossen werden und kann folgende Paramter verwenden: $HASH (Device-Hash) und $NAME (Device-Name). + Rückgabe wird analog einer Perlfunktion erwartet.
          + Wichtig! Die Trennung zwischen mehreren Benutzerfunktionen muss mit einem Komma UND einem Leerzeichen erfolgen! Innerhalb der Funktiondefinition dürfen Kommas nicht durch Leerzeichen gefolgt werden. +
        • +
          +
        • disable
          + Mögliche Werte: 0,1. Bei 1 wird die Aktualisierung gestoppt. +
        • +
          +
        • telnet-prompt-regx, telnet-login-prompt-regx
          + RegExp zur Erkennung von Login- und Kommandozeile-Prompt. (Nur für Zugriffe über Telnet relevant.) +
        • +
          +
        • exclude
          + Erlaubt das Abfragen bestimmten Informationen zu unterbinden.
          + Mögliche Werte: user-defined (s. user-defined und user-fn), cpucount, uptime, fhemuptime, + loadavg, cputemp, cpufreq, cpuinfo, diskstat, cpustat, ramswap, filesystem, network, + fbwlan, fbnightctrl, fbnewmessages, fbdecttemp, fbversion, fbdsl, powerinfo +
        • +
          +
        +
        + Plots:

        +
          + Für dieses Modul sind bereits einige gplot-Dateien vordefiniert:
          +
            + FileLog-Versionen:
            + + SM_RAM.gplot
            + SM_CPUTemp.gplot
            + SM_FS_root.gplot
            + SM_FS_usb1.gplot
            + SM_Load.gplot
            + SM_Network_eth0.gplot
            + SM_Network_eth0t.gplot
            + SM_Network_wlan0.gplot
            + SM_CPUStat.gplot
            + SM_CPUStatSum.gplot
            + SM_CPUStatTotal.gplot
            + SM_power_ac.gplot
            + SM_power_usb.gplot
            + SM_power_battery.gplot
            +
            + DbLog-Versionen:
            + + SM_DB_all.gplot
            + SM_DB_CPUFreq.gplot
            + SM_DB_CPUTemp.gplot
            + SM_DB_Load.gplot
            + SM_DB_Network_eth0.gplot
            + SM_DB_RAM.gplot
            +
            +
          +
        +
        + HTML-Ausgabe-Methode (für ein Weblink): SYSMON_ShowValuesHTML(<SYSMON-Instanz>[,<Liste>])

        +
          + Das Modul definiert eine Funktion, die ausgewählte Readings in HTML-Format ausgibt.
          + Als Parameter wird der Name des definierten SYSMON-Geräts erwartet.
          + Es kann auch ReadingsGroup, CloneDummy oder andere Module genutzt werden, dann werden einfach deren Readings verwendet.
          + Der zweite Parameter ist optional und gibt eine Liste der anzuzeigende Readings + im Format <ReadingName>[:<Comment>[:<Postfix>[:<FormatString>]]] an.
          + Dabei gibt ReadingName den anzuzeigenden Reading an, der Wert aus Comment wird als der Anzeigename verwendet + und Postfix wird nach dem eihentlichen Wert angezeigt (so können z.B. Einheiten wie MHz angezeigt werden). + Mit Hilfe von FormatString kann die Ausgabe beeinflusst werden (s. sprintf in PerlDoku).
          + Falls kein Comment angegeben ist, wird eine intern vordefinierte Beschreibung angegeben. + Bei benutzerdefinierbaren Readings wird ggf. Comment aus der Definition verwendet.
          + Wird keine Liste angegeben, wird eine vordefinierte Auswahl verwendet (alle Werte).

          + define sysv1 weblink htmlCode {SYSMON_ShowValuesHTML('sysmon')}
          + define sysv2 weblink htmlCode {SYSMON_ShowValuesHTML('sysmon', ('date:Datum', 'cpu_temp:CPU Temperatur: °C', 'cpu_freq:CPU Frequenz: MHz'))} +
        +
        + HTML-Ausgabe-Methode (für ein Weblink): SYSMON_ShowValuesHTMLTitled(<SYSMON-Instance>[,<Title>,<Liste>])

        +
          + Wie SYSMON_ShowValuesHTML, aber mit einer Überschrift darüber. Wird keine Überschrift angegeben, wird alias des Moduls genutzt (falls definiert).
          +
        +
        + Text-Ausgabe-Methode (see Weblink): SYSMON_ShowValuesText(<SYSMON-Instance>[,<Liste>])

        +
          + Analog SYSMON_ShowValuesHTML, jedoch formatiert als reines Text.
          +
        +
        + HTML-Ausgabe-Methode (für ein Weblink): SYSMON_ShowValuesTextTitled(<SYSMON-Instance>[,<Title>,<Liste>])

        +
          + Wie SYSMON_ShowValuesText, aber mit einer Überschrift darüber.
          +
        +
        + Readings-Werte mit Perl lesen: SYSMON_getValues(<name>[, <Liste der gewünschten Schlüssel>])

        +
          + Liefert ein Hash-Ref mit den gewünschten Werten. Wenn keine Liste (array) übergeben wird, werden alle Werte geliefert.
          + {(SYSMON_getValues("sysmon"))->{'cpu_temp'}}
          + {(SYSMON_getValues("sysmon",("cpu_freq","cpu_temp")))->{"cpu_temp"}}
          + {join(" ", values (SYSMON_getValues("sysmon")))}
          + {join(" ", values (SYSMON_getValues("sysmon",("cpu_freq","cpu_temp"))))}
          +
        +
        + Beispiele:

        +
          - SM_RAM.gplot
          - SM_CPUTemp.gplot
          - SM_FS_root.gplot
          - SM_FS_usb1.gplot
          - SM_Load.gplot
          - SM_Network_eth0.gplot
          - SM_Network_eth0t.gplot
          - SM_Network_wlan0.gplot
          - SM_CPUStat.gplot
          - SM_CPUStatSum.gplot
          - SM_CPUStatTotal.gplot
          - SM_power_ac.gplot
          - SM_power_usb.gplot
          - SM_power_battery.gplot
          -
          - DbLog-Versionen:
          - - SM_DB_all.gplot
          - SM_DB_CPUFreq.gplot
          - SM_DB_CPUTemp.gplot
          - SM_DB_Load.gplot
          - SM_DB_Network_eth0.gplot
          - SM_DB_RAM.gplot
          -
          -
        -

      - - HTML-Ausgabe-Methode (für ein Weblink): SYSMON_ShowValuesHTML(<SYSMON-Instanz>[,<Liste>])

      -
        - Das Modul definiert eine Funktion, die ausgewählte Readings in HTML-Format ausgibt.
        - Als Parameter wird der Name des definierten SYSMON-Geräts erwartet.
        - Es kann auch ReadingsGroup, CloneDummy oder andere Module genutzt werden, dann werden einfach deren Readings verwendet.
        - Der zweite Parameter ist optional und gibt eine Liste der anzuzeigende Readings - im Format <ReadingName>[:<Comment>[:<Postfix>[:<FormatString>]]] an.
        - Dabei gibt ReadingName den anzuzeigenden Reading an, der Wert aus Comment wird als der Anzeigename verwendet - und Postfix wird nach dem eihentlichen Wert angezeigt (so können z.B. Einheiten wie MHz angezeigt werden). Mit Hilfe von FormatString kann die Ausgabe beeinflusst werden (s. sprintf in PerlDoku).
        - Falls kein Comment angegeben ist, wird eine intern vordefinierte Beschreibung angegeben. - Bei benutzerdefinierbaren Readings wird ggf. Comment aus der Definition verwendet.
        - Wird keine Liste angegeben, wird eine vordefinierte Auswahl verwendet (alle Werte).

        - define sysv1 weblink htmlCode {SYSMON_ShowValuesHTML('sysmon')}
        - define sysv2 weblink htmlCode {SYSMON_ShowValuesHTML('sysmon', ('date:Datum', 'cpu_temp:CPU Temperatur: °C', 'cpu_freq:CPU Frequenz: MHz'))} -

      - - HTML-Ausgabe-Methode (für ein Weblink): SYSMON_ShowValuesHTMLTitled(<SYSMON-Instance>[,<Title>,<Liste>])

      -
        - Wie SYSMON_ShowValuesHTML, aber mit einer Überschrift darüber. Wird keine Überschrift angegeben, wird alias des Moduls genutzt (falls definiert).
        -

      - - - Text-Ausgabe-Methode (see Weblink): SYSMON_ShowValuesText(<SYSMON-Instance>[,<Liste>])

      -
        - Analog SYSMON_ShowValuesHTML, jedoch formatiert als reines Text.
        -

      - - HTML-Ausgabe-Methode (für ein Weblink): SYSMON_ShowValuesTextTitled(<SYSMON-Instance>[,<Title>,<Liste>])

      -
        - Wie SYSMON_ShowValuesText, aber mit einer Überschrift darüber.
        -

      - - Readings-Werte mit Perl lesen: SYSMON_getValues(<name>[, <Liste der gewünschten Schlüssel>])

      -
        - Liefert ein Hash-Ref mit den gewünschten Werten. Wenn keine Liste (array) übergeben wird, werden alle Werte geliefert.
        - {(SYSMON_getValues("sysmon"))->{'cpu_temp'}}
        - {(SYSMON_getValues("sysmon",("cpu_freq","cpu_temp")))->{"cpu_temp"}}
        - {join(" ", values (SYSMON_getValues("sysmon")))}
        - {join(" ", values (SYSMON_getValues("sysmon",("cpu_freq","cpu_temp"))))}
        -

      - - Beispiele:

      -
        - # Modul-Definition
        define sysmon SYSMON 1 1 1 10
        #attr sysmon event-on-update-reading cpu_temp,cpu_temp_avg,cpu_freq,eth0_diff,loadavg,ram,^~ /.*usb.*,~ /$
        @@ -6017,10 +5279,12 @@ If one (or more) of the multiplier is set to zero, the corresponding readings is attr wl_sysmon_power_bat label "Stromversorgung (bat) Spannung: $data{min1} - $data{max1} V, Strom: $data{min2} - $data{max2} mA"
        attr wl_sysmon_power_bat room Technik
        attr wl_sysmon_power_bat group system
        -
        -
      + +
    +
+ + - =end html_DE =cut