Skip to main content

Automate Server Monitoring - Service - Restart [Autofix]

Summary​

This script is used with the remote monitors of the Solution - Automate server and CW Manage Plugin Monitoring, which needed to be created due to static Global Variables and a specific Subject that had to be used.

Image

The script will only send a SUCCESS email if a FAILURE email has already been sent for that service.

Sample Run​

This script will not work manually; it can be used via the △ Custom - Autofix - Restart Service - Automate Server Monitoring alert template. This script is intended only for use from a monitor alert template.

Dependencies​

Variables​

NameDescription
STATUSStatus returned from Monitor Set (SUCCESS|FAILED)
FieldNameService name returned from Monitor set
SubjectTicket/Email Subject
BodyTicket/Email Body for Failure
CommentTicket/Email Comment for Failure
TicketCommentTicket Comment for Success
EmailBodyEmail Body for Success

Global Parameters​

To use the script as an Autofix for remote service monitors, global variables must be appropriately addressed.

NameExampleRequiredDescription
TicketCreationCategory0FalseID of the ticket category to create the ticket. 0 will disable ticketing. Default is 134 (ID of ticket category service).
SuccessEmail1True if EmailAddress is definedSetting it to 0 will restrict the script from emailing out the Success status of the monitor set. Default is 1

System Properties​

NameDefaultRequiredDescription
ProVal_Alerts_Email_AddressAlerts@provaltech.comTrueBy default, the system property ProVal_Alerts_Email_Address will be set to alerts@provaltech.com. This can be changed if these alerts should go elsewhere.

Image

Script State​

NameExampleRequiredDescription
<SERVICE NAME>_Failure_Email1TrueKeeps track of whether the failure email has been sent for the <SERVICE> or not.

Process​

  • Check the status of the Monitor Set.
  • Try restarting the service(s).
  • Send an email to Alerts@provaltech.com, creating an urgent ticket in ProVal's Halo.

Please reference the agnostic content documentation for the Service Restart Process.

Output​

  • Script Log
  • Email

Changelog​

2025-04-10​

  • Initial version of the document