Hello All,
There is cyclic job which executes every day with re-run interval 30 mins.
I would like to ignore 2 failures and send ended not alert only on third failure.
ON STATEMENT *
CODE OK
DO SETVAR \FAILCNT 0
ON STATEMENT *
DO SETVER %%FAILCNT %%PLUS 1
ON FAILCNT=3
DO NOTOK
Can we achieve something like this or if anyone can suggest better way for this requirement.
Shout to trigger on third consecutive failure of cyclic job
-
- Nouveau
- Posts: 3
- Joined: 02 May 2015 6:42
Re: Shout to trigger on third consecutive failure of cyclic
Follow this link
http://www.scheduler-usage.com/viewtopi ... ilit=third
Search third you will have several returns
http://www.scheduler-usage.com/viewtopi ... ilit=third
Search third you will have several returns
-
- Nouveau
- Posts: 3
- Joined: 02 May 2015 6:42
Re: Shout to trigger on third consecutive failure of cyclic
hello Fyot,
Thank you for reply.
But my requirement is not runcount specific. as its cyclic job it will run throughout the day.
I want to ignore consecutive two failure, alert should not be sent to GAS only if job is failing continuously three time then it should post alert and change status to ended not ok
Thank you for reply.
But my requirement is not runcount specific. as its cyclic job it will run throughout the day.
I want to ignore consecutive two failure, alert should not be sent to GAS only if job is failing continuously three time then it should post alert and change status to ended not ok
Re: Shout to trigger on third consecutive failure of cyclic
Best regards
Walty
Walty
-
- Nouveau
- Posts: 3
- Joined: 02 May 2015 6:42
Re: Shout to trigger on third consecutive failure of cyclic
Hi Watty,
Thanks for reply. But in the method you suggest it will still post should to GAS.
My requirement is , job should not send shout for two consecutive failures which means actually we can perform step DO OK only for first two failures and on the third consecutive failure, alert should be generated.
Thanks for reply. But in the method you suggest it will still post should to GAS.
My requirement is , job should not send shout for two consecutive failures which means actually we can perform step DO OK only for first two failures and on the third consecutive failure, alert should be generated.
Re: Shout to trigger on third consecutive failure of cyclic
This is something tricky....
to achieve this you need a Script or Batch file which you need to invoke upon failue by sending a value as parameter.
Step 1: Set one variable called varFailedCount in server with 0
ctmvar -action set -var '%%\varFailedCount ' -varexpr "0"
Step 2: Define a script which will set the value passed by the job upon Failure
NewFailCount = $1 + 1
ctmvar -action set -var '%%\varFailedCount ' -varexpr "$NewFailCount"
Step 3: Define Shout Destination as Program and run in Server as Logical Name: VarScript and Physical Address: Script Path
Step 3: Define a shout which will trigger the script upon FAILURE
When ENDED NOTOK To: VarScript Message: %%varFC
Step 4: Set a Variable value to varFailedCount in the steps tab (v7) Or Variables section (v8)
%%varFC Value:%%varFailedCount + 1
Step 5: Set up On-Statement
On Stmt: * Code: OK
Do Shout To: VarScript Message: 0
On Stmt: * Code: varFC EQUAL 3
Do Mail: Your Mail.....
Hope this helps....
to achieve this you need a Script or Batch file which you need to invoke upon failue by sending a value as parameter.
Step 1: Set one variable called varFailedCount in server with 0
ctmvar -action set -var '%%\varFailedCount ' -varexpr "0"
Step 2: Define a script which will set the value passed by the job upon Failure
NewFailCount = $1 + 1
ctmvar -action set -var '%%\varFailedCount ' -varexpr "$NewFailCount"
Step 3: Define Shout Destination as Program and run in Server as Logical Name: VarScript and Physical Address: Script Path
Step 3: Define a shout which will trigger the script upon FAILURE
When ENDED NOTOK To: VarScript Message: %%varFC
Step 4: Set a Variable value to varFailedCount in the steps tab (v7) Or Variables section (v8)
%%varFC Value:%%varFailedCount + 1
Step 5: Set up On-Statement
On Stmt: * Code: OK
Do Shout To: VarScript Message: 0
On Stmt: * Code: varFC EQUAL 3
Do Mail: Your Mail.....
Hope this helps....