This script is more or less a companion/alternative to Perl script to Summarize Task states from REPSRV.LOG
It executes a REPCTL GETSERVERSTATUS commands and parses the output to summarize in an simple column fomat
Scripting weenies may appreciate how it looks up the Replicate install and data directory to deal with not-default installs.
Sample run and help text below.
Script attached as .TXT to appease the security gods.
Please save as Overview_local.ps1
(Kindly Let me know if/when/how this script helped you some?!)
PS C:\scripts> .\Overview_local.ps1
Task Name Replicate Server state Date-Time@01:28 Runs Comment
--------- ---------------- ----- ---------------- ---- -----------------
A localhost STOPPED 2016-12-06 10:21 1 FULL_LOAD_ONLY_FI
Attunity_Dev localhost RUNNING 2017-01-05 23:58 35
Attunity_Dev2 localhost NEW
DDLtest localhost STOPPED 2016-12-29 23:56 19 FULL_LOAD_ONLY_FI
DDLtestttttttt localhost ERROR 2016-12-20 13:31 RECOVERABLE_ERROR
FIS_BSP_STMP_T1 localhost NEW
GIFTCARDS_GIFTCARDS localhost NEW
PS C:\scripts> .\Overview_local.ps1 -help
Overview_local.ps1 Hein van den Heuvel, Attunity, 6-jan-2017
Present a quick overview of all Replicate tasks on the local server using getserverstatus.
Remote servers requires a careful management of remote Replicate server passwords
with corresponding mk.dat on the client side in the directory with REPCTL, or in the data
directory provided (or corresponding with that bin directory)
REPCTL = <C:\\"program files"\Attunity\Replicate\bin\repctl.exe>
DashD = <-d "C:\Program Files\Attunity\Replicate\data">
Default selection is all tasks, all states, in the default Replicate server (localhost)
Main Arguments and Defaults
IncludeTask : regexp for Task Names to Inlclude. default: all tasks
ExcludeTask : regexp for Task Names to Exlude. default: do not exclude any Name pattern.
IncludeState : regexp for Task states to Include. default: all tasks States
ExcludeState : regexp for Task States to Exlude. default: do not exclude any tasks State.
SleepTime : Seconds. Repeats report 'forever' at SleepTime intervals unless repeatcount is provided.
RepeatCount : Indicates how many times to repeat the report. Defaults SleepTime to 60 seconds.
Outfile : This file will have a copy of the onscreen output for future reference.
Default name is calculated as <replice-server>-AttunityTask-Overview-<yyyy-MM-dd_HH_mm>.log
States are 'calculated' as getserverstatus does not always return and explicit state
Notably 'Fully Only' tasks as declared 'STOPPED' when done, and a tasks which had never run is labeled 'NEW'
Expected stated are : RUNNING, STARTING, STOPPING, STOPPED, ERROR, UNKNOWN, NEW
The reported Time-Stamp is last-run for RUNNING/STARTING and last-Stopped for STOPPED/STOPPING/ERROR