Monitor~~ Autofix - Run Queued Scripts
Summary
This monitor is created by the CWM - Automate - Script - Queue Script automate script. It returns a failure if the computer is offline and success when online.
Internal Monitor Settings
- Interval: 5 minutes
- Mode: Send fail after success
- Table: Computers
- Field: LastContact
- Condition: Less than
- Result: (NOW() - Interval 5 Minutes)
- Identity: Computers.Name
- Target Groups: Machines with Queued Scripts
Group Level Configuration
- Alert Template: ~Autofix - Run Queued Scripts
- State: Enabled
Dependencies
- CWM - Automate - Script - Run Queued Scripts
- CWM - Automate - Script - Queue Script
- CWM - Automate - Solution - Queue Script Next Checkin
- CWM - Automate - Custom Table - plugin_proval_queued_scripts
Target
The suggested target for the monitor will be partially generalized, as group names can vary between Automate systems. Examples:
- 'Machines With Queued Scripts' Group only
Translated SQL
SELECT 
  DISTINCT 'C', 
  computers.computerid, 
  computers.Name AS ComputerName, 
  CONVERT(
    CONCAT(
      clients.name, ' ', locations.name
    ) USING utf8
  ) AS Location, 
  computers.`LastContact` AS TestValue, 
  Computers.Name 
FROM 
  ( 
    computers 
    LEFT JOIN Locations ON Locations.LocationID = computers.Locationid
  ) 
  LEFT JOIN Clients ON Clients.ClientID = Computers.clientid 
  JOIN AgentComputerData ON Computers.ComputerID = AgentComputerData.ComputerID 
WHERE 
  computers.`LastContact` < (NOW() - INTERVAL 5 MINUTE) 
  AND Computers.ComputerID IN (
    SELECT 
      DISTINCT ComputerID 
    FROM 
      Tcomp
  )