Internal Monitor - Failure Check Autofix,Properties
Summary
The script generates a ticket containing information about internal monitors that have been disabled due to failure in the past 2 hours. It explicitly excludes monitor sets with the string [Disabled] in their names. This script is necessary because disabled monitors cannot independently create tickets about their status.
The script features an option to enable the disabled monitor sets, controlled by the system property MonitorFailureCheck-EnableAutofix. Setting this property to 1 activates the Autofix section of the script.
Within the Autofix section, there is an additional option to create a ticket if the script fails to enable the disabled monitor sets. This ticketing capability is governed by the system property MonitorFailureCheck-AutofixFailureAlerting. Setting this property to 1 enables the creation of autofix failure tickets.
The script can generate two types of Autofix failure tickets, each controlled by specific system properties:
- Immediate Autofix Failure Tickets: The script generates a ticket if the total number of remaining disabled monitors (excluding intentionally disabled ones) exceeds the value stored in the system property MonitorFailureCheck-MaxAllowedDisabledMonitorsafter an autofix attempt.
- For Problematic Monitors: The script creates a ticket for monitor sets that remain continuously disabled despite repeated Autofix attempts. Automate persists in disabling these monitors. This behavior is controlled by the system properties MonitorFailureCheck-ThresholdDaysandMonitorFailureCheck-ThresholdTimes. The ticket contains information about monitor sets that have been disabled for more than the number stored inMonitorFailureCheck-ThresholdTimeswithin the past number of days stored inMonitorFailureCheck-ThresholdDays.
The ticket category for all tickets created by the monitor set can be defined in the MonitorFailureCheck-TicketCategory system property.
The MonitorFailureCheck-EmailAlerts property offers the option to enable email alerts in case of a failure.
Update Notice: 14-Dec-2023
- New Script Introduction: We have introduced a new script, Internal Monitor - Failure Check [Autofix, Properties], to replace the previous script,Internal Monitor - Failed [Tickets, Global]. 
- Client Script Implementation: The new script functions as a client script and is designed to generate client-level tickets.
- System Properties Usage: In contrast to the prior script, the new version utilizes system properties instead of Global Variables. Specifically, the MonitorFailureCheck-ClientIDForTicketsystem property is employed to store the client ID for creating failure tickets.- Default Behavior: If MonitorFailureCheck-ClientIDForTicketis not configured, the script intelligently determines the client ID based on the following criteria:- For on-prem partners, the script uses the ClientID of the Automate Server.
- For hosted partners, the script automatically selects the minimum ClientID containing a computer.
 
 
- Default Behavior: If 
- Autofix Failure Tickets Enhancement: Previously, the script only generated Autofix failure tickets for monitor sets continuously disabled despite Autofix attempts. We've introduced a new option in the script to create an instant ticket if Autofix fails to resolve the issue. The MonitorFailureCheck-MaxAllowedDisabledMonitorssystem property manages this behavior. If bothAutofixandAutofix Failure ticketsare enabled (by settingMonitorFailureCheck-EnableAutofixto1andMonitorFailureCheck-AutofixFailureAlertingto1), the script creates a ticket if the total number of remaining disabled monitors (excluding intentionally disabled ones) exceeds the value stored inMonitorFailureCheck-MaxAllowedDisabledMonitors.
- Action Required: Users are encouraged to review and replace their scripts to incorporate these changes for optimal functionality.
Implementation Steps
For New Implementation:
- Importing the Script:
- Navigate to the ProSync Client Plugin.
- Import the script following the established procedure.
 
- Create System Properties: Execute the script against any client in the environment with the set environment parameter set to 1to create the system properties used by the script.   
- System Properties Configuration (Initial Implementation):
- Refer to the System Properties section of the document for more information on the properties.
- Ensure that the initial implementation includes the appropriate system properties as defined.
 
- Script Schedule: Schedule the script following the example provided in the Sample Run section of the document.
For Script Updates After 14-Dec-2023:
- Open the Script:
- Access the existing script (Internal Monitor - Failed [Tickets, Global]) in the environment where the update is required.
 
- Access the existing script (
- Capture Current Global Variables:
- Before proceeding with the update, take a screenshot of the existing Global Variables settings to preserve the current configuration.
 
- Before proceeding with the update, take a screenshot of the existing Global Variables settings to preserve the current configuration.
- Import the New Script:
- Navigate to the ProSync Client Plugin.
- Import the new script (Internal Monitor - Failure Check [Autofix, Properties]) following the established procedure.
 
- Create System Properties: Execute the script against any client in the environment with the set environment parameter set to 1to create the system properties used by the script.   
- System Properties Configuration (Initial Implementation):
- Refer to the System Properties section of the document for more information on the properties.
- Verify that the values for the new system properties match those of the current Global parameters.
 
- Script Schedule: Schedule the script following the example provided in the Sample Run section of the document.
- Remove the Old Script: Delete the old script (Internal Monitor - Failed [Tickets, Global]) from the environment.
Sample Run

Consider scheduling the new client script to execute every two hours.
System Properties
| Name | Former Global Variable | Default | Required | Description | 
|---|---|---|---|---|
| MonitorFailureCheck-EmailAlerts | 0 | False | Setting the value to 1will activate the script's email feature. The script will then send an email to the address(es) stored in the default system property_sysTicketDefaultEmailafter creating a ticket for any issues._sysTicketDefaultEmail: | |
| MonitorFailureCheck-TicketCategory | TicketCreationCategory | 6 | False | Ticket category id of the ticket to be generated. Leave it blank to generate the ticket with the default script ticket category.  Default Script Ticket Category:  | 
| MonitorFailureCheck-EnableAutofix | Autofix | 0 | True | If the value is set to 1, it will trigger Autofix and disable the default detection ticketing. The default, set at0, generates a ticket for the disabled monitor set without attempting to enable them. | 
| MonitorFailureCheck-AutofixFailureAlerting | TicketPostAutofix | 1 | False | Setting the value to 1will enable the Ticket generation feature after applying the Autofix. The script can create two types of Autofix failure tickets: one for the immediate failure of the Autofix and the other for monitor sets that are continuously getting disabled even after applying the Autofix multiple times. The behavior for these tickets can be controlled and managed by the system properties explained in the subsequent cells of this table. Note thatMonitorFailureCheck-EnableAutofixmust be enabled or set to1to use this property. | 
| MonitorFailureCheck-ThresholdDays | ThresholdDays | 7 | True | If the MonitorFailureCheck-AutofixFailureAlertingsystem property is set to1, the script checks for monitor sets that were disabledXnumber of times overYnumber of days to identify those disabled multiple times. In this context,Yrepresents the number of days stored in theMonitorFailureCheck-ThresholdDayssystem property.MonitorFailureCheck-EnableAutofixandMonitorFailureCheck-AutofixFailureAlertingmust both be set to1to utilize this property. | 
| MonitorFailureCheck-ThresholdTimes | ThresholdTimes | 5 | True | Stores the number of times ( X) a monitor set must have failed over the pastYdays, whereYis the number of days stored in theMonitorFailureCheck-ThresholdDayssystem property. To utilize this property, bothMonitorFailureCheck-EnableAutofixandMonitorFailureCheck-AutofixFailureAlertingmust be set to1. | 
| MonitorFailureCheck-MaxAllowedDisabledMonitors | 5 | True | This property stores the number of disabled monitor sets that Automate fails to enable even after running the Autofix, serving as a basis for comparison before creating an Autofix failure ticket. To utilize this property, both MonitorFailureCheck-EnableAutofixandMonitorFailureCheck-AutofixFailureAlertingmust be set to1. | |
| MonitorFailureCheck-ClientIDForTicket | 0 | False | The ClientID for which failure tickets are intended to be created. This system property can be disregarded for on-prem partners and for hosted partners where the client ID of the internal environment is 1. | 

Output
- Client-Level Ticket
Sample Ticket
