Antoine_Sauteron_1266

Send a notification if a server process (CP / WP) goes down

Discussion created by Antoine_Sauteron_1266 on Mar 3, 2017
Latest reply on May 13, 2017 by Harriet_Kim_1764
Disclaimer : this solution is not ideal, as having the AE server check its own status does not make much sense if the server itself is down. We still recommend to monitor processes via a separate monitoring tool.

Here is a very basic solution to periodically check if your server processes are up, and send notifications if not.
It consists of a few objects:
  • VARA.SQLI.SRV.PROC lists all server processes
  • SCRI.SRV.PROC.ALIVE checks if their statuses and executes...
  • ... CALL.MAIL.SRV.PROC.DOWN if a process is down
  • EVNT.TIME.CHECK.SRV.PROC.ALIVE runs SCRI.SRV.PROC.ALIVE at a given interval

VARA.SQLI.SRV.PROC
SELECT OH_NAME
FROM OH
WHERE OH_OTYPE='SERV'
AND OH_DeleteFlag='0'
ORDER BY OH_NAME

SCRI.SRV.PROC.ALIVE
:SET &HND# = PREP_PROCESS_VAR(VARA.SQLI.SRV.PROC)

:PROCESS &HND#
:SET &PROC# = GET_PROCESS_LINE (&HND#,1)
:SET &STATUS# = SYS_SERVER_ALIVE(&PROC#)

:IF &STATUS# = 'N'
:  SET &SEND_NOTIF# = ACTIVATE_UC_OBJECT(CALL.MAIL.SRV.PROC.DOWN,,,,,PASS_VALUES)
:ENDIF
:ENDPROCESS
Note : for
ACTIVATE_UC_OBJECT(CALL.MAIL.SRV.PROC.DOWN,,,,,PASS_VALUES)
to work, you need to add the variable that should be passed in Variables & Prompts > Variables:
 gfmdycewos1b.png
 

CALL.MAIL.SRV.PROC.DOWN

It's pretty standard, I just adjusted the recipients and the SUBJECT so it contains the process' name:
:  PUT_ATT SUBJECT = "Alarm:Server process &PROC# is down!"

EVNT.TIME.CHECK.SRV.PROC.ALIVE

Adjust the interval :
67ixng549wx0.png

!Process Tab
:SET &RUNCHECK# = ACTIVATE_UC_OBJECT(SCRI.SRV.PROC.ALIVE)

I'm adding an export of the objects to this post. Please feel free to import them.
If you are using an Oracle DB you will need to move the statements to the Oracle tab in the VARA.SQLI object.
XML export was made under User Interface version 11.2.3+build.465. Simply adjust the <uc-export clientvers=""> tag to your version before importing the objects.

Best regards,
Antoine

Attachments

Outcomes