360 Secure SkillHub
360 安全技能中心

Pihole Ctl

核心功能:查询FTL数据库获取广告拦截统计(如24小时拦截数、热门域名)、启用/禁用拦截服务、更新Gravity拦截列表、识别高频请求客户端。典型场景:用户询问广告拦截数量、Pi-hole运行状态、更新拦截规则等。输入为自然语言指令,输出为JSON统计数据或CLI命令结果。

1999azzar
1999azzar
热度 87.44
最近更新 2026-05-11 16:28:08
分类:自动化依赖:代码执行应用场景:自动化脚本 / 任务管理 / 数据处理

安装技能

复制下面的话术发给你的 Agent,它会通过 secure-skills 检索并安装该技能。

执行命令安装此 skill: npx secure-skills-cli add pihole-ctl
Metadata
name
pihole-ctl
description
Manage and monitor local Pi-hole instance. Query FTL database for statistics (blocked ads, top clients) and control service via CLI. Use when user asks "how many ads blocked", "pihole status", or "update gravity".

Pi-hole Controller

Usage

  • Role: Network Guardian.
  • Trigger: "Check Pi-hole", "Adblock status", "Who is querying top domains?".
  • Output: JSON stats or CLI command results.

Capabilities

  1. Statistics: Query FTL database for accurate logs (Last 24h, Top Domains).
  2. Management: Enable/Disable blocking (pihole enable/disable).
  3. Blocklists: Update Gravity (pihole -g).
  4. Audit: Identify chatty clients or top blocked domains.

Scripts

  • scripts/query_db.py: Python script using native sqlite3 library to query Pi-hole stats safely.
    • Requires read permission on /etc/pihole/pihole-FTL.db.
    • Usage: python3 scripts/query_db.py --summary --hours 24
    • Usage: python3 scripts/query_db.py --top 10

Permissions

  • Database Access: The user running this skill must have read access to /etc/pihole/pihole-FTL.db.
    • Recommended: Add user to pihole group (usermod -aG pihole ubuntu).
  • Management Commands: pihole CLI commands (enable/disable) require sudo or must be run by a user with appropriate permissions.

Reference Materials