Project and Portfolio Management Practitioners Forum
cancel
Showing results for 
Search instead for 
Did you mean: 

How to FTP the output Text file(delimited) to our FTP site(sftp.aig.com) from a report in PPM

Highlighted
DivyaMurali
Super Collector

How to FTP the output Text file(delimited) to our FTP site(sftp.aig.com) from a report in PPM

Hi,

 

We would like to create a report which invokes a scripts and creates delimited text files from PPM Custom tables. This output text file should then be FTPed to our FTP site (sftp.aig.com). Please advice us on how to do the FTP from the report?

When referred the PPMWorkbench, we could see the below given commands for copying data between client and server.

ksc_simple_respond
ksc_copy_client_server
ksc_copy_script_dest_server
ksc_copy_server_client

Can anyone please advice which command is best suitable to FTP the delimited output text file to our FTP site(sftp.aig.com). Also please advice the parameters that should be passed for the command?

 

Thanks!

Divya

4 REPLIES
Utkarsh_Mishra
Honored Contributor

Re: How to FTP the output Text file(delimited) to our FTP site(sftp.aig.com) from a report in PPM

Hi,

 

You can use command "ksc_copy_server_server" to copy from source to destination environment. Just make sure that you first connect to source envirnment and then run this command.

Secondly you need to mention the Source and Destination environment in workflow step properties.

 

For this command usage you can refere HP provide object type "(REFERENCE) File Migraion". In this go to command section of this Object type and can take reference of it.

 

Also it is use in many places so to check it usage type you can go to "ksc_copy_server_server" command and check the "USED BY" tab. There it lists the entities that uses the command; so you can refere those entities to get more details.

 

Cheers..
Utkarsh Mishra

-- Remember to give Kudos to answers! (click the KUDOS star)
Jason Nichols K
Honored Contributor

Re: How to FTP the output Text file(delimited) to our FTP site(sftp.aig.com) from a report in PPM

To use the ksc_copy commands, you need to have an environment defined with the FTP credentials.  If the source server that you generating the text file from just has the server portion of the environment utilized, you can setup the FTP site information in the client section.  Let's say, for example, that you are using the KITNANA_SERVER environment to collect the data from the PPM tables and generating the text file.  Typically, the KINTANA_SERVER environment does not have a client section defined, so you could put the FTP information right in the KITNANA_SERVER environment.  The you would have your report commands laid out like this:

 

[commands to run scripts

 and generate text file]

ksc_copy_server_client DEST_ENV="KINTANA_SERVER" SOURCE_ENV="KINTANA_SERVER" FILENAME="[TOKEN_HOLDING_FILENAME]"

 

You do not have to be connected to any environment to use the ksc_copy commands.  They work just fine independently.

DivyaMurali
Super Collector

Re: How to FTP the output Text file(delimited) to our FTP site(sftp.aig.com) from a report in PPM

Thanks to both of you 4 your replies!

 

Please find below the reply from HP team to FTP the output file from report.

 

Use special command "ksc_simple_respond” and pass “sftp” command with required parameters (Both HP FTP site and AG FTP site IP addr and authentication info. etc) which will FTP the output file from the Outgoing folder and will sent it to specified  FTP site.

 

Since I am new to PPM, Could anyone please advice how the command 'ksc_simple_respond' can be used for this purpose? When checked in Workbench, this command has no parameters. So could you please tell me how the required values can be passed for the command?

 

 

Thanks!

 

 

Utkarsh_Mishra
Honored Contributor

Re: How to FTP the output Text file(delimited) to our FTP site(sftp.aig.com) from a report in PPM

Here is the extract about ksc_simple_respond from old version PPM document provide by HP.

 

ksc_simple_respond command is used to provide responses to an interactive script, it allows you to work with interactive commands/scripts. 

 

 

------------------------------------------------------------------------------------------------

ksc_simple_respond

 

This command executes an interactive UNIX command on a remote computer. This command is useful when the command to be executed will prompt for additional information (such as the UNIX ‘su’ command to switch user accounts) or may not return an exit code upon completion (such as starting up a new shell using ‘sh’).

 

The following syntax is supported:

 

ksc_simple_respond command

ksc_simple_respond command prompt 1" response 1"

[prompt 2" response 2"  ]

 

Note:

This command can only be used from within a remote execution session, i.e. between ‘ksc_connect’ and ‘ksc_exit’ commands.

 

ksc_simple_respond “command” -hide “prompt 1" “response 1"

[“prompt 2" “response 2" … ]

 

There can be as many prompt-response pairs as necessary. Each prompt must be matched with a response, even if the response is an empty string. The prompts must appear in the exact order they will be displayed as the command is run. All arguments must be enclosed in quotes. In addition, if the command or any of the arguments contains double quotes (“), any other character can be used as the quote character. The first character after the string ‘ksc_simple_respond’ will be interpreted as the quote character, and that character must appear at the beginning and end of each argument.

By using the -hide option, the value passed in for the response will not be displayed in the execution log. In the log, the value will be displayed as ****. This flag should be used for each prompt/response pair that needs this treatment.

 

NOTE:

The Kintana execution engine will wait for each specified prompt. If a prompt does not appear for some reason, then the execution engine will continue to wait for it until the command times out.

 

Examples using ksc_simple_respond

 

If it becomes necessary to invoke a new shell while in a remote session, it would be ideal to just use the command ‘sh’. However, this can cause the Kintana execution engine to wait indefinitely while waiting for an exit code. To avoid this problem, the ‘sh’ command can be encapsulated in a ksc_simple_respond command with no prompts, as follows:

 

ksc_simple_respond “sh”

 

As another example, suppose it becomes necessary to switch to another user account while in a remote session using the ‘su’ command. This command always prompts for password, unless performed by a root user. By utilizing the -hide feature, the password will not be displayed in the execution logs. This interactivity can be handled using ksc_simple_respond as follows:

 

ksc_simple_respond "su <username>" -hide "word:"

"<password>"

 

Note that “word:” was used as the prompt instead of the entire word “password:”. The Kintana execution engine will wait for the specified prompt string, whether it is all, or just a part, of the prompt text.

 

As one more example, consider the following Bourne shell command:

echo "Enter a string:\c"; read str; echo $str

 

Normally, this command line would cause the Kintana execution engine to hang while waiting for an exit code (the command will never exit because it's waiting for input), which would eventually timeout when the execution timeout time is reached. Use ksc_simple_respond to process this command as follows (note it should be entered on a single line):

 

ksc_simple_respond #echo "Enter a string:\c"; read str; echo

$str# #a string:# #my_value#

 

Since the command line contained double quotes, we chose to use the pound sign (#) as the quote character. During execution, this command step would prompt “Enter a string:” and wait for some input. The string “my_value” would be entered automatically, this value would be echoed to the output device (in this case, the execution log), and execution would continue as normal with the next command step.

Cheers..
Utkarsh Mishra

-- Remember to give Kudos to answers! (click the KUDOS star)
//Add this to "OnDomLoad" event