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:38] – [retmt.pl] wnelis | monitors:retmt [2020/01/28 10:21] – [Server side] 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. 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 15: | Line 15: | ||
At the client side the script and the invocation of the script need to be installed. On the server side an extension of the RRD definitions, | At the client side the script and the invocation of the script need to be installed. On the server side an extension of the RRD definitions, | ||
- | === Client side === | ||
- | The script, written in Perl, is installed in (copied to) ~xymon/ | + | ==== Client side ==== |
- | ==== retmt.pl | + | The script, written in Perl, is installed in (copied to) file ~xymon/ |
+ | |||
+ | === retmt.pl === | ||
<hidden onHidden=" | <hidden onHidden=" | ||
Line 30: | 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 45: | Line 49: | ||
chomp $HostName ; | chomp $HostName ; | ||
my $TestName= ' | my $TestName= ' | ||
- | my $ThresholdYellow= | + | my $ThresholdYellow= |
- | my $ThresholdRed | + | my $ThresholdRed |
my @ColourOf= ( ' | my @ColourOf= ( ' | ||
Line 67: | Line 71: | ||
# | # | ||
- | # Issue a message | + | # Issue a message |
# StdOut will be redirected to the logfile. | # StdOut will be redirected to the logfile. | ||
# | # | ||
Line 101: | Line 105: | ||
$Result= " | $Result= " | ||
"< | "< | ||
- | " | + | " |
- | `$XySend $XyDisp $Result` ; | + | `$XySend $XyDisp $Result` ; # Inform Xymon |
- | $Result= '' | + | $Result= '' |
$Colour= | $Colour= | ||
$ErrMsg{$_}= [] foreach ( @ColourOf ) ; | $ErrMsg{$_}= [] foreach ( @ColourOf ) ; | ||
Line 136: | 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 208: | Line 212: | ||
$Result.= "< | $Result.= "< | ||
$Result.= " | $Result.= " | ||
- | $Result.= "temp $TempAvg: | + | $Result.= "temp.cpu $TempAvg: |
$Result.= " | $Result.= " | ||
} # of BuildMessage | } # of BuildMessage | ||
Line 224: | Line 228: | ||
- | Script retmt.pl is invoked once every 5 minutes. This is configured by copying the file below to ~xymon/ | + | Script retmt.pl is invoked once every 5 minutes. This is configured by copying the snippet |
< | < | ||
Line 238: | 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 ' | ||
+ | # | ||
+ | [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 258: | Line 300: | ||
* **2017-10-18** | * **2017-10-18** | ||
* Initial release | * Initial release | ||
+ | * **2020-01-28** | ||
+ | * Include ' | ||