From a03dda24866b2e08d9f5c7be4c03e19e5405d308 Mon Sep 17 00:00:00 2001 From: Michal Svamberg Date: Mon, 1 Jun 2015 13:53:59 +0200 Subject: [PATCH] Add percentual perf. data and limits to DISKUSED --- nagios/check-netapp-ng.pl | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/nagios/check-netapp-ng.pl b/nagios/check-netapp-ng.pl index 7b2197f..627abbb 100755 --- a/nagios/check-netapp-ng.pl +++ b/nagios/check-netapp-ng.pl @@ -712,8 +712,10 @@ if("$opt{'check_type'}" eq "TEMP") { my @tmp_arr = split(/\./, $key); my $oid = pop(@tmp_arr); my $used = ""; + my $capacity = ""; if ($opt{'version'} eq '2c') { $used = _get_oid_value($snmp_session,"$snmp_netapp_volume_id_table_df64_used.$oid"); + $capacity = _get_oid_value($snmp_session,"$snmp_netapp_volume_id_table_df64_total.$oid"); } else { my $used_high = _get_oid_value($snmp_session,"$snmp_netapp_volume_id_table_df_used_high.$oid"); @@ -724,7 +726,10 @@ if("$opt{'check_type'}" eq "TEMP") { ($msg,$stat) = _clac_err_stat($used_prec,$opt{'check_type'},$opt{'warn'},$opt{'crit'}); - $perf = "$$r_vol_tbl{$key}=$used\KB"; + # https://nagios-plugins.org/doc/guidelines.html + # 'label'=value[UOM];[warn];[crit];[min];[max] + $perf = "$$r_vol_tbl{$key}=$used\KB;" .floor($capacity*$opt{'warn'}/100) .";" .floor($capacity*$opt{'crit'}/100) .";;$capacity"; + $perf .= " $$r_vol_tbl{$key}:perc=$used_prec\%;" .floor($opt{'warn'}) .";" .floor($opt{'crit'}) .";;100"; } } if ($msg =~ /^$/) {