Ad Widget

Collapse

Solaris ZFS

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • mixmegapol
    Junior Member
    • Jan 2015
    • 7

    #1

    Solaris ZFS

    Hi all

    I have some Solaris [10/11] Servers which I need to monitor.
    Does anybody has experience with monitoring ZFS ?
    I get different dataset but there aren't any zfs commands used (v 2.4.7).

    Can someone help?
    Kind regards
    Daniel
  • kloczek
    Senior Member
    • Jun 2006
    • 1771

    #2
    Originally posted by mixmegapol
    Hi all

    I have some Solaris [10/11] Servers which I need to monitor.
    Does anybody has experience with monitoring ZFS ?
    I get different dataset but there aren't any zfs commands used (v 2.4.7).
    Yes I have experience with monitoring ZFS

    Can someone help?
    Control question: on what exactly?
    http://uk.linkedin.com/pub/tomasz-k%...zko/6/940/430/
    https://kloczek.wordpress.com/
    zapish - Zabbix API SHell binding https://github.com/kloczek/zapish
    My zabbix templates https://github.com/kloczek/zabbix-templates

    Comment

    • mixmegapol
      Junior Member
      • Jan 2015
      • 7

      #3
      Hi kloczek

      Thank you for your reply!

      I supposed zfs would be better supported as there are zabbix-agents already compiled. It isn't useful to use df's with ZFS.

      Now, I have two files:
      - solaris_get_zfs_fileset.perl:
      #!/usr/bin/perl

      use strict;
      use warnings;

      print "{\n";
      print "\t\"data\":[\n\n";

      my @array = `zfs get -Hp name`;
      my $n;
      $n = @array;
      my $linenumber;
      $linenumber = 0;
      foreach my $line (@array)
      {
      $linenumber++;
      my @cols = split(/\t/, $line);
      # print "$cols[0]\n";
      print "{\t\t\"{#FILESETNAME}\":\"$cols[0]\"\n";
      print "\t}\n";
      if ($linenumber == $n) { } else { print ","; }
      }
      print "\n\t]\n";
      print "}\n";


      - solaris_get_zfs_pool.perl
      #!/usr/bin/perl

      use strict;
      use warnings;

      print "{\n";
      print "\t\"data\":[\n\n";

      my @array = `zpool list -Ho name`;
      my $n;
      $n = @array;
      my $linenumber;
      $linenumber = 0;
      foreach my $line (@array)
      {
      $linenumber++;
      my @cols = split(/\t/, $line);
      # print "$cols[0]\n";
      chomp($cols[0]);
      print "{\t\t\"{#ZPOOLNAME}\":\"$cols[0]\"\n";
      print "\t}\n";
      if ($linenumber == $n) { } else { print ","; }
      }
      print "\n\t]\n";
      print "}\n";


      - userparameter_zfs.conf:
      UserParameter=zfs.pool.discovery,perl /opt/zabbix_scripts/solaris_get_zfs_pool.perl
      UserParameter=zfs.fileset.discovery,perl /opt/zabbix_scripts/solaris_get_zfs_fileset.perl

      UserParameter=zfs.zpool.health[*],/usr/sbin/zpool list -H -o health $1
      UserParameter=zfs.get.fsinfo[*],/usr/sbin/zfs get -o value -Hp $2 $1


      Do I go into correct direction?
      Either I can do a file with this perl-scripts or I can find somewhere an already working ZFS-Template.

      I found a template, but the sed-commands aren't solaris-compatible (I would have to use the gnu sed version, but I rather won't do that).

      And as the '|' isn't working in the conf-file (e.g. zpool list | awk '{print $3}' ; I had to use a script..

      How did you solve that? I'm very new to scripting.

      The next problem is the output of 'zpool list':
      I get percentages :

      boarder05 ~ $ zpool list
      NAME SIZE ALLOC FREE CAP HEALTH ALTROOT
      datapool 39.8G 26.1G 13.6G 65% ONLINE -
      ftppool 199G 36.4G 163G 18% ONLINE -
      rpoolp 59.5G 16.0G 43.5G 26% ONLINE -


      Is there a way to get the output of capacity and size in bytes/numbers instead of human-readable format and '%' ?

      I don't know how to do.

      It would be great if you could help me!

      Kind regards
      Daniel

      Comment

      • iav
        Junior Member
        • Apr 2014
        • 10

        #4
        Originally posted by mixmegapol
        Is there a way to get the output of capacity and size in bytes/numbers instead of human-readable format and '%' ?
        The answer is "use data from zfs, not zpool".

        Comment

        Working...