gbscmd
This article assumes you are already familiar with gbscmd. If NOT, please google search "gbscmd site:gulfsoft.com" for the past articles on gbscmd at our site. It is a Gulf Breeze provided utility that does many things using SOAP calls. Gbscmd works fine where Perl 5.6 or later is available (Windows, Unix, Linux and even on MacOS X as well!).
Remote command execution
Gbscmd v3.3 added a new switch called "command" that accepts a command & name of the managed system (OS agent) as input, executes the command and prints the exit code in standard output. Please note that the command text is limited to 256 characters. This is an ITM size limitation regardless of the OS.
Here is how you would execute a command.
$ gbscmd command --auth --command "/opt/IBM/ITM/bin/cinfo -r > /tmp/cinfo.txt" --managedsystem linux1:LZ
Executing command on linux1:LZ : Return code is 0
$
By default, the command will timeout after 60 seconds, but you can change the timeout value using --timeout switch. For example, the following command cycles the Universal agent running on Primary:ITM61:NT
$ gbscmd command --auth --command 'net stop kumcma_primary && net start kumcma_primary' --managedsystem Primary:ITM61:NT --timeout 120
Executing command on Primary:ITM61:NT : Return code is 0
$
Limitations
Even though, this method provides way to execute commmands on remote systems, the following framework task features are NOT available.
1. There is no way to see the output of the command as the SOAP call doesn't return this information.
2. The command text is limited to 256 characters.
3. The executable must reside on the remote system and be accessible.
Other features
Want to know other features of gbscmd? Please feel free to download the reference manual from here
Acknowledgements
Many thanks to Sergei Rodionov of Axibase for the SOAP call.
Posted by Venkat Saranathan
No comments:
Post a Comment