How to check a receive response from server in artillery ws - yaml

In my yml file, unable to check the receive response from ws server and how i print that.
Would you please help me to out from this problem. is it available ? to check the receive response from web socket server in artillery.
capture:
json: "$.fooBody"
as: "fooBody"
#- log: "{{statusCode}} => {{ fooBody }}"
- log: "data: {{ fooBody }}"
In above script i used but not works for me.
I want to check the received data from server and send the same data to server.
after run the artillery file it shows the
data : undefine

Related

why is the ansible sros_command module responding with an error from a role, but works independently

I am attempting to send a command to an SROS device using an ansible role. The task itself is:
- name: invoke the sros cli
sros_command:
commands: ["{{item.input}}"]
register: sros_command_result
This command is being run inside a loop of several commands. I know that the module will allow you to send multiple commands at once, but I need to do additional processing on each command so its simpler to handle them individually. I've verified that item.input is correct, and the notation is sending the command as a list which is what the module wants for input.
In the case I am testing the command itself is show chassis.
I have verified that I am connected to the device, and an independent debug run of the module only generates the correct response from the device.
When I run this via my role though, it response with: "Unable to decode JSON from response to exec_command('{\"command\": \"show chassis\", \"prompt\": null, \"answer\": null}'). Received 'None'."
Im very lost. I do not know why this error is appearing (other than the device not sending a response), nor can I figure out any way to debug this.

double check the payload being sent includes the keys Slack expects

I am trying to upload file from github actions to slack, I got the following error
"no custom payload was passed in, using default payload that triggered the GitHub Action
axios post failed, double check the payload being sent includes the keys Slack expects
Error: no_text
Error: Request failed with status code 400"
The following is what I entered in .yml file
- name: Send GitHub trigger payload to Slack Workflow Builder
id: slack
uses: slackapi/slack-github-action#v1.21.0
with:
payload-file-path: "./stats.json"
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
could you let me know what am I missing?

Can you change the interim message of Ansible's until retries loop?

In one of my playbooks I start a service and poll for its status before moving onto the next task like the following:
- name: Poll for service status
uri:
url: http://some-service/status
register: response
until: response.status == 200
retries: 12
delay: 10
This logs a message each time it queries the URL which looks like
FAILED - RETRYING: TASK: Poll for service status
Is there a way to customise this message? Specifically remove the word FAILED.
After grepping around, I found the "FAILED - RETRYING" message in the default output callback (read about callbacks here). That means you can change the callback in ansible.cfg to something that suits your needs- or make your own. You can even search the code for v2_runner_retry to see the various outputs.
For instance, here's what stdout_callback=oneline returns. There are no "retrying" messages even at -vv. It still says "FAILED" but that's because it actually failed.
ansible-playbook -vvi localhost, p.yml
ansible-playbook 2.4.1.0
config file = /opt/app/ansible.cfg
configured module search path = ['/opt/app/library']
ansible python module location = /usr/local/lib/python3.5/dist-packages/ansible
executable location = /usr/local/bin/ansible-playbook
python version = 3.5.2 (default, Sep 14 2017, 22:51:06) [GCC 5.4.0 20160609]
Using /opt/app/ansible.cfg as config file
1 plays in p.yml
META: ran handlers
localhost | FAILED! => {"attempts": 3,"changed": false,"content": "","failed": true,"msg": "Status code was not [200]: Request failed: <urlopen error [Errno -2] Name or service not known>","redirected": false,"status": -1,"url": "http://some-service/status"}
Aside from setting it in ansible.cfg the documentation implies it can be done in a role. I have no idea how.
As #techraf said, the Ansible folks are pretty good at reviewing pull requests.

How to read grpc command line tool error messages from the responses?

I am using the grpc command line tool to test response for my grpc request. This is the official link to the grpc command line tool: https://github.com/grpc/grpc/blob/master/doc/command_line_tool.md (The usage guide is not updated. Kindly read ~/workspace/src/github.com/grpc/bins/opt/grpc_cli help)
I am running the command from the location where my protocol file resides. I am sending a request like this, (FYI: I am also sending the metadata. Irrespective of inclusion of the metadata or not I am getting the same error message) :
$ ~/my_workspace/src/github.com/grpc/bins/opt/grpc_cli call 0.0.0.0:50051 \
MyGrpcMethod <name_of_my_proto_file.proto> "abc : '12-34-56-78', xyz: '1234'" \
--metadata "auth:<auth_token>:space:xxx:org:xxx" --enable_ssl=false
In the response I am getting it says that there are some errors however, it does not show what the errors are. Here is the response I got from my client request:
connecting to 0.0.0.0:50051
Failed to read response.
Rpc failed with status code 12 error message unknown service my_agent.MyServiceAPI
Right now, I am not able to figure out from the documentation or otherwise on how to read the response. Did anyone face an issue like this?

LWP / IO::Socket::SSL fails with SSL3_GET_SERVER_HELLO:wrong cipher returned

I found many questions quite similiar to my problem, but they didn't solve it, so here I am asking for your help.
I am trying to get data from web page with Perl LWP using https.
I can get data from almost every site I have tried, except the one I really need to use.
I am using Perl version v5.18.2 under Windows x64.
This is my basic dummy example:
use strict;
use LWP::UserAgent;
use HTTP::Request;
use IO::Socket::SSL qw(debug3);
my $ua = LWP::UserAgent->new;
my $url = 'https://www.domainx.com:443';
my $req = HTTP::Request->new( GET => $url);
my $response = $ua->request($req);
print $response->status_line . "\n";
And result for the response->status_line:
500 Can't connect to www.domainx.com:443
Debug for SSL:
DEBUG: .../IO/Socket/SSL.pm:1890: new ctx 48125200
DEBUG: .../IO/Socket/SSL.pm:393: socket not yet connected
DEBUG: .../IO/Socket/SSL.pm:395: socket connected
DEBUG: .../IO/Socket/SSL.pm:413: ssl handshake not started
DEBUG: .../IO/Socket/SSL.pm:443: using SNI with hostname www.domainx.com
DEBUG: .../IO/Socket/SSL.pm:466: set socket to non-blocking to enforce timeout=180
DEBUG: .../IO/Socket/SSL.pm:479: Net::SSLeay::connect -> -1
DEBUG: .../IO/Socket/SSL.pm:489: ssl handshake in progress
DEBUG: .../IO/Socket/SSL.pm:499: waiting for fd to become ready: SSL wants a read first
DEBUG: .../IO/Socket/SSL.pm:519: socket ready, retrying connect
DEBUG: .../IO/Socket/SSL.pm:479: Net::SSLeay::connect -> -1
DEBUG: .../IO/Socket/SSL.pm:1359: SSL connect attempt failed with unknown error
DEBUG: .../IO/Socket/SSL.pm:485: fatal SSL error: SSL connect attempt failed with unknown error error:14092105:SSL routines:SSL3_GET_SERVER_HELLO:wrong cipher returned
DEBUG: .../IO/Socket/SSL.pm:1924: free ctx 48125200 open=48125200
DEBUG: .../IO/Socket/SSL.pm:1932: OK free ctx 48125200
From checking the previous posts I tried to apply: ssl_opts => { verify_hostname => 0 }, but that didn’t help.
If I try to connect to that same site with browser (IE or Chrome) it works just fine.
Is this some certificate based error or what is going wrong here?
The actual site is www.firstcard.fi
The server is heavily broken as can also be seen from the report by SSLLabs. To get a connection to the server one must work around these problems by only using the single good cipher the server offers:
my $ua = LWP::UserAgent->new;
$ua->ssl_opts(SSL_cipher_list => 'DES-CBC3-SHA');
Interestingly, this cipher is included in the cipher list used by default in IO::Socket::SSL but the server is too broken to properly deal with the correct ClientHello.

Resources