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:diskstat.pl [2019/02/12 16:25] – [Installation] wnelis | monitors:diskstat.pl [2019/02/12 16:42] – [Changelog] wnelis | ||
---|---|---|---|
Line 5: | Line 5: | ||
^ Requirements | Perl, Linux | | ^ Requirements | Perl, Linux | | ||
^ Download | None | | ^ Download | None | | ||
- | ^ Last Update | 2012-04-02 | | + | ^ Last Update | 2019-02-12 | |
===== Description ===== | ===== Description ===== | ||
Line 33: | Line 33: | ||
=== Server side === | === Server side === | ||
- | At the Xymon server, the status message from script diskstat.pl is to be handled by script rrd_status.pl. This is accomplished by merging | + | At the Xymon server, |
< | < | ||
- | [rrdstatus] | + | TEST2RRD+=", |
- | ENVFILE / | + | GRAPHS+=",diskstat:: |
- | NEEDS xymond | + | |
- | CMD xymond_channel --channel=status --log=$XYMONSERVERLOGS/ | + | |
</ | </ | ||
- | |||
- | Install the following script, named rrd_status.pl, | ||
- | |||
- | <hidden onHidden=" | ||
- | <code perl> | ||
- | # | ||
- | # | ||
- | # This script handles a list of NCVs, send by a Xymon client, and prepares it to | ||
- | # be stored in an RRA. This script is used in cases in which a fixed-size group | ||
- | # of two or more values should be put together into a single RRA. The algorithm | ||
- | # is specific for each test / client. | ||
- | # | ||
- | # This script is invoked with three parameters: the name of the host, the name | ||
- | # of the test and the name of the file containing the message sent by the | ||
- | # client, containing the NCVs to be handled. | ||
- | # | ||
- | use strict; | ||
- | |||
- | # | ||
- | # Installation constants. | ||
- | # ----------------------- | ||
- | # | ||
- | # %Struct defines the datasets of the various tests. | ||
- | # | ||
- | my %Struct= ( | ||
- | diskstat => [ # Must be sorted! | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | ) ; # of %Struct | ||
- | |||
- | # | ||
- | # Global variables. | ||
- | # ----------------- | ||
- | # | ||
- | my ( $HostName, $TestName, $FileName )= @ARGV ; | ||
- | # | ||
- | my %Var= () ; # Save area measurements | ||
- | my ( $Line, @Line ) ; # List of values of one measurement | ||
- | my $key ; # Loop control variable | ||
- | |||
- | |||
- | # | ||
- | # Main program. | ||
- | # ------------- | ||
- | # | ||
- | |||
- | # | ||
- | # Handle test " | ||
- | # | ||
- | # An attempt has been undertaken to make this code a little bit more general. | ||
- | # The name of an NCV should consist of two names separated by "/" | ||
- | # name becomes (part of) the name of the RRA, the second name becomes the | ||
- | # name of the DS. The DS-ses are written in sorted order. | ||
- | # | ||
- | if ( $TestName eq " | ||
- | open( FH, "<", | ||
- | while ( <FH> ) { | ||
- | chomp ; | ||
- | next unless m/ | ||
- | $Var{$1}{$2}= $3 ; | ||
- | } # of while | ||
- | close( FH ) ; | ||
- | |||
- | print @{$Struct{$TestName}} ; | ||
- | foreach $key ( sort keys %Var ) { | ||
- | @Line= () ; | ||
- | push @Line, $Var{$key}{$_} | ||
- | print " | ||
- | print join( ":", | ||
- | } # of foreach | ||
- | } # of if | ||
- | |||
- | exit 0 ; | ||
- | </ | ||
- | </ | ||
The results are displayed in 4 graphs, named [diskstat], [diskstat0], | The results are displayed in 4 graphs, named [diskstat], [diskstat0], | ||
Line 240: | Line 154: | ||
</ | </ | ||
- | Define the diskstat graphs to be multi-graphs, which should show only one disk per graph, | + | Define the diskstat graphs to be multi-graphs with the following modification in ~xymon/ |
< | < | ||
CGI_SVC_OPTS=" | CGI_SVC_OPTS=" | ||
- | </ | ||
- | and the following modifications in ~xymon/ | ||
- | < | ||
- | TEST2RRD=" | ||
- | GRAPHS=" | ||
</ | </ | ||
Line 453: | Line 362: | ||
* **2012-04-02** | * **2012-04-02** | ||
* Initial release | * Initial release | ||
+ | * **2019-02-12** | ||
+ | * Use Devmon format to pass the statistics to xymon / RRD in stead of the NCV format. | ||