我的意图是仅在连续 x 次失败后发送失败的电子邮件通知。目前,我的 CA 自动后期处理脚本会为每个失败发送一个失败通知,但我有一个用例,只有在连续出现 3 个失败时,我们才必须发送电子邮件失败通知。
基本上我正在尝试保存最后 3 次运行信息,然后基于该使用 if 条件在连续 3 次失败后触发警报但无法这样做。
以下是我尝试过但无法正常工作的后期处理脚本(打破了我的脑袋)。
对此的任何帮助都非常感谢。
:print &usedhost#
:SET &RUNNR# = SYS_ACT_ME_NR()
:SET &STATUS# = GET_UC_OBJECT_STATUS(JOBS,&RUNNR#)
:print &STATUS#
:IF &STATUS# = '1900' or 'ENDED_OK'
:SET &STATUS# = 'ENDED_OK'
:ELSE
:SET &STATUS# = 'ENDED_NOTOK'
:SET &DUMMYSTATUS# = 'ENDED_OK'
:print "&STATUS#"
:ENDIF
:SET &CURRENTRUNSTATUS# = &CURRENTRUNSTATUS#
:SET &CURRENTRUNSTATUS1# = &CURRENTRUNSTATUS#
:SET &PREVIOUSRUNSTATUS# = &PREVIOUSRUNSTATUS#
:SET &PREVIOUSRUNSTATUS1# = &PREVIOUSRUNSTATUS#
:SET &P2PRUNSTATUS# = &P2PRUNSTATUS#
:SET &P2PRUNSTATUS1# = &P2PRUNSTATUS#
:IF &CURRENTRUNSTATUS# = ""
:SET &CURRENTRUNSTATUS# = &STATUS#
:ELSE
:SET &CURRENTRUNSTATUS# = &STATUS#
:ENDIF
:IF &PREVIOUSRUNSTATUS# = ""
:SET &PREVIOUSRUNSTATUS# = &DUMMYSTATUS#
:ELSE
:SET &PREVIOUSRUNSTATUS# = &CURRENTRUNSTATUS1#
:ENDIF
:IF &P2PRUNSTATUS# = ""
:SET &P2PRUNSTATUS# = &DUMMYSTATUS#
:ELSE
:SET &P2PRUNSTATUS# = &P2PRUNSTATUS1#
:ENDIF
:print "&CURRENTRUNSTATUS#"
:print "&PREVIOUSRUNSTATUS#"
:print "&P2PRUNSTATUS#" ```