Skip to content

Commit

Permalink
Add initial host check
Browse files Browse the repository at this point in the history
  • Loading branch information
nelsonkopliku committed Aug 29, 2023
1 parent dd25dfd commit a777c31
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 1 deletion.
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

0 comments on commit a777c31

Please sign in to comment.