USAGE for global_replica_status.sh v1.1.2: global_replica_status.sh [-H <host1>[,<host2>,...]] [-i <tag>] [-f] [-r] [-e|-E] [-L <log>] [-si] [-v<n>] [-n|-N] [-D] or global_replica_status.sh [-h|-man|-V] DESCRIPTION: This script checks the statis of Helix replicas on all replica hosts, as defined in the SDP_REPLICA_HOSTS variable set in configuration file, /p4/common/config/sdp_hosts.cfg. The underlying Perforce status command is a 'p4 pull -lj' command. This script is intended to be called by a cron job the master server. It then does ssh calls to the remaining SDP hosts. This depends on ssh keys being setup such that the Perforce login (as defined by OSUSER in /p4/common/bin/p4_vars) can ssh without a password to all SDP hosts. (To simplify failover, the backup servers should also be able to ssh to each other without a password; security implications should be considered here.) OPTIONS: -H <host1>[,<host2>,...] Specify a comma-delimited list of hosts to push to. By default, the SDP_REPLICA_HOSTS value defined in the config file /p4/common/config/sdp_hosts.cfg determines the list of hosts to push to. -i <tag> Specify the SDP instance tag (e.g '-i 1' for /p4/1 or '-i fgs' for /p4/fgs) for the SDP instance to check replcas for. The default is to use the $SDP_INSTANCE variable if defined, or else '1'. The default host config file /p4/common/config/sdp_hosts.cfg is ignored in favor of an instance-specific file if one is found named /p4/common/config//p4/common/config/sdp_hosts.<tag>.cfg. This can be used for cases where instances share the master/commit server, but have differing hosts on which replicas for each instance are run. -f Do a 'sudo service iptables status' to check firewalls. Currently only supports firewalls that work with that command (including RHEL 6/CentOS 6). This verifies that sudo access works, and displays information about the firewwall. This option is only suitable for sites where the Perforce admin account is allowed sudo access. -r Specify this option to remove old global_replica_status.*.log files. If this option is specified, log files named /p4/<n>/logs/global_replica_status.*.log (where '<n>' is the SDP instance name) that are older than the number of days indicated by the KEEPLOGS setting in /p4/common/bin/p4_vars are removed. The old log removal occurs only upon successful completion. -e Send email to MAILTO value defined in /p4/common/bin/p4_vars in event of failure only. -E Send email to MAILTO value defined in /p4/common/bin/p4_vars. -v<n> Set verbosity 1-5 (-v1 = quiet, -v5 = highest). -L <log> Specify the path to a log file, or the special value 'off' to disable logging. By default, all output (stdout and stderr) goes to a log file named global_replica_status.<datestame>.log in /p4/1/logs. NOTE: This script is self-logging. That is, output displayed on the screen is simultaneously captured in the log file. Do not run this script with redirection operators like '> log' or '2>&1', and do not use 'tee.' -si Operate silently. All output (stdout and stderr) is redirected to the log only; no output appears on the terminal. This cannot be used with '-L off'. -n No-Op. Prints commands instead of running them. -N No-Op. Similar to '-n', but this command does execute the 'ssh' calls to get to the remote host, but then does 'p4 sync -n' rather than' 'p4 sync' on the remote host. -D Set extreme debugging verbosity. HELP OPTIONS: -h Display short help message -man Display man-style help message -V Dispay version info for this script and its libraries. FILES: The SDP environment file /p4/common/bin/p4_vars defines various SDP settings, and is used by several SDP scripts. The host config file /p4/common/config/sdp_hosts.cfg defines the SDP_HOSTS and other values. EXAMPLES: Recommended crontab usage for SDP Instance 1: /p4/common/bin/global_replica_status.sh -i 1 -si -r -E < /dev/null > /dev/null 2>&1 The redirect to /dev/null is to avoid any output that would generate a duplicate email from cron. Output is not lost; it is written to a timestampped log file: /p4/1/logs/global_replica_status.<timestamp>.log SEE ALSO: See this related script: /p4/common/bin/sdp_sync.sh
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#1 | 23960 | noe_gonzalez | "Forking branch Dev of perforce-software-sdp to noe_gonzalez-sdp." | ||
//guest/perforce_software/sdp/dev/doc/global_replica_status.command_summary.txt | |||||
#1 | 23404 | C. Thomas Tyler |
Added command summary file for global_replica_status.sh script. Updated command summary file for sdp_sync.sh script. Doc only, no functional changes. |