Skip to content

Commit

Permalink
PQL: Document queries for catalog state
Browse files Browse the repository at this point in the history
  • Loading branch information
bastelfreak committed Apr 5, 2024
1 parent 04a461f commit 4ffc7ea
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions _docs/pql_queries.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,18 @@ puppet query 'catalogs[certname,producer_timestamp] { producer_timestamp < "202
puppet query 'reports[certname,transaction_uuid,receive_time] { cached_catalog_status="on_failure" and start_time > "2021-10-27T15:36:00-05:00" and end_time < "2021-10-27T16:35:00-05:00" }'
```

### Get all inactive nodes

```shell
puppet query 'nodes[certname] { node_state = "inactive" }'
```

### Get all nodes where the last catalog compilation failed

```shell
puppet query 'nodes[certname] { latest_report_status = "failed" }'
```

### Get a list of nodes with a specific fact value

```shell
Expand All @@ -142,6 +154,14 @@ puppet query 'inventory[certname] {facts.os.name = "AlmaLinux" and facts.os.rele
puppet query 'inventory[certname,facts.virtual]{ resources { type="Class" and title ~ "CapitalizedClassname" }}'
```

### Get all nodes and their Puppet Agent version except for version X

This is helpful if you did a Puppet Upgrade and want to identify all nodes that are on a different version than your primary

```shell
puppet query 'inventory[certname,facts.aio_agent_build]{facts.aio_agent_build != "7.28.0" }'
```

### Get all resources from one type for one node

```shell
Expand Down

0 comments on commit 4ffc7ea

Please sign in to comment.