Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add a windows operational pack to collect cpu, memory and disk usage #168

Merged
merged 1 commit into from
Oct 8, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 52 additions & 0 deletions community/mondoo-windows-operational-inventory.mql.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# Copyright (c) Mondoo, Inc.
# SPDX-License-Identifier: BUSL-1.1

packs:
- uid: mondoo-windows-operational-inventory
name: Windows Client/Server Operational Inventory Pack
version: 1.0.0
license: BUSL-1.1
authors:
- name: Mondoo, Inc
email: [email protected]
tags:
mondoo.com/platform: windows
mondoo.com/category: best-practices
docs:
desc: |-
The Windows Operational Inventory Pack by Mondoo retrieves monitoring data about Windows hosts.

## Local scan
To run this pack locally on a Windows host:

```bash
cnquery scan local -f mondoo-windows-operational-inventory.mql.yaml
```

## Remote execution
To run this pack against a remote Windows host using SSH:

```bash
cnquery scan ssh <user>@<ip_address> -f mondoo-windows-operational-inventory.mql.yaml
```

## Join the community!
Our goal is to build query packs that are simple to deploy and provide accurate and useful data.

If you have any suggestions for improving this query pack, or if you need support, [join the Mondoo community](https://github.com/orgs/mondoohq/discussions) in GitHub Discussions.
filters:
- mql: asset.family.contains("windows")
queries:
- uid: mondoo-windows-operational-inventory-memory-usage
title: Memory usage in %
mql: |
parse.json(content: powershell("Get-Counter '\\Memory\\% Committed Bytes In Use' | ConvertTo-Json -Compress").stdout).params['CounterSamples'] { Path CookedValue }
- uid: mondoo-windows-operational-inventory-cpu-usage
title: CPU usage in %
mql: |
parse.json(content: powershell("Get-Counter '\\Processor(*)\\% Processor Time' | ConvertTo-Json -Compress").stdout).params['CounterSamples'] { Path CookedValue }
- uid: mondoo-windows-operational-inventory-disk-usage
title: Disk usage in %
mql: |
parse.json(content: powershell("Get-Counter '\\LogicalDisk(*)\\% Free Space' | ConvertTo-Json -Compress").stdout).params['CounterSamples'] { Path CookedValue }

Loading