Several scripts have been developed to facilitate the maintenance of the IEPM-BW code. Any command which uses SCP should never be called from a CRON job!
runscp 'scpcommand'
'runscp' takes as a argument a model scp command and executes it on each of the monitoring hosts. For example:
4iepm@iepm-bw:runscp 'scp $bandsrc/config/servers.alive.template #host#:/home/iepm/v3src/config/servers.alive' Going to execute the command 'scp $bandsrc/config/servers.alive.template iepm@192.84.86.90:/home/iepm/v3src/config/servers.alive' on node iepm-bw.caltech.ul-org DONE WITH iepm-bw.caltech.ul-org Going to execute the command 'scp $bandsrc/config/servers.alive.template iepm@192.91.245.10:/home/iepm/v3src/config/servers.alive' on node iepm-bw.cern.ch DONE WITH iepm-bw.cern.ch Going to execute the command 'scp $bandsrc/config/servers.alive.template iepm@192.203.218.61:/home/iepm/v3src/config/servers.alive' on node iepm-bw.bnl.org DONE WITH iepm-bw.bnl.org Going to execute the command 'scp $bandsrc/config/servers.alive.template iepm@211.79.61.163:/home/iepm/v3src/config/servers.alive' on node iepm-bw.twaren.net DONE WITH iepm-bw.twaren.net Going to execute the command 'scp $bandsrc/config/servers.alive.template iepm@192.84.86.114:/home/iepm/v3src/config/servers.alive' on node iepm-bw.snv.ul-org DONE WITH iepm-bw.snv.ul-org
Note that the format of the scp command to be executed is the same as a regular scp command, but the character string '#host#' is used to indicate where the account and ip address are to be placed. This can only be used from the 'iepm' account because only it has ssh keys set up, and they are required for this function to be performed.
update-monhosts [-n aliasname]
'update-monhosts' updates all the monitoring hosts with no arguments, or just the specified monitoring host with the current distribution of the code. It uses SCP and SSH and must never be called from a CRON job. 'update-monhosts' tars up the current source as defined by the 'scripts.list' file, loops over all monitoring hosts, and uses SCP to transfer the tar file to each monitoring host. It then uses SSH to execute the installation script 'update-code' on each node. Note that the 'update-code' shuts down all the servers and daemons, installs the code, and then restarts all the servers and daemons. It finally prints out the instructions for updating CGI scripts in case they need to be updated. The CGI scripts only need to be updated if they are changed.
If there is customization needed for the source, it can be done by modifying the code at the start of 'update-monhosts'.