CVS: ispman/bin ispman-agent,1.31.4.8.2.2,1.31.4.8.2.2.2.1
Atif Ghaffar <[email protected]>
| Newsgroups | gmane.comp.isp.ispman.cvs |
|---|---|
| Message-ID | <[email protected]> |
Update of /cvsroot/ispman/ispman/bin
In directory sc8-pr-cvs1:/tmp/cvs-serv29360
Modified Files:
Tag: REL_1_0
ispman-agent
Log Message:
removing use lib qw(%%installDir%%/lib %%installDir%%//conf);
we should not be depending on %%installDir%% substitution any more
adding a condition to Dump the process data only if debug is more than 2
adding info about nodetach and forcerestart in documentation.
adding comments about $Config->{'hostnames'}
Removed the following unneccesary lines
#chomp($hostname=$ENV{'HOSTNAME'}); #NO You cannot remove this.
# but I could :)
Index: ispman-agent
===================================================================
RCS file: /cvsroot/ispman/ispman/bin/ispman-agent,v
retrieving revision 1.31.4.8.2.2
retrieving revision 1.31.4.8.2.2.2.1
diff -C2 -r1.31.4.8.2.2 -r1.31.4.8.2.2.2.1
*** ispman-agent 20 May 2003 19:27:41 -0000 1.31.4.8.2.2
--- ispman-agent 1 Oct 2003 17:26:07 -0000 1.31.4.8.2.2.2.1
***************
*** 12,16 ****
}
- use lib qw(%%installDir%%/lib %%installDir%%//conf);
$|++;
--- 12,15 ----
***************
*** 31,35 ****
use File::Path;
use Fcntl;
! use POSIX qw(tmpnam);
use Sys::Hostname;
--- 30,34 ----
use File::Path;
use Fcntl;
! use POSIX qw(tmpnam);
use Sys::Hostname;
***************
*** 45,50 ****
- #chomp($hostname=$ENV{'HOSTNAME'}); #NO You cannot remove this.
- # but I could :)
$hostname=hostname(); # find hostname using Sys::Hostname. -End-Of-Story-
--- 44,47 ----
***************
*** 52,55 ****
--- 49,66 ----
+ ######## Additional hostnames by which this agent will ################
+ ######## recognize processes for this host. ################
+ ##########################################################################
+ # If you want this host to be known by multiple names, define them in ispman.conf on this host.
+ # This can happen after a machine upgrade etc or merger etc.
+ # for example if the hostname is zhisp01 but your mailhost is/was set to mailhost1
+ # and your webhost is/was set to webhost 1
+ # you may define mailhost1 and webhost1 as additional hostnames for this machine
+ # Example: $Config->{'hostnames'}="mailhost1 webhost1";
+ # this scenario should never arise on a clean system
+ #
+ # Note that the primary hostname of this node will always be whay Sys::Hostname
+ # will find
+ # Use the script ispman.myhostname to see how ispman-agent will see the hostname
@hostnames=split(/\s*,\s*/, $Config->{'hostnames'});
***************
*** 116,120 ****
exit 0; # I am the parent
}
! }
--- 127,131 ----
exit 0; # I am the parent
}
! }
***************
*** 131,135 ****
$ispman=ISPMan->new();
! $agentFrequency=$ispman->getConf("agentFrequency") || 1;
$ldapBaseDN=$ispman->getConf('ldapBaseDN');
$namedConfFile=$ispman->getConf('namedConfFile');
--- 142,146 ----
$ispman=ISPMan->new();
! $agentFrequency=$ispman->getConf("agentFrequency") || 1;
$ldapBaseDN=$ispman->getConf('ldapBaseDN');
$namedConfFile=$ispman->getConf('namedConfFile');
***************
*** 166,170 ****
# $ispman=ISPMan->new() || (print "Could not create an ISPMan instance" && die);
#}
!
$processes=$ispman->getProcessesForHost(\@hostnames);
my $processHash;
--- 177,181 ----
# $ispman=ISPMan->new() || (print "Could not create an ISPMan instance" && die);
#}
!
$processes=$ispman->getProcessesForHost(\@hostnames);
my $processHash;
***************
*** 181,186 ****
push @{$processHash->{$domain}{$process}{$params}}, $pid;
}
!
! print Dumper($processHash) if $processHash;
for $domain (keys %$processHash){
--- 192,198 ----
push @{$processHash->{$domain}{$process}{$params}}, $pid;
}
!
! #Only Dump the process data if debug is more than 2
! print Dumper($processHash) if $processHash && $ispman->{'Config'}{'debug'}>2;
for $domain (keys %$processHash){
***************
*** 192,196 ****
$ispman->deleteProcesses($processHash->{$domain}{$job}{$params});
} else {
! $ispman->updateProcess($processHash->{$domain}{$job}{$params}, "error", $message);
}
}
--- 204,208 ----
$ispman->deleteProcesses($processHash->{$domain}{$job}{$params});
} else {
! $ispman->updateProcess($processHash->{$domain}{$job}{$params}, "error", $message);
}
}
***************
*** 423,431 ****
to restart
! ispman-agent restart
!
to stop
! ispman-agent stop
!
=head1 DESCRIPTION
--- 435,454 ----
to restart
! ispman-agent restart
!
to stop
! ispman-agent stop
!
! to start in foreground
! ispman-agent nodetach
! This is useful if you are running ispman-agent under daemontool's supervisor
! Highly recommended
!
! to force restart after a crash
! ispman-agent forcerestart
! This will remove the existing PID file and start ispman-agent instance.
!
!
!
=head1 DESCRIPTION
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf