#!/usr/bin/perl
# stta_proc.cgi
# Display PS Status de los Servicios 
# STTA Rev. 1.3 Copyright (c) 2001-2004 Jesús Pérez Lorenzo  --- license GNU GPL 
# stta: (@#) 1.31051043346- [2004_01_29_102036]

require './stta-lib.pl';
 &foreign_require("proc", "proc-lib.pl");
@procs = &foreign_call("proc", "list_processes");
 &ReadParse();

 $serv = $in{srv};
 if (!$serv) { &redirect("index.cgi"); }
 $title_list=$serv."ps_list_title";
 $title_idx=$serv."ps_title";
 &headerstta($text{$title_list}, "", "ttastatus",undef,1,0,"$text{'headpage_right'}"."$text{'head_logout'}",undef,undef,"$text{head_below}" );

 print "<hr><p>\n"; 
 print "<table width=100% border>\n";
 print "<tr $tb> <td><font color='$revtext'><b>$text{$title_idx}</b></td> </tr>\n";
 print "<tr $cb> <td><table width=100%>\n";
 print "<tr><td><pre>\n";

     $daemon=$serv."_daemon";
     @line=split(/\//, $config{$daemon}, -1);
     $daemonStr=$line[$#line];

     &get_processes_list($daemonStr,1,1);
#     open (FILEOUT,">/tmp/out");
#     &get_processes_list($daemonStr,1,1,\FILEOUT);
#     close(FILEOUT);

 print "</table></table><p>\n";
 &footer($config{'back_return'},$text{'index'});
 do "footer.pl";
 exit;



