# No parameter level checks will be defined in this
# version. That will come in later versions
-# $Id: check_vmstat,v 1.1 2002/01/11 20:40:52 sljohnson Exp $
+# $Id: check_vmstat,v 1.2 2002/01/17 15:41:25 sljohnson Exp $
use Spong::SafeExec qw(safe_exec);
# Try to determine which platform we are running on
# die if we don't have a platform implemented
$osname = $Config{'osname'};
-if ( $osname =~ /linux|aix/ ) {
+if ( $osname =~ /linux|aix|dec_osf/ ) {
}
{
$VMSTAT = '/usr/bin/vmstat 5 2', last if $osname eq 'aix';
$VMSTAT = '/usr/bin/vmstat 5 2', last if $osname eq 'linux';
+ $VMSTAT = '/usr/bin/vmstat 5 2', last if $osname eq 'dec_osf';
# Die if we haven't implementeda given OS platform
die('check_vmstat: $osname is a not an impletmented OS Platform')
$message = $message . "Command output:\n" . join('',@msg);
+# main::debug("check_vmstat: message = \n$message");
+ }
+ elsif ( $osname eq 'dec_osf' ) {
+ # Stuff the last line into the line buffer
+ $_ = $msg[$#msg];
+ $chomp;
+ if (/^\s*(\d+)\s+(\d+)\s+(\d+)\s+(\d+[KM]?)\s+(\d+[KM]?)\s+(\d+[KM]?)\s+(\d+[KM]?)\s+(\d+[KM]?)\s+(\d+[KM]?)\s+(\d+[KM]?)\s+(\d+[KM]?)\s+(\d+[KM]?)\s+(\d+)\s+(\d+[KM]?)\s+(\d+[KM]?)\s+(\d+)\s+(\d+)\s+(\d+)/ )
+ {
+ my($t);
+ $proc_run = $1; $proc_block = $2;
+ $free = $5;
+ $pi = $11; $po = $12;
+ $cs = $15;
+ if ($cs =~ /(\d+)K/) { $cs = $1 * 1000; }
+ # cpu wait is included in cpu_sy
+ $cpu_us = $16; $cpu_sy = $17; $cpu_id = $18;
+ $free =~ m/(\d+)([KM]*)/; ($mem_free,$t) = ($1,$2);
+ $mem_free = $mem_free * 1000 if $t eq 'K';
+ $mem_free = ($mem_free * 8 )/1000 ; # convert to MB, 1 page = 8K
+ }
+
+ $message =
+ "mem_free = $mem_free\n" .
+ "proc_run = $proc_run\n" .
+ "proc_block = $proc_block\n" .
+# "si = 0\n" . # AIX doesn't swap
+# "so = 0\n" .
+ "pi = $pi\n" .
+ "po = $po\n" .
+ "cs = $cs\n" .
+ "cpu_us = $cpu_us\n" .
+ "cpu_sy = $cpu_sy\n" .
+ "cpu_id = $cpu_id\n";
+
+ $message = $message . "Command output:\n" . join('',@msg);
+
# main::debug("check_vmstat: message = \n$message");
}