Monitoring ZFS Statistic

By combining two great tools arcstat and dimstat you can get ZFS statistics in:

  • table view

  • chart view

  • any date/time interval

  • host to host compare


For example, online table and chart view



The following easy steps are needed to integrate arcstat into dimstat. I am suggesting that you are already happy user of dimstat and ZFS.

  1. Download arcstat.pl script from this page.

  2. Modify arcstat.pl script so it will print numerical values instead of pretty numbers (20000000000 versus 20G). This numbers will be inserted into database. This is why we need exact numbers. In the script locate prettynum function and add one line (bold one):

    sub prettynum {
            my @suffix=(' ','K', 'M', 'G', 'T', 'P', 'E', 'Z');
            my $num = $_[1] || 0;
            my $sz = $_[0];
            my $index = 0;
            return sprintf("%s", $num) if not $num =~ /\^[0-9\\.]+$/;
    return sprintf("%d", $num);
            while ($num > 1000 and $index < 8) {
                    $num = $num/1000;
                    $index++;
            }
            return sprintf("%\*d", $sz, $num) if ($index == 0);
            return sprintf("%\*d%s", $sz - 1, $num,$suffix[$index]);
    }
  3. Save modified script in /etc/STATsrv/bin/ on the monitored server.

  4. Give execute permissions to the script: chmod +x /etc/STATsrv/bin/arcstat.pl

  5. Register this script in dimstat “ access to execute” database. Add this line in the end of /etc/STATsrv/access file: command arcstat /etc/STATsrv/bin/arcstat.pl

  6. Download description file arcstat.desc.

  7. Login to dimstat server and choose “ Add-On STAT(s)”:

  8. Choose “Restore Add-On STAT(s) Description”:

  9. Choose “From Local File on your disk” and upload description file acrstat.desc.

  10. From now you can go to dimstat Home and “Start New Collect”. arcstat will appear in the list of available STAT(s). Wait a few minutes before results will appear in Analyze section.


This modification will allow you to monitor 11 basic values provided by arcstat by default. At most arcstat gives all 30 values from kstat -m zfs.


Comments:

Hi Roman, thanks for your contribution. Dirk

Posted by Dirk Wriedt on September 16, 2009 at 12:09 AM PDT #

Post a Comment:
  • HTML Syntax: NOT allowed
About

Roman (pomah) Ivanov, ISV Engineering. Tips how to run Oracle best on Sun. Performance monitoring and tuning for system administrators. OpenSolaris user experience.

Search

Categories
Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today