Shout to trigger on third consecutive failure of cyclic job

Everything about Batch Impact Manager Server and Web access installation or setup.
Post Reply
AD Control-M
Nouveau
Nouveau
Posts: 3
Joined: 02 May 2015 6:42

Shout to trigger on third consecutive failure of cyclic job

Post by AD Control-M » 02 May 2015 6:50

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.

User avatar
fyot
Nouveau
Nouveau
Posts: 734
Joined: 26 Apr 2005 12:00
Location: PARIS
Contact:

Re: Shout to trigger on third consecutive failure of cyclic

Post by fyot » 03 May 2015 10:25

Follow this link

http://www.scheduler-usage.com/viewtopi ... ilit=third

Search third you will have several returns

AD Control-M
Nouveau
Nouveau
Posts: 3
Joined: 02 May 2015 6:42

Re: Shout to trigger on third consecutive failure of cyclic

Post by AD Control-M » 04 May 2015 9:03

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

User avatar
Walty
Nouveau
Nouveau
Posts: 473
Joined: 20 Jan 2006 12:00

Re: Shout to trigger on third consecutive failure of cyclic

Post by Walty » 08 May 2015 8:17

Best regards
Walty

AD Control-M
Nouveau
Nouveau
Posts: 3
Joined: 02 May 2015 6:42

Re: Shout to trigger on third consecutive failure of cyclic

Post by AD Control-M » 08 Jul 2015 3:26

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.

User avatar
SreeMahi
Nouveau
Nouveau
Posts: 12
Joined: 20 Oct 2008 12:00
Location: Bangalore,Karnataka
Contact:

Re: Shout to trigger on third consecutive failure of cyclic

Post by SreeMahi » 28 Jul 2015 8:38

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....

Post Reply