1
0
mirror of https://github.com/ranl/monitor-utils.git synced 2024-11-22 07:23:42 +01:00

DISKUSED accept aggregate name in -v option

This commit is contained in:
Michal Svamberg 2015-05-31 02:47:41 +02:00
parent 55ccc3a081
commit d5a2688d57

View File

@ -284,15 +284,16 @@ $err
Syntax:
-H <IP or Hostname> Ip/Dns Name of the Filer
-C <community name> SNMP Community Name for read
-V <1|2c> SNMP version (default 1)
-V <1|2c> SNMP version (default 1), some checks run only 2c
-T <check type> Type of check, see bellow
-t <seconds> Timeout to SNMP session in seconds (default 5)
-w <number> Warning Value (default 500)
-c <number> Critical Value (default 500)
-v <volume_path> Volume Name in format /vol/volname/
-v <vol_path|aggr_name> Volume Name in format /vol/volname/ or aggregate name
-e <vol1[,vol2[,...]]> Exclude volumes from snap check (SNAPSHOT)
-I Inform only, return OK every time (ignore -w and -c values)
-h This help
Available check types:
TEMP - Temperature
@ -300,14 +301,14 @@ $err
PS - Power Supply Fail
CPULOAD - CPU Load (-w -c)
NVRAM - NVram Battery Status
DISKUSED - Vol Usage Percentage (-w -c -v)
DISKUSED - Usage Percentage of volume or aggregate (-w -c -v)
SNAPSHOT - Snapshot Config (-e volname,volname2,volname3)
SHELF - Shelf Health
SHELFINFO - Shelf Model & Temperature Information
NFSOPS - Nfs Ops per seconds (-w -c)
CIFSOPS - Cifs Ops per seconds (-w -c)
ISCSIOPS - iSCSI Ops per seconds, using -V 2c automatic (-w -c)
FCPOPS - FibreChannel Ops per seconds, using -V 2c automatic (-w -c)
ISCSIOPS - iSCSI Ops per seconds, using SNMP version 2c (-w -c)
FCPOPS - FibreChannel Ops per seconds, using SNMP version 2c (-w -c)
NDMPSESSIONS - Number of ndmp sessions (-w -c)
CIFSSESSIONS - Number of cifs sessions (-w -c)
GLOBALSTATUS - Global Status of the filer
@ -322,9 +323,6 @@ $err
$script_name -H netapp.mydomain -C public -T UPTIME
UPTIME: 2 days, 23:03:21.09 | uptime=255801s
$script_name -H netapp.mydomain -C public -T FCOPS -I
OK: FCPOPS 1130 | fcpops=1130
$script_name -H netapp.mydomain -C public -T DISKUSED -v /vol/data/ -w 90 -c 95 -V 2c
OK: DISKUSED 79% | /vol/data/=8104595240k
@ -439,14 +437,16 @@ my $result = GetOptions(\%opt,
'exclude|e=s',
'inform|I',
'timeout|t=i',
"help|h",
);
FSyntaxError("") if defined $opt{'help'};
FSyntaxError("Missing -H") unless defined $opt{'filer'};
FSyntaxError("Missing -C") unless defined $opt{'community'};
FSyntaxError("Missing -T") unless defined $opt{'check_type'};
if($opt{'vol'}) {
if($opt{'vol'} !~ /^\/.*\/$/) {
FSyntaxError("$opt{'vol'} format is /vol/volname/ !");
if ( !( ($opt{'vol'} =~ m#^/vol/.*/$#) or ($opt{'vol'} =~ m#^[^/]*$#) ) ) {
FSyntaxError("$opt{'vol'} format is /vol/volname/ or 'aggregate_name' !");
}
}
if($opt{'crit'} and $opt{'warn'}) {
@ -679,7 +679,7 @@ if("$opt{'check_type'}" eq "TEMP") {
}
if ($msg =~ /^$/) {
$stat = $ERRORS{'WARNING'};
$msg = "WARN: Missing volume $opt{'vol'} !";
$msg = "WARN: Missing volume path or aggregate name '$opt{'vol'}' !";
}
### SNAPSHOT ###
} elsif("$opt{'check_type'}" eq "SNAPSHOT") {