I've tried to get something formal out of tech support but they can only point me a *nix solutions which is useless in a Windows environment.
What ways do you use in Windows to establish that a quiet point has actually been enabled? As far as I can see the 2 options are likely to be grepping the log file, and grepping the event log. I have no idea how to do either of these, and neither does our customer. This is Windows-2012 R2 Datacentre.
*braces self for 'apply the Linux patch jibes'
> I fail to see how the Linux patch would solve the problem.
Tom is just trying to be funny. That is all. Needs some patching there as well.
:START
call %DLC%/bin/promon xx < xx.resp > xx.out
type xx.out | findstr /c:"Quiet Point is Active" > NUL
IF %ERRORLEVEL% EQU 0 (
echo "QP enabled"
) ELSE (
GOTO START
)
xx.resp is just plain text with
5
q
q
You can also screen-scrape promon 5 (Activity). It contains a message when a quiet point is active. It can be run non-interactively.
That's an interesting idea Rob. Might see if I can piece something together. It's a pain that the application has 10 databases connected. Makes things like this much harder.
Obviously applying the Linux patch is the simplest and most effective solution.
The Windows sort-of-equivalent to "grep" is "findstr".
Or, as Rob says, you can screen-scrape PROMON.
I fail to see how the Linux patch would solve the problem. Is it the case that on Windows proutil can return before the database is actually quieted but on Linux proutil is guaranteed to return only after the quiet point is in effect?
Thanks [mention:fe8282ef278c4275ba47482593e9fbc2:e9ed411860ed4f2ba0265705b8793d05] all the info on that link is applicable to Linux. It is one of the links I was given.
It is much easier to script things with Linux.
If you're running Progress V11.5 or higher than you can check that the MTX and BIB latches are owned by broker, i.e. _Latch._Latch-Owner eq 0.
Thanks George. This is OE10.2B08 currently. Hoping to upgrade them to 11.7 later this year.
> I fail to see how the Linux patch would solve the problem.
Tom is just trying to be funny. That is all. Needs some patching there as well.
:START
call %DLC%/bin/promon xx < xx.resp > xx.out
type xx.out | findstr /c:"Quiet Point is Active" > NUL
IF %ERRORLEVEL% EQU 0 (
echo "QP enabled"
) ELSE (
GOTO START
)
xx.resp is just plain text with
5
q
q
Hi James, I'd go for PowerShell using Get-EventLog for the event log or Select-String for the file. I think the file thing is easier in this case.
This piece of script will show you the last one of 5583/5584 events:
Select-String -Pattern "\((5583)|(5584)\)" -Path .\test.lg | Select-Object -Last 1
I just TABbed my way around but you don't need to fully qualify each cmdlet or parameter, this would work the same:
sls "\((5583)|(5584)\)" .\teste.lg | select -l 1
You do not need to scrape the .lg file. Just promon.
The PowerShell equivalent of the article marshall pointed out, I think, is something like this:
$DBNAME='teste'
$LOOPTIME=10
while ($true) {
$q1 = (Select-String -Pattern "\(5583\)" -Path "$DBNAME.lg" | Measure-Object).Count;
$q2 = (Select-String -Pattern "\(5584\)" -Path "$DBNAME.lg" | Measure-Object).Count;
if ($q1 -eq $q2) {
"DB does NOT have a quiet point";
} elseif ($q1 -gt $q2) {
"quiet point HAS been enabled on the DB";
} else {
"DB.log's been shrunk or modified";
}
Start-Sleep -Seconds $LOOPTIME;
}
Libor's suggestion might be easier but I just tend to avoid batch programming in new development.