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:40] – [retmt.pl] wnelis | monitors:retmt [2020/01/28 10:19] – [Server side] wnelis | ||
---|---|---|---|
Line 9: | Line 9: | ||
===== 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. This method is usable for an arbitrary number of temperature sensors. It is used to report the temperature | + | 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. |
===== Installation ===== | ===== Installation ===== | ||
Line 16: | Line 16: | ||
- | === Client side === | + | ==== Client side ==== |
- | The script, written in Perl, is installed in (copied to) ~xymon/ | + | The script, written in Perl, is installed in (copied to) file ~xymon/ |
- | ==== retmt.pl | + | === retmt.pl === |
<hidden onHidden=" | <hidden onHidden=" | ||
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 225: | Line 228: | ||
- | Script retmt.pl is invoked once every 5 minutes. This is configured by copying the snippet below to ~xymon/ | + | Script retmt.pl is invoked once every 5 minutes. This is configured by copying the snippet below to file ~xymon/ |
< | < | ||
Line 239: | Line 242: | ||
- | === Server side === | + | ==== Server side ==== |
- | ===== Source ===== | + | Before any data is captured in an RRD, the definition of the RRD needed for this monitor needs to be installed. Add the snippet below to file ~xymon/ |
- | ==== myscript.sh ==== | + | |
- | <hidden onHidden=" | ||
< | < | ||
+ | # Definition for the measurement of the environmental temperature(s). | ||
+ | # Besides the average the minimum and the maximum are measured, and | ||
+ | # thus the MIN and MAX consolidation functions are needed too. | ||
+ | [env] | ||
+ | RRA: | ||
+ | RRA: | ||
+ | RRA: | ||
+ | RRA: | ||
+ | RRA: | ||
+ | RRA: | ||
+ | RRA: | ||
+ | RRA: | ||
+ | RRA: | ||
+ | RRA: | ||
+ | RRA: | ||
+ | RRA: | ||
</ | </ | ||
- | </ | ||
- | ===== Known Bugs and Issues ===== | + | Next the graph definition shown below is saved in file ~xymon/ |
- | ===== To Do ===== | + | < |
+ | # | ||
+ | # Graph definitions for test ' | ||
+ | # | ||
+ | # | ||
+ | # Graph definitions for test ' | ||
+ | # | ||
+ | [env] | ||
+ | FNPATTERN ^env\.temp\.(.+)\.rrd$ | ||
+ | TITLE , Temperature | ||
+ | YAXIS Temperature [C] | ||
+ | DEF: | ||
+ | DEF: | ||
+ | DEF: | ||
+ | CDEF: | ||
+ | LINE1: | ||
+ | AREA: | ||
+ | LINE1: | ||
+ | GPRINT: | ||
+ | GPRINT: | ||
+ | GPRINT: | ||
+ | GPRINT: | ||
+ | </ | ||
+ | |||
+ | The definition file xymonserver.cfg is extended by copying the snippet below to file ~xymon/ | ||
+ | |||
+ | < | ||
+ | TEST2RRD+=",env=devmon" | ||
+ | GRAPHS+=", | ||
+ | </ | ||
- | ===== Credits ===== | ||
===== Changelog ===== | ===== Changelog ===== | ||
Line 259: | Line 303: | ||
* **2017-10-18** | * **2017-10-18** | ||
* Initial release | * Initial release | ||
+ | * **2020-01-28** | ||
+ | * Include ' | ||