Skip to content

Instantly share code, notes, and snippets.

@sidkrishna sidkrishna/execution_get Secret
Created Oct 20, 2016

Embed
What would you like to do?
Files for StackStorm + Splunk blog
brocade@bwc-2:~$ st2 execution get 57fcd76500483912504332d6
id: 57fcd76500483912504332d6
action.ref: st2-demos.link_flap_remediation
parameters:
host: 10.254.4.118
interface: TenGigabitEthernet 102/0/48
status: succeeded (24s elapsed)
start_timestamp: 2016-10-11T12:13:25.152697Z
end_timestamp: 2016-10-11T12:13:49.681257Z
+--------------------------+------------------------+-------------------------------+------------------------+-------------------------------+
| id | status | task | action | start_timestamp |
+--------------------------+------------------------+-------------------------------+------------------------+-------------------------------+
| 57fcd765004839121e5d8927 | succeeded (0s elapsed) | notify_on_slack | chatops.post_message | Tue, 11 Oct 2016 12:13:25 UTC |
| 57fcd766004839121e5d8929 | succeeded (5s elapsed) | show_run_interface | clicrud.ops_command | Tue, 11 Oct 2016 12:13:26 UTC |
| 57fcd76b004839121e5d892c | succeeded (1s elapsed) | send_show_run_interface_to_sl | chatops.post_message | Tue, 11 Oct 2016 12:13:31 UTC |
| | | ack | | |
| 57fcd76c004839121e5d892e | succeeded (1s elapsed) | bring_up_msg_to_slack | chatops.post_message | Tue, 11 Oct 2016 12:13:32 UTC |
| 57fcd76e004839121e5d8931 | succeeded (6s elapsed) | bring_up_link | clicrud.config_command | Tue, 11 Oct 2016 12:13:34 UTC |
| 57fcd775004839121e5d8933 | succeeded (4s elapsed) | show_interface_detail | clicrud.ops_command | Tue, 11 Oct 2016 12:13:41 UTC |
| 57fcd779004839121e5d8936 | succeeded (0s elapsed) | send_interface_details_to_sla | chatops.post_message | Tue, 11 Oct 2016 12:13:45 UTC |
| | | ck | | |
| 57fcd77a004839121e5d8938 | succeeded (3s elapsed) | create_zendesk_tkt | zendesk.create_ticket | Tue, 11 Oct 2016 12:13:46 UTC |
+--------------------------+------------------------+-------------------------------+------------------------+-------------------------------+
brocade@bwc-2:~$ st2 rule-enforcement get 57fcd76500483912504332d7
+---------------------+-----------------------------------------+
| Property | Value |
+---------------------+-----------------------------------------+
| id | 57fcd76500483912504332d7 |
| rule.ref | st2-demos.splunk_link_flap_webhook_rule |
| trigger_instance_id | 57fcd76500483912504332d3 |
| execution_id | 57fcd76500483912504332d6 |
| failure_reason | |
| enforced_at | 2016-10-11T12:13:25.126358Z |
+---------------------+-----------------------------------------+
brocade@bwc-2:~$ st2 rule get st2-demos.splunk_link_flap_webhook_rule
+-------------+------------------------------------------------------------+
| Property | Value |
+-------------+------------------------------------------------------------+
| id | 57f66fcb0048394cfa1d955a |
| uid | rule:st2-demos:splunk_link_flap_webhook_rule |
| ref | st2-demos.splunk_link_flap_webhook_rule |
| pack | st2-demos |
| name | splunk_link_flap_webhook_rule |
| description | Splunk link flap webhook rule |
| enabled | True |
| action | { |
| | "ref": "st2-demos.link_flap_remediation", |
| | "parameters": { |
| | "interface": "{{trigger.body.result.interface}}", |
| | "host": "{{trigger.body.result.host}}" |
| | } |
| | } |
| criteria | |
| tags | |
| trigger | { |
| | "type": "core.st2.webhook", |
| | "ref": "core.70b0b76b-5edf-47d8-bb03-19528c4fe1d2", |
| | "parameters": { |
| | "url": "splunk_link_flap" |
| | } |
| | } |
| type | { |
| | "ref": "standard", |
| | "parameters": {} |
| | } |
+-------------+------------------------------------------------------------+
brocade@bwc-2:~$ st2 rule list --pack=st2-demos
+-----------------------------------------+-----------+--------------------------------+---------+
| ref | pack | description | enabled |
+-----------------------------------------+-----------+--------------------------------+---------+
| st2-demos.splunk_bgp_down_webhook_rule | st2-demos | Splunk bgp down webhook rule | True |
| st2-demos.splunk_link_flap_webhook_rule | st2-demos | Splunk link flap webhook rule | True |
| st2-demos.splunk_webhook_rule | st2-demos | splunk to chatops webhook Rule | True |
+-----------------------------------------+-----------+--------------------------------+---------+
brocade@bwc-2:~$ st2 trigger-instance get 57fcd76500483912504332d3
+-----------------+--------------------------------------------------------------+
| Property | Value |
+-----------------+--------------------------------------------------------------+
| id | 57fcd76500483912504332d3 |
| trigger | core.70b0b76b-5edf-47d8-bb03-19528c4fe1d2 |
| occurrence_time | 2016-10-11T12:13:25.078000Z |
| payload | { |
| | "body": { |
| | "results_link": "http://Splunk:8000/app/search/searc |
| | h?q=%7Cloadjob%20rt_scheduler__admin__search__testt_at_14757 |
| | 23889_25.32%20%7C%20head%201%20%7C%20tail%201&earliest=0&lat |
| | est=now", |
| | "app": "search", |
| | "search_name": "testt", |
| | "result": { |
| | "_si": "", |
| | "_confstr": |
| | "source::udp:514|host::10.254.4.118|syslog", |
| | "_raw": "Oct 11 05:13:24 10.254.4.118 Oct 11 |
| | 12:13:16 LEAF2 raslogd: [log@1588 |
| | value="RASLOG"][timestamp@1588 |
| | value="2016-10-11T12:13:16.980022"][msgid@1588 |
| | value="NSM-1003"][seqnum@1588 value="48201"][attr@1588 |
| | value=" SW/0 | Active | DCE | WWN |
| | 10:00:00:27:f8:c7:42:e9"][severity@1588 |
| | value="INFO"][swname@1588 value="LEAF2"][arg0@1588 |
| | value="TenGigabitEthernet 102/0/48" desc="InterfaceName"] |
| | BOM Interface TenGigabitEthernet 102/0/48 is link down. ", |
| | "_time": "1476188004", |
| | "host": "10.254.4.118", |
| | "_sourcetype": "syslog", |
| | "syslog_text": "Interface TenGigabitEthernet |
| | 102/0/48 is link down.", |
| | "_kv": "1", |
| | "interface": "TenGigabitEthernet 102/0/48", |
| | "_indextime": "1476188004", |
| | "_serial": "33" |
| | }, |
| | "sid": |
| | "rt_scheduler__admin__search__testt_at_1475723889_25.32", |
| | "owner": "admin" |
| | }, |
| | "headers": { |
| | "X-Request-Id": "10e3026f-9586-464b- |
| | aae2-a0984fa290f1", |
| | "Accept-Encoding": "identity", |
| | "X-Forwarded-For": "10.254.3.40", |
| | "Content-Length": "1101", |
| | "User-Agent": "Splunk/D54F2F0C- |
| | CD71-490F-9050-7A6C8E09328B", |
| | "Host": "bwc,bwc", |
| | "X-Real-Ip": "10.254.3.40", |
| | "Content-Type": "application/json" |
| | } |
| | } |
| status | processed |
+-----------------+--------------------------------------------------------------+
LEAF2# show logging raslog reverse count 10
NOS: 7.0.1
2016/10/11-12:13:31, [NSM-1019], 48207, SW/0 | Active | DCE, INFO, LEAF2, Interface TenGigabitEthernet 102/0/48 is administratively up.
2016/10/11-12:13:27, [SEC-1203], 48206, SW/0 | Active, INFO, LEAF2, Login information: Login successful via TELNET/SSH/RSH. IP Addr: 10.254.2.86.
2016/10/11-12:13:27, [SEC-1206], 48205, SW/0 | Active, INFO, LEAF2, Login information: User [admin] Last Successful Login Time : Tue Oct 11 12:13:20 2016.
2016/10/11-12:13:23, [SEC-3022], 48204, SW/0 | Active, INFO, LEAF2, Event: logout, Status: success, Info: Successful logout by user [admin].
2016/10/11-12:13:20, [SEC-1203], 48203, SW/0 | Active, INFO, LEAF2, Login information: Login successful via TELNET/SSH/RSH. IP Addr: 10.254.2.86.
2016/10/11-12:13:20, [SEC-1206], 48202, SW/0 | Active, INFO, LEAF2, Login information: User [admin] Last Successful Login Time : Tue Oct 11 12:12:23 2016.
2016/10/11-12:13:16, [NSM-1003], 48201, SW/0 | Active | DCE, INFO, LEAF2, Interface TenGigabitEthernet 102/0/48 is link down.
2016/10/11-12:13:16, [NSM-1020], 48200, SW/0 | Active | DCE, INFO, LEAF2, Interface TenGigabitEthernet 102/0/48 is administratively down.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.