360 Secure SkillHub
360 安全技能中心

Nomad

使用 nomad CLI 以只读方式查询 HashiCorp Nomad 集群,支持查看作业、分配、节点、评估、服务、命名空间与变量,可加 -json 或 -filter 输出,用于集群监控与故障排查,不涉及任何修改操作。

danfedick
danfedick
热度 91.76
最近更新 2026-05-11 15:50:52
分类:开发依赖:代码执行 / 第三方 API应用场景:DevOps

安装技能

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

执行命令安装此 skill: npx secure-skills-cli add nomad
Metadata
name
nomad
version
1.0.0
description
Query HashiCorp Nomad clusters. List jobs, nodes, allocations, evaluations, and services. Read-only operations for monitoring and troubleshooting.
homepage
https://github.com/danfedick/nomad-skill
metadata
{"clawdbot":{"emoji":"📦","requires":{"bins":["nomad"]}}}

Nomad Skill

Query HashiCorp Nomad clusters using the nomad CLI. Read-only operations for monitoring and troubleshooting.

Requirements

  • nomad CLI installed
  • NOMAD_ADDR environment variable set (or defaults to http://127.0.0.1:4646)
  • NOMAD_TOKEN if ACLs are enabled

Commands

Jobs

List all jobs:

nomad job status

Get job details:

nomad job status <job-id>

Job history:

nomad job history <job-id>

Job deployments:

nomad job deployments <job-id>

Allocations

List allocations for a job:

nomad job allocs <job-id>

Allocation details:

nomad alloc status <alloc-id>

Allocation logs (stdout):

nomad alloc logs <alloc-id>

Allocation logs (stderr):

nomad alloc logs -stderr <alloc-id>

Follow logs:

nomad alloc logs -f <alloc-id>

Nodes

List all nodes:

nomad node status

Node details:

nomad node status <node-id>

Node allocations:

nomad node status -allocs <node-id>

Evaluations

List recent evaluations:

nomad eval list

Evaluation details:

nomad eval status <eval-id>

Services

List services (Nomad native service discovery):

nomad service list

Service info:

nomad service info <service-name>

Namespaces

List namespaces:

nomad namespace list

Variables

List variables:

nomad var list

Get variable:

nomad var get <path>

Cluster

Server members:

nomad server members

Agent info:

nomad agent-info

JSON Output

Add -json to most commands for JSON output:

nomad job status -json
nomad node status -json
nomad alloc status -json <alloc-id>

Filtering

Use -filter for expression-based filtering:

nomad job status -filter='Status == "running"'
nomad node status -filter='Status == "ready"'

Common Patterns

Find failed allocations

nomad job allocs <job-id> | grep -i failed

Get logs from latest allocation

nomad alloc logs $(nomad job allocs -json <job-id> | jq -r '.[0].ID')

Check cluster health

nomad server members
nomad node status

Environment Variables

  • NOMAD_ADDR — Nomad API address (default: http://127.0.0.1:4646)
  • NOMAD_TOKEN — ACL token for authentication
  • NOMAD_NAMESPACE — Default namespace
  • NOMAD_REGION — Default region
  • NOMAD_CACERT — Path to CA cert for TLS
  • NOMAD_CLIENT_CERT — Path to client cert for TLS
  • NOMAD_CLIENT_KEY — Path to client key for TLS

Notes

  • This skill is read-only. No job submissions, stops, or modifications.
  • Use nomad-tui for interactive cluster management.
  • For job deployment, use nomad job run <file.nomad.hcl> directly.