Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision Next revisionBoth sides next revision | ||
monitors:retmt [2017/10/18 10:59] – [Server side] wnelis | monitors:retmt [2020/01/28 10:20] – [Table] wnelis | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== retmt: RETrieve Machine Temperature ====== | ====== retmt: RETrieve Machine Temperature ====== | ||
- | ^ Author | [[ wim.nelis@ziggo.nl | Wim Nelis ]] | | + | ^ Author |
- | ^ Compatibility | Xymon 4.2 | | + | ^ Compatibility |
- | ^ Requirements | Perl | | + | ^ Requirements |
- | ^ Download | None | | + | ^ Download |
- | ^ Last Update | 2017-10-18 | | + | ^ Last Update |
===== Description ===== | ===== Description ===== | ||
- | This client-side script retrieves the CPU and GPU temperatures of a Raspberry Pi 3 and reports them to the xymon server. A rather generic way of reporting the values is used, in which the minimum, the maximum and the average temperature are reported. The graph shows the range of the temperatures (a 100% confidence interval) and the average of the temperatures. (This method is usable for an arbitrary number of temperature sensors. It is used to report the temperatures of a switch with 29 temperature sensors.) | + | This client-side script retrieves the CPU and GPU temperatures of a Raspberry Pi 3 and reports them to the xymon server. A rather generic way of reporting the values is used, in which the minimum, the maximum and the average temperature are reported. The graph shows the range of the temperatures (a 100% confidence interval) and the average of the temperatures. (This method is usable for an arbitrary number of temperature sensors. It is also used to report the temperatures of a switch with 29 temperature sensors.) |
===== Installation ===== | ===== Installation ===== | ||
Line 31: | Line 31: | ||
# | # | ||
# Written by W.J.M. Nelis, wim.nelis@ziggo.nl, | # Written by W.J.M. Nelis, wim.nelis@ziggo.nl, | ||
+ | # | ||
+ | # Modified by W.J.M. Nelis, wim.nelis@ziggo.nl, | ||
+ | # - Specify the device type in the RRD file name, in this case ' | ||
# | # | ||
use strict ; | use strict ; | ||
Line 46: | Line 49: | ||
chomp $HostName ; | chomp $HostName ; | ||
my $TestName= ' | my $TestName= ' | ||
- | my $ThresholdYellow= | + | my $ThresholdYellow= |
- | my $ThresholdRed | + | my $ThresholdRed |
my @ColourOf= ( ' | my @ColourOf= ( ' | ||
Line 68: | Line 71: | ||
# | # | ||
- | # Issue a message | + | # Issue a message |
# StdOut will be redirected to the logfile. | # StdOut will be redirected to the logfile. | ||
# | # | ||
Line 102: | Line 105: | ||
$Result= " | $Result= " | ||
"< | "< | ||
- | " | + | " |
- | `$XySend $XyDisp $Result` ; | + | `$XySend $XyDisp $Result` ; # Inform Xymon |
- | $Result= '' | + | $Result= '' |
$Colour= | $Colour= | ||
$ErrMsg{$_}= [] foreach ( @ColourOf ) ; | $ErrMsg{$_}= [] foreach ( @ColourOf ) ; | ||
Line 137: | Line 140: | ||
@Lines= `$GpuCmd` ; # Retrieve information | @Lines= `$GpuCmd` ; # Retrieve information | ||
if ( @Lines == 0 ) { | if ( @Lines == 0 ) { | ||
- | push @{$ErrMsg{clear}}, | + | push @{$ErrMsg{clear}}, |
" | " | ||
} else { | } else { | ||
chomp $Lines[0] ; | chomp $Lines[0] ; | ||
unless ( $Lines[0] =~ m/ | unless ( $Lines[0] =~ m/ | ||
- | push @{$ErrMsg{clear}}, | + | push @{$ErrMsg{clear}}, |
" | " | ||
} else { | } else { | ||
Line 209: | Line 212: | ||
$Result.= "< | $Result.= "< | ||
$Result.= " | $Result.= " | ||
- | $Result.= "temp $TempAvg: | + | $Result.= "temp.cpu $TempAvg: |
$Result.= " | $Result.= " | ||
} # of BuildMessage | } # of BuildMessage | ||
Line 265: | Line 268: | ||
< | < | ||
+ | # | ||
+ | # Graph definitions for test ' | ||
+ | # | ||
# | # | ||
# Graph definitions for test ' | # Graph definitions for test ' | ||
# | # | ||
[env] | [env] | ||
- | TITLE , temperature | + | FNPATTERN ^env\.temp\.(.+)\.rrd$ |
+ | TITLE , Temperature | ||
YAXIS Temperature [C] | YAXIS Temperature [C] | ||
- | -l 0 | + | DEF:temp@RRDIDX@=@RRDFN@: |
- | DEF:temp=env.temp.rrd: | + | DEF:tmin@RRDIDX@=@RRDFN@: |
- | DEF:tmin=env.temp.rrd: | + | DEF:tmax@RRDIDX@=@RRDFN@: |
- | DEF:tmax=env.temp.rrd: | + | CDEF:trng@RRDIDX@=tmax@RRDIDX@,tmin@RRDIDX@,- |
- | CDEF: | + | LINE1:tmin@RRDIDX@#ffa07a |
- | LINE1: | + | AREA:trng@RRDIDX@# |
- | AREA: | + | LINE1:temp@RRDIDX@#EE0000:@RRDPARAM@ |
- | LINE1: | + | GPRINT: |
- | GPRINT: | + | GPRINT: |
- | GPRINT: | + | GPRINT: |
- | GPRINT: | + | GPRINT: |
- | GPRINT: | + | |
</ | </ | ||
Line 292: | Line 298: | ||
</ | </ | ||
- | |||
- | ===== Source ===== | ||
- | |||
- | ===== Known Bugs and Issues ===== | ||
- | |||
- | ===== To Do ===== | ||
- | |||
- | ===== Credits ===== | ||
===== Changelog ===== | ===== Changelog ===== | ||
Line 305: | Line 303: | ||
* **2017-10-18** | * **2017-10-18** | ||
* Initial release | * Initial release | ||
+ | * **2020-01-28** | ||
+ | * Include ' | ||