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

Fix linux pack actions For CentOS 8 #5035

Merged
merged 17 commits into from
Apr 2, 2022
Merged
Show file tree
Hide file tree
Changes from 15 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
4 changes: 4 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,10 @@ Fixed

* Fix ``st2-self-check`` script reporting falsey success when the nested workflows runs failed. #5487

* Fix actions from the contrib/linux pack that fail on CentOS-8 but work on other operating systems and distributions. (bug fix) #4999 #5004

Reported by @blag and @dove-young contributed by @winem.

* Use byte type lock name which is supported by all tooz drivers. #5529

Contributed by @khushboobhatia01
Expand Down
3 changes: 2 additions & 1 deletion contrib/linux/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,4 +55,5 @@ Example trigger payload:

## Troubleshooting

* On CentOS7/RHEL7, dig is not installed by default. Run ``sudo yum install bind-utils`` to install.
* On CentOS7/RHEL7, dig is not installed by default. Run ``sudo yum install bind-utils`` to install.
* On CentOS8/RHEL8, lsof is not installed by default. Run ``sudo yum install lsof`` to install.
2 changes: 1 addition & 1 deletion contrib/linux/actions/checks/check_loadavg.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/opt/stackstorm/st2/bin/python

# Copyright 2020 The StackStorm Authors.
# Copyright 2019 Extreme Networks, Inc.
Expand Down
2 changes: 1 addition & 1 deletion contrib/linux/actions/checks/check_processes.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/opt/stackstorm/st2/bin/python

# Copyright 2020 The StackStorm Authors.
# Copyright 2019 Extreme Networks, Inc.
Expand Down
2 changes: 1 addition & 1 deletion contrib/linux/actions/service.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/opt/stackstorm/st2/bin/python

# Copyright 2020 The StackStorm Authors.
# Copyright 2019 Extreme Networks, Inc.
Expand Down
14 changes: 9 additions & 5 deletions contrib/linux/actions/workflows/diag_loadavg.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
hosts: "{{hostname}}"
period: "all"
on-success: "d_state_processes"
on-failure: "email_escalation"
-
name: "d_state_processes"
ref: "linux.check_processes"
Expand All @@ -17,7 +16,6 @@
criteria: "D"
args: "pidlist"
on-success: "r_state_processes"
on-failure: "email_escalation"
-
name: "r_state_processes"
ref: "linux.check_processes"
Expand All @@ -27,15 +25,13 @@
criteria: "R"
args: "pidlist"
on-success: "netstat"
on-failure: "email_escalation"
-
name: "netstat"
ref: "linux.netstat_grep"
parameters:
hosts: "{{hostname}}"
pids: "{{d_state_processes[hostname].stderr}} {{r_state_processes[hostname].stderr}}"
on-success: "lsof"
on-failure: "email_escalation"
-
name: "lsof"
ref: "linux.lsof_pids"
Expand All @@ -47,5 +43,13 @@
name: "dump_results"
ref: "core.local"
parameters:
cmd: "echo \"ST2 Workflow\tdiag_loadavg:\t{{__results}}\" >> /tmp/diag_loadavg && echo 'Output written to file /tmp/diag_loadavg'"
cmd: >
echo "{{__results}}"
| python3 -c
'import ast, datetime, json, sys;
diag_data=ast.literal_eval(sys.stdin.read());
diag_data["timestamp"] = str(datetime.datetime.now());
print(json.dumps(diag_data))'
>> /tmp/diag_loadavg.json
&& echo 'Output written to file /tmp/diag_loadavg.json'
default: "check_load"