diff --git a/zabbix_scripts/check_lvm_sudo b/zabbix_scripts/check_lvm_sudo index 3dcfe74..c01e117 100644 --- a/zabbix_scripts/check_lvm_sudo +++ b/zabbix_scripts/check_lvm_sudo @@ -15,7 +15,7 @@ my $what = $ARGV[1]; sub usage { print<<"EOF"; -Usage: $0 [size|allocation|status] +Usage: $0 [size|allocation|allocation_pool_data|allocation_metadata|status] EOF } @@ -30,6 +30,16 @@ elsif ($what eq 'allocation'){ $ret =~ s/,/\./; print $ret; } +elsif ($what eq 'allocation_pool_data'){ + my $ret = (defined $info{allocated_pool_data}) ? $info{allocated_pool_data} : "ZBX_NOTSUPPORTED"; + $ret =~ s/,/\./; + print $ret; +} +elsif ($what eq 'allocation_metadata'){ + my $ret = (defined $info{allocated_meta_data}) ? $info{allocated_meta_data} : "ZBX_NOTSUPPORTED"; + $ret =~ s/,/\./; + print $ret; +} elsif ($what eq 'status'){ print $info{status}; } diff --git a/zabbix_scripts/disco_lvm_sudo b/zabbix_scripts/disco_lvm_sudo index 4bcf3f8..c9192d1 100644 --- a/zabbix_scripts/disco_lvm_sudo +++ b/zabbix_scripts/disco_lvm_sudo @@ -30,6 +30,17 @@ elsif ($what eq "snapshots"){ } } } +elsif ($what eq "thin_pools"){ + foreach my $group (get_volume_group_list()){ + my %lvs = get_logical_volume_information($group); + foreach my $lv (keys %lvs){ + if (defined $lvs{$lv}->{allocated_pool_data}){ + $lv = ($lv =~ m!^/dev/$group!) ? $lv : "/dev/$group/$lv"; + push @{$json->{data}}, { "{#LVMTHINP}" => "$lv" }; + } + } + } +} elsif ($what eq "groups"){ foreach my $group (get_volume_group_list()){ push @{$json->{data}}, { "{#LVMGRP}" => $group };