Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

osquery

БесплатноБез исполняемых скриптовНе проверен

System diagnostics using osquery. Use when asked about CPU usage, memory consumption, network connections, running processes, disk I/O, fan speeds…

kousenот kousen★ 15 звёзд на GitHub8 установок в других каталогах

Об этом скилле

Osquery System Diagnostics Skill

Use osquery to answer system diagnostic questions through natural language.

How to Execute Queries

Run osquery with JSON output for structured data:

osqueryi --json "YOUR SQL QUERY HERE"

Important: Always use --json flag for parseable output.

Quick Reference: Common Diagnostics

User Question Use This Query
"Why is my computer slow?" High CPU or High Memory query
"What's using all my RAM?" High Memory query
"What's using my network?" Network Connections query
"Is my fan running hot?" Temperature Info query
"Is my system compromised?" Suspicious Processes query
"What's causing disk slowdown?" High Disk I/O query
"Give me a system overview" System Health Summary

Advanced Queries (see Advanced Scenarios section)

User Question Use This Query
"What files changed recently?" File Integrity / file table
"Verify this file's hash" Hash Verification query
"Show my browser extensions" Browser and Application Data
"What runs at startup?" Startup Items and Persistence
"Show Docker containers" Container queries
"What apps are installed?" Applications query

Predefined Queries

See queries.md for complete SQL templates with explanations.

Interpreting Results

CPU Usage

  • cpu_percent > 50% for a single process is high
  • System processes like kernel_task, WindowServer are normal consumers
  • Browser processes (Google Chrome Helper) often top the list - normal

Memory Usage

  • resident_mb > 1000 (1GB) is significant
  • Compare to total system RAM (check with SELECT physical_memory FROM system_info)
  • Multiple instances of same app (e.g., Chrome tabs) add up

Network Connections

  • ESTABLISHED = active connection
  • LISTEN = waiting for connections (servers)
  • Unexpected connections to unknown IPs warrant investigation

Temperature (macOS)

  • CPU temps under 80C are normal under load
  • Above 90C sustained indicates cooling issues
  • Fan speeds increase automatically with temperature

Suspicious Processes

Flagged processes aren't necessarily malware. Common false positives:

  • "No parent process": Daemons that outlive their parent are normal
  • "Running from temp": Installers and updaters often run from /tmp
  • Investigate further with: SELECT * FROM processes WHERE pid = <pid>

Platform Notes

macOS-specific tables:

  • temperature_sensors, fan_speed_sensors - Only on macOS
  • launchd - macOS service manager

Linux alternatives:

  • Use /proc filesystem tables
  • systemd_units instead of launchd

Error Handling

If you see "no such table", the table may not exist on this platform:

# List available tables
osqueryi --json "SELECT name FROM osquery_registry WHERE active = 1"

Follow-up Suggestions

After showing results, consider suggesting:

  • "Would you like me to investigate any specific process?"
  • "Should I check what files this process has open?"
  • "Want me to look at the network activity for this process?"

Advanced Scenarios

For security investigations and specialized queries beyond the common diagnostics above, osquery offers powerful capabilities documented at https://osquery.readthedocs.io/en/stable/

File Integrity Monitoring

Triggers: "file changes", "modified files", "file monitoring", "who changed this file"

Track file modifications in real-time (requires osqueryd daemon, not just osqueryi):

  • macOS: file_events table (FSEvents-based)
  • Linux: file_events (inotify) or process_file_events (Audit)
  • Windows: ntfs_journal_events (NTFS Journal)
-- Check recently modified files in a directory (point-in-time, works with osqueryi)
SELECT path, mtime, size, uid FROM file
WHERE path LIKE '/etc/%' AND mtime > (strftime('%s', 'now') - 3600)

Documentation: https://osquery.readthedocs.io/en/stable/deployment/file-integrity-monitoring/

Hash Verification

Triggers: "file hash", "verify file", "checksum", "file integrity"

-- Get hashes for a specific file
SELECT path, md5, sha1, sha256 FROM hash WHERE path = '/usr/bin/ssh';

-- Check hashes of all files in a directory
SELECT path, sha256 FROM hash WHERE directory = '/usr/local/bin'

Advanced SQL Functions

Osquery extends SQLite with useful functions:

Function Purpose Example
regex_match(pattern, string, index) Pattern matching WHERE regex_match('^192\.168\.', remote_address, 0) IS NOT NULL
in_cidr_block(ip, cidr) IP range checking `WHERE in_cidr_block(remote_add
Полный SKILL.md на GitHub

Установить osquery в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Bash

Вложенные файлы

queries.md

FAQ

Что делает скилл osquery?

System diagnostics using osquery. Use when asked about CPU usage, memory consumption, network connections, running processes, disk I/O, fan speeds, temperatures, or system security. Triggers: "why is my computer slow", "what's using memory", "what's using CPU", "network connections", "suspicious processes", "system health", "fan running", "overheating", "disk activity", "what processes are running", "file changes", "browser extensions", "Docker containers", "startup programs", "file hash", "installed apps", "what runs at boot".

Как установить скилл osquery?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл osquery запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить osquery с