St2: how to run linux.netstat action with arguments

Created on 13 May 2020  路  1Comment  路  Source: StackStorm/st2

PLEASE READ: If you are a paid Extreme Workflow (EWC) customer, please contant Extreme
Network GTAC

or send an email to [email protected]

For free community support, please use out forum at https://forum.stackstorm.com

I try to run linux.netstat action with args, but result are error as follow.

$ st2 run linux.netstat hosts=172.31.114.68 args="-antp"
ERROR: 'type'

bug

Most helpful comment

looks like type attribute is missing for netstat action. I hope #4947 will fix that permanently.

In the meantime, you can add the type attribute and re-register the Linux pack and that should fix the issue.
update /opt/stackstorm/packs/linux/actions/netstat.yaml to

---
  name: "netstat"
  runner_type: "remote-shell-cmd"
  description: "Run netstat"
  enabled: true
  entry_point: ""
  parameters:
    cmd:
      immutable: true
      default: "netstat {{args}}"
    args:
      description: "Command line arguments"
      default: " "
      type: "string"

and re-register the Linux pack using the following command

st2 pack register linux

This should resolve the issue for you.

>All comments

looks like type attribute is missing for netstat action. I hope #4947 will fix that permanently.

In the meantime, you can add the type attribute and re-register the Linux pack and that should fix the issue.
update /opt/stackstorm/packs/linux/actions/netstat.yaml to

---
  name: "netstat"
  runner_type: "remote-shell-cmd"
  description: "Run netstat"
  enabled: true
  entry_point: ""
  parameters:
    cmd:
      immutable: true
      default: "netstat {{args}}"
    args:
      description: "Command line arguments"
      default: " "
      type: "string"

and re-register the Linux pack using the following command

st2 pack register linux

This should resolve the issue for you.

Was this page helpful?
0 / 5 - 0 ratings