Skip to content

Commit

Permalink
Merge pull request #5035 from winem/fix-linux-pack-actions
Browse files Browse the repository at this point in the history
Fix linux pack actions For CentOS 8
  • Loading branch information
cognifloyd authored Apr 2, 2022
2 parents 8219369 + cb4f9bb commit 2a9a3dc
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 10 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,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"
2 changes: 1 addition & 1 deletion contrib/linux/pack.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ keywords:
- open ports
- processes
- ps
version : 1.0.2
version : 1.1.0
python_versions:
- "2"
- "3"
Expand Down

0 comments on commit 2a9a3dc

Please sign in to comment.