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 basic host check #268

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
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
29 changes: 29 additions & 0 deletions priv/catalog/TRNT01.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
id: "TRNT01"
name: A host check
group: Trento
description: |
Trento agent service is enabled and running
remediation: |
## Abstract
If not enabled, trento-agent service will not start automatically after reboots, affecting Trento's functionalities.

To enable the service, run:
```
systemctl enable trento-agent
```

when: env.target_type == "host"

facts:
- name: trento_agent_service_state
gatherer: systemd
argument: trento-agent

values:
- name: expected_trento_agent_service_state
default: active

expectations:
- name: trento_agent_service_state_active
expect: facts.trento_agent_service_state == values.expected_trento_agent_service_state
failure_message: Trento agent service was expected to be active (enabled and running) but returned value is '${facts.trento_agent_service_state}'
11 changes: 10 additions & 1 deletion priv/demo/fake_facts.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -439,4 +439,13 @@ facts:
target3: -1
target4: 0
target5: -1
target6: 0
target6: 0

"TRNT01":
trento_agent_service_state:
target1: active
target2: active
target3: active
target4: active
target5: active
target6: active