Automation Philosophy
- Alert before action - notify humans, don't auto-change data
- Weekly cadence - most checks run weekly, not daily
- Clear messages - tell people exactly what to fix
- Easy setup - each automation takes 5-10 minutes to configure
Automation 1: Weekly Ownership Check
Ownership Alert
Alert when production assets don't have an owner assigned.
Query - Servers without owners:
objectType = "Server"
AND Environment = "Production"
AND "Managed By" IS EMPTY
AND Status = "Operational"
Query - Applications without owners:
objectType = "Application"
AND Environment = "Production"
AND "Managed By" IS EMPTY
AND Status = "Operational"
Email Template:
Subject: [CMDB] Weekly Ownership Review - Action Required
Hi,
The following production assets need owners assigned:
SERVERS WITHOUT OWNERS:
{{#each unowned_servers}}
- {{Hostname}} ({{Server Type}}, {{Environment}})
{{/each}}
APPLICATIONS WITHOUT OWNERS:
{{#each unowned_apps}}
- {{Application Name}} ({{Environment}})
{{/each}}
Please assign owners to these assets this week.
Best,
CMDB Automation
Automation 2: Inactive Owner Detection
Inactive Owner Alert
Find assets owned by people who are no longer active.
Step 1: Find inactive people
objectType = "Person" AND Active = "Inactive"
Step 2: For each inactive person, find their assets
objectType = "Server" AND "Managed By" = "{{person_key}}"
objectType = "Application" AND "Managed By" = "{{person_key}}"
Email Template:
Subject: [CMDB] Assets Owned by Inactive People - Reassignment Needed
Hi,
The following assets are owned by people marked as Inactive:
{{#each inactive_owners}}
OWNER: {{Name}} ({{Email}}) - Status: Inactive
Servers:
{{#each servers}}
- {{Hostname}}
{{/each}}
Applications:
{{#each applications}}
- {{Application Name}}
{{/each}}
---
{{/each}}
Please reassign these assets to active team members.
Best,
CMDB Automation
Automation 3: Orphaned Application Check
Application Without Server
Find applications that aren't linked to any server.
Query:
objectType = "Application"
AND "Runs On" IS EMPTY
AND Status = "Operational"
Why This Matters:
- Can't be included in impact analysis
- Won't appear in server dependency views
- May indicate outdated or unused apps
Automation 4: Stale Server Detection
Stale Server Alert
Find servers that haven't been updated in 90+ days.
Query:
objectType = "Server"
AND Status = "Operational"
AND updated < now(-90d)
Recommended Actions:
- Verify server still exists (ping, console access)
- If exists: Update any changed attributes
- If decommissioned: Change Status to "Non-Operational"
- If unknown: Contact the owner
Automation 5: Person Deactivation Alert
Person Status Change Workflow
Alert when a person is marked inactive, prompting asset reassignment.
Trigger:
Object updated - Person - Active changed to "Inactive"
Email Template:
Subject: [URGENT] Person Deactivated - Asset Reassignment Required
Hi,
{{Person.Name}} has been marked as Inactive.
They currently own the following assets that need reassignment:
SERVERS ({{server_count}}):
{{#each servers}}
- {{Hostname}} ({{Environment}})
{{/each}}
APPLICATIONS ({{app_count}}):
{{#each applications}}
- {{Application Name}} ({{Environment}})
{{/each}}
Please reassign these assets to new owners as soon as possible.
Best,
CMDB Automation
Automation 6: Server Status Change Notification
Server Status Change Impact
Notify application owners when their server's status changes.
Trigger:
Object updated - Server - Status changed
Step 1: Find affected applications
objectType = "Application" AND "Runs On" = "{{updated_server_key}}"
Conditional Messages:
| New Status | Message |
|---|---|
| Maintenance | "Applications may be temporarily unavailable" |
| Non-Operational | "Please migrate applications to a new server" |
| Operational | "Server is now operational" |
Automation 7: Weekly Quality Report
Weekly Data Quality Summary
Send a weekly summary of CMDB health metrics.
Metrics to Calculate:
-- Total Records
objectType = "Person" -- Count
objectType = "Server" -- Count
objectType = "Application" -- Count
-- Servers with owners
objectType = "Server" AND Environment = "Production" AND "Managed By" IS NOT EMPTY
-- Apps with servers
objectType = "Application" AND "Runs On" IS NOT EMPTY AND Status = "Operational"
Score Calculation:
Score =
(owned_prod_servers / total_prod_servers * 25) +
(linked_apps / total_apps * 25) +
(stale_count == 0 ? 25 : max(0, 25 - stale_count * 2)) +
(inactive_owners_with_assets == 0 ? 25 : 0)
Automation Schedule Summary
Weekly Automations (Mondays)
| Automation | Time | Priority |
|---|---|---|
| Ownership Alert | 9:00 AM | High |
| Inactive Owner Detection | 9:05 AM | High |
| Orphaned Application Check | 9:10 AM | Medium |
Monthly Automations (First Monday)
| Automation | Time | Priority |
|---|---|---|
| Stale Server Detection | 9:00 AM | Medium |
Real-Time Automations
| Automation | Trigger | Priority |
|---|---|---|
| Person Deactivation | Active → Inactive | High |
| Server Status Change | Status changed | Medium |
Implementation Guide
Step-by-Step: Creating Your First Automation
- Navigate to Automation - Go to Project Settings → Automation → Create rule
- Set the Trigger - For scheduled: Choose "Scheduled" → Set day/time
- Add AQL Query - Add action "AQL search" → Paste the query
- Configure Email Action - Add action "Send email" → Set recipients → Paste template
- Test and Enable - Use "Run rule" to test → Verify email → Enable the rule
Common AQL Patterns
| Pattern | Query |
|---|---|
| Operational production | Environment = "Production" AND Status = "Operational" |
| Missing relationship | "Relationship Name" IS EMPTY |
| Stale records | updated < now(-90d) |
| Specific status | Status = "Operational" |
| Exclude certain | Status != "Non-Operational" |
Troubleshooting
| Issue | Cause | Solution |
|---|---|---|
| No email received | Query returns no results | Test query in Assets first |
| Too many emails | Query too broad | Add filters (Environment, Status) |
| Wrong recipients | Email misconfigured | Check recipient field |
| Automation not running | Disabled or schedule wrong | Check rule status and trigger |
Schema Forge