Using a custom credential in an SSHCommand probe and calling it from the shell script

johnfw
Kilo Expert

Hi Experts,

I have a SSHCommand probe that runs a shell script to launch SQLplus to connect to Oracle instances on the target server. It is working fine, but at the moment I have the Oracle user/password hard coded in the script.

Can I, and how, have the database credential stored in the custom credential table, and then call it from, or pass it to the shell script ?

Thanks in advance for any help,

john

1 ACCEPTED SOLUTION

Hey John,



Yes, you can use gs.getProperty() or gs.getMessage() to access it.



Or as you said, you can store credentials on a custom table and access it using Glide Record too.


View solution in original post

11 REPLIES 11

Hi David,



It is something I'll look into. As is a command line interface to CyberArk password vault.


For now this will suffice for the PoC work I am doing.


Dave Smith1
ServiceNow Employee
ServiceNow Employee

An alternative is to have credentials added to a local file that can be parsed (included) into the bash script.



It's a bit of a kludge, but I've done this on some systems so that I could write scripts for people and just use placeholders for their values, safe that I wasn't exposed to any login details, e.g.:



      sqlplus ${ORCL_USER}/{ORCL_PASS}@{ORCL_INSTANCE_NAME} < fetch-data.sql > results.txt 2> errors.log