Run SSH command in flow designer
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-27-2024 03:49 AM
Hello,
I have a flow that is creating multiple tasks, including one related to UNIX accounts. Currently, all tasks are being generated, but the requirement is that the UNIX task should only be created for users who have a UNIX account. If the user doesn't have a UNIX account, the task should not be created.
To achieve this, I want to run an SSH command to check whether a user has a UNIX account. If the user has an account, the task will be created otherwise, it will not.
I was exploring the community and came across the SSH step in Flow, but I'm not clear on how it works. I couldn't find any detailed information related to SSH. Could someone please help me understand how I can run SSH commands within a flow?
Thank you!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-27-2024 11:09 AM
Dear @zee15 - for using SSH command within a flow, you have to create a custom action with SSH step.
In the action, you can add a step for the SSH command you want to run.
once you select this step, you need to configure the step form by providing the connection credentials alias.
You can create a connection credential alias like below:
click on new button:
select connection type as Basic for ssh and ftp.
credential should point to the Discovery Credential record corresponding to the *nix server where you want to run the ssh command. You can specify the host and port in this record it self.
Once this is created, you can use this record in the SSH Step configuration.
Save the action and Test it to see the output.
Thanks,
Aneesh Damodaran.
Please click on Accept Solution If this helped you.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-28-2024 07:23 AM
Hi @Aneesh-D,
Thankyou for your response but this particular SSH step is part of the IntegrationHub Professional Plugin, which is a paid feature. Since I don't have access to the paid version, we won't be able to use this SSH step directly.
However, I've come up with an alternative solution. I am currently creating a record in the ecc_queue table with the necessary parameters (see the attachment) and trying to fetch the response that comes back to the ecc_queue table. Unfortunately, I'm facing an issue: the MID server is not sending any response back. I'm not sure if there is something wrong with the payload that I'm sending in payload field or if there is another issue.
Here is the payload that I am sending:
var value = "SELECT uid,username,password,domain,gecos from passwd where uid=" + fd_data.subflow_inputs.user_id + " order by username | ConvertTo-JSON";
return '<?xml version="1.0" encoding="UTF-8"?><parameters><parameter name="name" value="' + value + '"/><parameter name="skip_sensor" value="true"/></parameters>';
Could you please take a look at it and let me know if there's anything that needs to be corrected or adjusted?
Thank you for your help!