--- netsaint_statd_v2.15/netsaint_statd Mon Apr 8 15:40:18 2002 +++ netsaint_statd_mod Thu Aug 17 10:21:10 2006 @@ -91,6 +91,7 @@ proccommand => "/bin/ps ax", procstates => "RSTDIZ", uptimecommand => "/usr/bin/uptime", + raid3ware => "/usr/local/sbin/tw_cli info XXX unitstatus", }, "NEXTSTEP" => { dfcommand => "/bin/df", @@ -152,7 +153,8 @@ "alldisks" => \&alldisks, "uptime" => \&uptime, "procs" => \&procs, - "named_proc" => \&named_proc + "named_proc" => \&named_proc, + "raid3ware" => \&raid3ware ); ################################################################################ @@ -368,3 +370,27 @@ print Client ++$#_; close(PROCOUT); } + +sub raid3ware { + my $controller = shift; + + my $unitlisting; + my $command = "$commandlist{$os}{raid3ware}"; + $command =~ s/XXX/$controller/g; + + open(PROCOUT, "$command |") || die; + $_ = ; + while($_ = ) { + if (/^(u\S+)\s+(\S+)\s*(\S+)\s+(\S+)\s+(\S+)\s+(\S+)\s+(\S+)\s+(\S+)\s+(\S+)\s*/) { + $unitlisting .= '(' . $1 . ',' . $2 . ',' . $3 .')'; + } + } + if (defined($unitlisting)) { + print Client $unitlisting; + } else { + print Client "no units?"; + } + + $unitlisting = undef; + close(PROCOUT); +}