. "[-1 | -2] [-c <community>]\n"
. "[-3] [-u <username>] [-a (md5|sha)] [-A <authpasswd>] [-x (des|aes)] [-X <privpasswd>]\n"
. " [-E <contextengineid>] [-n <contextname>]\n"
- . "[-t <total-threshold>] [-T <total-threshold>] [-r <real-threshold>] [-R <real-threshold>]",
+ . "[-m <total-threshold>] [-M <total-threshold>] [-r <real-threshold>] [-R <real-threshold>]",
extra => "\nAll thresholds are in nagios standard format, see\n"
. "http://nagiosplug.sourceforge.net/developer-guidelines.html#THRESHOLDFORMAT\n"
. "for a description\n"
my $swapused=$swap-$result->{$oid_memAvailSwap};
my $totalavail=$realavail+$result->{$oid_memAvailSwap};
+my $realpercent=sprintf("%.0f",($realavail/$realmem)*100);
+my $totalpercent=sprintf("%.0f",($totalavail/($realmem+$swap))*100);
+my $swappercent=sprintf("%.0f",($swapused/$swap)*100);
+
############ convert the results to the desired unit ############
my @resultvar=(\$realmem, \$realavail, \$swap, \$swapused, \$totalavail);
foreach my $varref (@resultvar)
############ compose message ############
$np->nagios_exit(
$np->max_state(@results),
- "Real av: $realavail $unitstr, Total av: $totalavail $unitstr, Swapped: $swapused $unitstr",
+ "Real av: $realavail $unitstr ($realpercent%), Total av: $totalavail $unitstr ($totalpercent%), Swapped: $swapused $unitstr ($swappercent%)",
);