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:48] – [retmt.pl] wnelis | monitors:retmt [2020/01/28 10:12] – [Client 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 === | ||
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 ==== |
- | Before | + | Before |
< | < | ||
Line 266: | Line 269: | ||
< | < | ||
# | # | ||
- | # Graph definitions for additional tests in xymon, which are local to this | + | # Graph definitions for test ' |
- | # installation of xymon. | + | |
# | # | ||
[env] | [env] | ||
Line 286: | Line 288: | ||
</ | </ | ||
+ | The definition file xymonserver.cfg is extended by copying the snippet below to file ~xymon/ | ||
- | ===== Source ===== | ||
- | ==== myscript.sh ==== | ||
- | |||
- | <hidden onHidden=" | ||
< | < | ||
+ | TEST2RRD+=", | ||
+ | GRAPHS+=", | ||
</ | </ | ||
- | </ | ||
- | |||
- | ===== Known Bugs and Issues ===== | ||
- | |||
- | ===== To Do ===== | ||
- | ===== Credits ===== | ||
===== Changelog ===== | ===== Changelog ===== |