Logo di Cmdb Search Analysis

Cmdb Search Analysis

Organizzazione
Happy-Technologies-LLC
cmdb-search-analysis

Analyze CMDB search requests, interpret natural language CI queries, and provide structured search results with relationships and dependency context

Panoramica

Pubblicato daHappy-Technologies-LLC
Repositoryhappy-platform-skills
Nome della skillcmdb-search-analysis
Stelle
41
Fork
14
File inclusi
Solo istruzioni
LicenzaApache-2.0
Link
  • Istruzioni in Markdown

    Un file SKILL.md che il modello carica quando serve, consumando token solo quando una richiesta è effettivamente pertinente.

  • Funziona con qualsiasi LLM

    Le skill IA sono in semplice Markdown, non in codice specifico di un fornitore, quindi funzionano con GPT, Claude, Gemini, Grok o un modello locale.

  • Tutto nelle istruzioni

    Tutto ciò che serve al modello è nelle istruzioni: nessun file aggiuntivo da sincronizzare.

  • Open source

    Pubblicata da Happy-Technologies-LLC su GitHub. Leggi i sorgenti prima di installarla.

Installazione

Installa la skill IA Cmdb Search Analysis in TypingMind per usarla con qualsiasi LLM, oppure copiala in un altro agente in grado di leggere SKILL.md.

1

Installa in TypingMind

TypingMind installa una skill direttamente dalla sua cartella GitHub: legge SKILL.md, raccoglie i file delle risorse e salva il risultato in locale.

  1. Apri l'app e vai su Plugin → Skill.
  2. Scegli "Installa da GitHub".
  3. Incolla l'URL della cartella della skill riportato qui sotto e conferma.
    https://github.com/Happy-Technologies-LLC/happy-platform-skills/tree/main/skills/cmdb/cmdb-search-analysis
  4. Attiva la skill in ogni chat in cui vuoi averla a disposizione.
Plugin → Skill → Aggiungi skill → Da URL GitHub, poi incolla l'URL della cartella e premi Continua.
2

Installa in un altro agente

Qualsiasi agente che legge il formato Agent Skills può usare questa skill: copia la cartella della skill nella directory delle skill di quell'agente.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/Happy-Technologies-LLC/happy-platform-skills.git /tmp/happy-platform-skills
mkdir -p .claude/skills
cp -r /tmp/happy-platform-skills/skills/cmdb/cmdb-search-analysis .claude/skills/cmdb-search-analysis
Dopo la copia, riavvia Claude Code per caricare la nuova skill.

Usala in TypingMind

Attiva Cmdb Search Analysis in qualsiasi chat di TypingMind e al resto pensa il modello. Il nome e la descrizione della skill sono nel prompt di sistema e, non appena arriva una richiesta pertinente, il modello carica da solo le istruzioni complete: non devi mai richiamarla manualmente e non consuma token finché non viene effettivamente usata.

Il modello carica automaticamente Cmdb Search Analysis non appena riceve una richiesta pertinente.

Funziona con qualsiasi modello IA

Le skill IA sono semplici istruzioni in Markdown, non codice specifico di un fornitore, quindi Cmdb Search Analysis non è vincolata al modello per cui è stata scritta. Installala una sola volta in TypingMind e usala con GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama o un modello locale che esegui tu, sempre con le tue chiavi API.

  • Caricata solo quando serve

    Il prompt di sistema contiene solo il nome e la descrizione. Le istruzioni vengono recuperate alla prima richiesta pertinente, quindi una skill inutilizzata non costa nulla.

  • Cambia modello durante la chat

    Poiché la skill è composta da istruzioni e non da codice, continua a funzionare anche se cambi modello: il nuovo modello legge lo stesso file SKILL.md.

Istruzioni della skill

Questo è il contenuto di SKILL.md che il modello carica. Leggilo prima dell'installazione: una skill è un insieme di istruzioni che il tuo modello seguirà.

CMDB Search and Analysis

Overview

This skill enables intelligent searching and analysis of the Configuration Management Database (CMDB). It covers:

  • Interpreting natural language queries into structured CMDB searches across cmdb_ci and its child tables
  • Performing multi-criteria searches combining name, class, location, environment, and operational status
  • Enriching search results with relationship data from cmdb_rel_ci
  • Identifying related business services via cmdb_ci_service associations
  • Aggregating search results into structured reports with dependency context
  • Discovering CI classes and schema to target the most appropriate table for a query

When to use: When users ask questions like "find all production database servers in the US datacenter," "what CIs are related to the SAP application," or "show me all Linux servers with critical business classification."

Value proposition: Accurate CMDB searches reduce time spent manually navigating the CI hierarchy and ensure that analysts, change managers, and incident responders find the right configuration items quickly.

Prerequisites

  • Roles: itil, cmdb_read, or asset access
  • Access: Read access to cmdb_ci, cmdb_rel_ci, cmdb_ci_service, and child CI tables
  • Knowledge: Understanding of CMDB class hierarchy and relationship types
  • Related skills: cmdb/relationship-mapping for creating relationships, cmdb/ci-discovery for CI creation

Procedure

Step 1: Identify the Target CI Class

Determine which CMDB table to query based on the user's request. The CMDB uses a class hierarchy rooted at cmdb_ci.

Discover available CI classes:

Using MCP (Claude Code/Desktop):

Tool: SN-Discover-Table-Schema
Parameters:
  table_name: cmdb_ci

Using REST API:

bash
GET /api/now/cmdb/meta?sysparm_type=class_hierarchy&sysparm_ci_type=cmdb_ci

Common class mapping for natural language queries:

User SaysTarget TableNotes
"server" or "host"cmdb_ci_serverPhysical and virtual servers
"database"cmdb_ci_db_instanceDatabase instances
"application" or "app"cmdb_ci_applApplication CIs
"network device" or "switch"cmdb_ci_netgearNetwork equipment
"load balancer"cmdb_ci_lbLoad balancers
"storage"cmdb_ci_storage_deviceStorage arrays
"virtual machine" or "VM"cmdb_ci_vm_instanceVirtual machine instances
"container"cmdb_ci_containerContainer instances
"service"cmdb_ci_serviceBusiness services
"cluster"cmdb_ci_clusterServer or application clusters

Step 2: Build the Search Query

Translate the natural language request into a ServiceNow encoded query string.

Using an encoded query:

Tool: SN-Query-Table
Parameters:
  query: environment=production^osLIKELinux^location.nameLIKENew York^business_criticality=1
  table_name: cmdb_ci_server
  limit: 25

Using structured query:

Tool: SN-Query-Table
Parameters:
  table_name: cmdb_ci_server
  query: operational_status=1^os_domainLIKELinux^location.nameLIKENew York^business_criticality=1
  fields: sys_id,name,sys_class_name,ip_address,os,operational_status,environment,business_criticality,location,support_group
  limit: 50
  order_by: name

Using REST API:

bash
GET /api/now/table/cmdb_ci_server?sysparm_query=operational_status=1^os_domainLIKELinux^location.nameLIKENew%20York^business_criticality=1&sysparm_fields=sys_id,name,sys_class_name,ip_address,os,operational_status,environment,business_criticality,location,support_group&sysparm_limit=50&sysparm_display_value=true

Common query operators:

OperatorMeaningExample
=Equalsoperational_status=1
LIKEContainsnameLIKEprod
STARTSWITHStarts withnameSTARTSWITHweb
INIn listsys_idINid1,id2,id3
!=Not equalsenvironment!=development
ISNOTEMPTYHas valueip_addressISNOTEMPTY
^ANDname=x^status=1
^ORORname=x^ORname=y

Step 3: Enrich Results with Relationships

For each CI found, retrieve its relationships to provide dependency context.

Get relationships for a specific CI:

Tool: SN-Query-Table
Parameters:
  table_name: cmdb_rel_ci
  query: parent=[ci_sys_id]^ORchild=[ci_sys_id]
  fields: parent,parent.name,parent.sys_class_name,child,child.name,child.sys_class_name,type.name,type.parent_descriptor,type.child_descriptor
  limit: 50

Using REST API:

bash
GET /api/now/table/cmdb_rel_ci?sysparm_query=parent=[ci_sys_id]^ORchild=[ci_sys_id]&sysparm_fields=parent,parent.name,parent.sys_class_name,child,child.name,child.sys_class_name,type.name,type.parent_descriptor,type.child_descriptor&sysparm_limit=50&sysparm_display_value=true

Batch relationship lookup for multiple CIs:

Tool: SN-Execute-Background-Script
Parameters:
  description: Get relationships for multiple CIs from search results
  script: |
    var ciIds = ['sys_id_1', 'sys_id_2', 'sys_id_3']; // Replace with actual IDs
    var results = [];

    ciIds.forEach(function(ciId) {
      var ci = new GlideRecord('cmdb_ci');
      if (!ci.get(ciId)) return;

      var entry = {
        sys_id: ciId,
        name: ci.name.toString(),
        class: ci.sys_class_name.toString(),
        upstream: [],
        downstream: []
      };

      var rel = new GlideRecord('cmdb_rel_ci');
      rel.addQuery('child', ciId);
      rel.setLimit(20);
      rel.query();
      while (rel.next()) {
        entry.upstream.push({
          name: rel.parent.name.toString(),
          class: rel.parent.sys_class_name.toString(),
          relationship: rel.type.parent_descriptor.toString()
        });
      }

      rel = new GlideRecord('cmdb_rel_ci');
      rel.addQuery('parent', ciId);
      rel.setLimit(20);
      rel.query();
      while (rel.next()) {
        entry.downstream.push({
          name: rel.child.name.toString(),
          class: rel.child.sys_class_name.toString(),
          relationship: rel.type.child_descriptor.toString()
        });
      }

      results.push(entry);
    });

    gs.info(JSON.stringify(results, null, 2));

Step 4: Identify Associated Business Services

Map found CIs to the business services they support.

Using MCP:

Tool: SN-Query-Table
Parameters:
  table_name: service_ci_assoc
  query: ci_id=[ci_sys_id]
  fields: service_id,service_id.name,service_id.operational_status,service_id.business_criticality
  limit: 10

Using REST API:

bash
GET /api/now/table/service_ci_assoc?sysparm_query=ci_id=[ci_sys_id]&sysparm_fields=service_id,service_id.name,service_id.operational_status,service_id.business_criticality&sysparm_limit=10&sysparm_display_value=true

Step 5: Generate Structured Search Report

Compile the search results, relationships, and service context into a comprehensive report.

Using background script for full analysis:

Tool: SN-Execute-Background-Script
Parameters:
  description: Generate structured CMDB search report
  script: |
    var searchQuery = 'nameLIKEprod-web^operational_status=1';
    var targetTable = 'cmdb_ci_server';
    var report = { query: searchQuery, table: targetTable, timestamp: new GlideDateTime().getDisplayValue(), results: [] };

    var gr = new GlideRecord(targetTable);
    gr.addEncodedQuery(searchQuery);
    gr.setLimit(25);
    gr.query();

    while (gr.next()) {
      var ciData = {
        sys_id: gr.sys_id.toString(),
        name: gr.name.toString(),
        class: gr.sys_class_name.toString(),
        ip_address: gr.ip_address ? gr.ip_address.toString() : '',
        environment: gr.environment ? gr.environment.getDisplayValue() : '',
        criticality: gr.business_criticality ? gr.business_criticality.getDisplayValue() : '',
        status: gr.operational_status.getDisplayValue(),
        support_group: gr.support_group ? gr.support_group.getDisplayValue() : '',
        location: gr.location ? gr.location.getDisplayValue() : '',
        relationships: { upstream: 0, downstream: 0 },
        services: []
      };

      var upRel = new GlideAggregate('cmdb_rel_ci');
      upRel.addQuery('child', gr.sys_id);
      upRel.addAggregate('COUNT');
      upRel.query();
      if (upRel.next()) ciData.relationships.upstream = parseInt(upRel.getAggregate('COUNT'));

      var downRel = new GlideAggregate('cmdb_rel_ci');
      downRel.addQuery('parent', gr.sys_id);
      downRel.addAggregate('COUNT');
      downRel.query();
      if (downRel.next()) ciData.relationships.downstream = parseInt(downRel.getAggregate('COUNT'));

      var svcAssoc = new GlideRecord('service_ci_assoc');
      svcAssoc.addQuery('ci_id', gr.sys_id);
      svcAssoc.query();
      while (svcAssoc.next()) {
        ciData.services.push(svcAssoc.service_id.getDisplayValue());
      }

      report.results.push(ciData);
    }

    report.totalFound = report.results.length;
    gs.info(JSON.stringify(report, null, 2));

Step 6: Cross-Class Search

When the user's query spans multiple CI classes, search across the base cmdb_ci table or multiple child tables.

Broad search across all CI types:

Tool: SN-Query-Table
Parameters:
  table_name: cmdb_ci
  query: nameLIKEpayment^operational_status=1
  fields: sys_id,name,sys_class_name,operational_status,environment,business_criticality,support_group
  limit: 50
  order_by: sys_class_name,name

Using REST API:

bash
GET /api/now/table/cmdb_ci?sysparm_query=nameLIKEpayment^operational_status=1&sysparm_fields=sys_id,name,sys_class_name,operational_status,environment,business_criticality,support_group&sysparm_limit=50&sysparm_display_value=true

Tool Usage

MCP Tools Reference

ToolWhen to Use
SN-Natural-Language-SearchTranslate natural language queries into CMDB searches
SN-Query-TableExecute structured queries against CMDB tables
SN-List-CmdbCisConvenience tool for common CI lookups by class
SN-Get-RecordRetrieve a single CI record by sys_id
SN-Discover-Table-SchemaExplore available fields and CI classes
SN-Execute-Background-ScriptComplex multi-table queries with aggregation

REST API Reference

EndpointMethodPurpose
/api/now/table/cmdb_ciGETSearch across all CI types
/api/now/table/cmdb_ci_*GETSearch specific CI class tables
/api/now/table/cmdb_rel_ciGETQuery CI relationships
/api/now/table/cmdb_ci_serviceGETQuery business services
/api/now/cmdb/metaGETRetrieve CMDB class hierarchy metadata

Best Practices

  • Start with the right class: Querying cmdb_ci_server is faster and more precise than searching the base cmdb_ci table when you know the CI type
  • Use display values: Add sysparm_display_value=true to REST calls to get human-readable labels instead of sys_ids
  • Limit result sets: Always set a reasonable limit; CMDB tables can contain millions of records
  • Combine filters: Use multiple criteria (name + environment + status) to narrow results and reduce false matches
  • Validate class hierarchy: Use schema discovery to confirm which fields exist on which CI classes before querying
  • Cache frequent queries: For repeated searches, note the encoded query string for reuse
  • Include relationship context: Raw CI lists are less useful without dependency context; always enrich with relationships when practical
  • Respect operational status: Filter by operational_status=1 (Operational) to exclude retired or decommissioned CIs unless specifically searching for them

Troubleshooting

Search Returns No Results

Symptom: Query returns empty even though the CI is known to exist Cause: Wrong table (CI is a different class), CI name is slightly different, or CI is not operational Solution: Search the base cmdb_ci table with a broad LIKE filter, or remove the operational_status filter to include non-operational CIs

Search Returns Too Many Results

Symptom: Thousands of results returned, difficult to identify the correct CI Cause: Query is too broad (e.g., nameLIKEweb matches hundreds of CIs) Solution: Add environment, location, support group, or class filters to narrow results. Use STARTSWITH instead of LIKE for name matching.

Relationship Data Missing

Symptom: CI shows no relationships but is clearly part of an application stack Cause: Relationships not populated in CMDB; discovery may not have run or manual entries are missing Solution: Check if Service Mapping or Discovery has been configured for this CI. Use cmdb/relationship-mapping to create missing relationships.

Class Not Found

Symptom: Error querying a specific CI class table Cause: The table name is incorrect or the CI class plugin is not installed Solution: Use SN-Discover-Table-Schema on cmdb_ci to list available child classes, or query sys_db_object for tables matching the expected name.

Examples

Example 1: Find All Production Web Servers

# 1. Search for production web servers
Tool: SN-Query-Table
Parameters:
  table_name: cmdb_ci_server
  query: nameLIKEweb^environment=production^operational_status=1
  fields: sys_id,name,ip_address,os,environment,business_criticality,location,support_group
  limit: 50

# 2. Get relationships for top result
Tool: SN-Query-Table
Parameters:
  table_name: cmdb_rel_ci
  query: child=[first_result_sys_id]
  fields: parent.name,parent.sys_class_name,type.parent_descriptor

# 3. Find associated services
Tool: SN-Query-Table
Parameters:
  table_name: service_ci_assoc
  query: ci_id=[first_result_sys_id]
  fields: service_id.name,service_id.business_criticality

Example 2: Natural Language CI Search

User asks: "What database servers support the payroll application?"

# 1. Find the payroll application CI
Tool: SN-Query-Table
Parameters:
  query: nameLIKEpayroll^ORshort_descriptionLIKEpayroll
  table_name: cmdb_ci_appl
  limit: 5

# 2. Find downstream database dependencies
Tool: SN-Query-Table
Parameters:
  table_name: cmdb_rel_ci
  query: parent=[payroll_app_sys_id]^child.sys_class_nameLIKEdb
  fields: child.name,child.sys_class_name,child.ip_address,child.environment,type.child_descriptor

# Result: Lists all database CIs that the payroll application depends on

Example 3: Environment Comparison

User asks: "Compare production and staging servers for the CRM system"

# 1. Find CRM-related servers in production
Tool: SN-Query-Table
Parameters:
  table_name: cmdb_ci_server
  query: nameLIKEcrm^environment=production^operational_status=1
  fields: sys_id,name,ip_address,os,cpu_count,ram,disk_space

# 2. Find CRM-related servers in staging
Tool: SN-Query-Table
Parameters:
  table_name: cmdb_ci_server
  query: nameLIKEcrm^environment=staging^operational_status=1
  fields: sys_id,name,ip_address,os,cpu_count,ram,disk_space

# 3. Compare and report differences in specs, count, and configuration

Related Skills

  • cmdb/relationship-mapping - Creating and validating CI relationships
  • cmdb/ci-discovery - CI creation and classification
  • cmdb/data-quality - Ensuring CMDB data accuracy
  • cmdb/impact-analysis - Analyzing change impact using search results
  • cmdb/service-graph-diagnosis - Troubleshooting Service Graph Connector and discovery
  • admin/schema-discovery - Exploring table schemas and field definitions

Domande frequenti

Cosa fa la skill IA Cmdb Search Analysis?

Analyze CMDB search requests, interpret natural language CI queries, and provide structured search results with relationships and dependency context

Perché usare Cmdb Search Analysis su TypingMind?

Perché la installi una volta e la usi con qualsiasi modello. Cmdb Search Analysis è scritta in semplice Markdown anziché in codice specifico di un fornitore, quindi la stessa skill funziona con GPT-5, Claude, Gemini, Grok o un modello locale, e puoi cambiare modello durante la chat senza che la skill smetta di funzionare. TypingMind usa le tue chiavi API, quindi paghi direttamente i fornitori anziché un abbonamento per posto utente, e le tue skill e chat restano nel tuo spazio di archiviazione.

Come installo Cmdb Search Analysis in TypingMind?

Apri Plugin → Skill → Installa da GitHub in TypingMind e incolla https://github.com/Happy-Technologies-LLC/happy-platform-skills/tree/main/skills/cmdb/cmdb-search-analysis. TypingMind legge il file SKILL.md e installa la skill, che puoi abilitare per ogni singola chat.

Quali modelli IA possono usare Cmdb Search Analysis?

Qualsiasi modello che colleghi a TypingMind. Le skill IA sono semplici istruzioni in Markdown anziché codice specifico di un fornitore, quindi GPT, Claude, Gemini, Grok e i modelli locali possono tutti caricare questa skill quando una richiesta corrisponde al suo scopo.

Quanti modelli IA posso usare con Cmdb Search Analysis?

Quanti ne vuoi. Se un modello supporta le skill, puoi usarlo con Cmdb Search Analysis: GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama e molti altri, tutti su TypingMind con le tue chiavi API.

La skill IA Cmdb Search Analysis è gratuita?

Sì. È pubblicata su GitHub da Happy-Technologies-LLC con licenza Apache-2.0. Paghi solo il tuo fornitore IA per i token che usi.

Cosa sono le skill IA?

Una skill IA è un pacchetto di istruzioni riutilizzabili che insegna a un modello IA come svolgere un'attività specifica. Segue il formato aperto Agent Skills: un file SKILL.md con un nome e una descrizione, più eventuali script, template o file di riferimento di cui il modello potrebbe aver bisogno. Il modello legge le istruzioni solo quando la tua richiesta corrisponde alla skill, quindi una skill installata non comporta costi finché non viene usata.

In cosa si differenziano le skill IA dai plugin o dai server MCP?

Un plugin o un server MCP fornisce a un modello nuovi strumenti da richiamare: codice che viene eseguito da qualche parte e restituisce un risultato. Una skill IA, invece, fornisce al modello conoscenze e procedure: come affrontare un'attività, quali passaggi seguire e quali caratteristiche deve avere un buon output. Le skill sono semplici istruzioni in Markdown, quindi non richiedono server, chiavi API né ambienti di esecuzione e funzionano con qualsiasi modello.

Elenco completo

Crea subito il tuo spazio di lavoro AI

Iscriviti alla nostra newsletter per ricevere aggiornamenti sulle nuove funzionalità e sulle prossime iniziative a premi 👇