Wednesday, April 4, 2012

Command line (CLI) environment setup

To set up the command line output (conman, composer) there are 3 variables that can be adjusted to obtain the optimum output format.

MAESTROLINES: Specifies the number of lines per screen. At the end of each screen page, conman prompts to continue. If MAESTROLINES (or LINES) is set to zero or a negative number, conman does not pause at the end of a page. 

MAESTROCOLUMNS: Specifies the number of characters per line. The following options are available: Less than 120 (only some columns will be displayed). Equal to or more than 120 (all columns will be displayed). The maximum value is 1024. If either MAESTROLINES or MAESTROCOLUMNS is not set, the standard shell variables, LINES and COLUMNS, are used. 

MAESTRO_OUTPUT_STYLE: Specifies how object names are displayed. If set to LONG, full names are displayed. If not set, or set to any value other than LONG, long names are truncated to eight characters followed by a plus sign (+). 

Default unix output: 

       
bash-3.00$ ./<TWS_home>/bin/conman sj @#final
Tivoli Workload Scheduler (UNIX)/CONMAN 8.6.0.00 (20110719)
Licensed Materials - Property of IBM*
5698-WSH
(C) Copyright IBM Corp. 1998, 2011 All rights reserved.
* Trademark of International Business Machines
Installed for user "maestro".
Locale LANG set to the following: "en"
Scheduled for (Exp) 04/04/12 (#89) on TW1T.  Batchman LIVES.  Limit: 20, Fence: 0, Audit Level: 1
%sj @#final
                                               (Est)  (Est)
CPU      Schedule SchedTime  Job      State Pr Start  Elapse RetCode Deps

TW1T    #FINAL    0003 04/04 ******** SUCC  10 00:03  00:01          [04/03/12]
                             STARTAP+ SUCC  10 00:03  00:01        0 #J18294
                             MAKEPLAN SUCC  10 00:03  00:01        0 #J18468
                             SWITCHP+ SUCC  10 00:03  00:01        0 #J18583
                             CREATEP+ SUCC  10 00:04  00:01        0 #J18990
                             UPDATES+ SUCC  10 00:04  00:01        0 #J18996

TW1T    #FINAL    0003 04/05 ******** HOLD  10(04/05)(00:05)         [Carry]
                             STARTAP+ HOLD  10(04/05)(00:01)
                             MAKEPLAN HOLD  10(04/05)(00:01)         STARTAP+
                             SWITCHP+ HOLD  10(04/05)(00:01)         MAKEPLAN
                             CREATEP+ HOLD  10(04/05)(00:01)         SWITCHP+
                             UPDATES+ HOLD  10(04/05)(00:01)         SWITCHP+


And the output with variables set as: 
MAESTRO_OUTPUT_STYLE=LONG
MAESTROLINES=0
MAESTROCOLUMS=512
       
bash-3.00$ ./<TWS_home>/bin/conman sj @#final
Tivoli Workload Scheduler (UNIX)/CONMAN 8.6.0.00 (20110719)
Licensed Materials - Property of IBM*
5698-WSH
(C) Copyright IBM Corp. 1998, 2011 All rights reserved.
* Trademark of International Business Machines
Installed for user "maestro".
Locale LANG set to the following: "en"
Scheduled for (Exp) 04/04/12 (#89) on TW1T.  Batchman LIVES.  Limit: 20, Fence: 0, Audit Level: 1
%sj @#@final
                                                                                               (Est)  (Est)
Workstation      Job Stream       SchedTime  Job                                      State Pr Start  Elapse ReturnCode Dependencies

TW1T            #FINAL            0003 04/04 **************************************** SUCC  10 00:03  00:01             [04/03/12]
                                             STARTAPPSERVER                           SUCC  10 00:03  00:01           0 #J18294
                                             MAKEPLAN                                 SUCC  10 00:03  00:01           0 #J18468
                                             SWITCHPLAN                               SUCC  10 00:03  00:01           0 #J18583
                                             CREATEPOSTREPORTS                        SUCC  10 00:04  00:01           0 #J18990
                                             UPDATESTATS                              SUCC  10 00:04  00:01           0 #J18996

TW1T            #FINAL            0003 04/05 **************************************** HOLD  10(04/05)(00:05)            [Carry]
                                             STARTAPPSERVER                           HOLD  10(04/05)(00:01)
                                             MAKEPLAN                                 HOLD  10(04/05)(00:01)            STARTAPPSERVER
                                             SWITCHPLAN                               HOLD  10(04/05)(00:01)            MAKEPLAN
                                             CREATEPOSTREPORTS                        HOLD  10(04/05)(00:01)            SWITCHPLAN
                                             UPDATESTATS                              HOLD  10(04/05)(00:01)            SWITCHPLAN


To have the variables set by default, add the following lines to your user profile file (.profile, .bash_profile etc): 
       
<TWS_home>/tws_env.sh
export MAESTRO_OUTPUT_STYLE=LONG
export MAESTROLINES=0
export MAESTROCOLUMS=512



4 comments:

  1. Hi Radu,
    Thanks a lot for sharing the details.
    I have a quick question :- In many unix scripts in my project I have seen "export MAESTROLINES=0" as the very first line and in that script based on the files present in directories few jobs are cancelled using conman cj command.
    I understand if we do a "conman sj " this variable if retained with default would shown only one screen and we may need to press 'Y' to get the next page - in a unix script which I have explained above would could be the reason setting up the value to 0 ?

    Thanks
    Ravichandan

    ReplyDelete
    Replies
    1. Hi Ravichandan,

      MAESTROLINES: Specifies the number of lines per screen. If is set to 0 or a negative number, conman does not pause at the end of a page and will display all the lines.

      Radu

      Delete
  2. HI Radu ,

    I am getting the below error when i fire the conman command

    => conman
    Tivoli Workload Scheduler (UNIX)/CONMAN 8.5.1 (20110420)
    Licensed Materials - Property of IBM*
    5698-WSH
    (C) Copyright IBM Corp. 1998, 2009 All rights reserved.
    * Trademark of International Business Machines
    Installed for user "twsp".
    Locale LANG set to the following: "en"
    Scheduled for (Exp) 04/17/16 (#3278) on SSZ0287. Batchman LIVES. Limit: 1024, Fence: 0, Audit Level: 1
    CONMAN:AWSBEH002E The target host computer is not defined in the connection configuration file or the supplied command parameters.
    CONMAN:AWSBHU611W Conman could not initialize the HTTP or HTTPS connection.

    Does it mean that i need to create a localopts file at /opt/IBM/twsp . Also , could you let me know what all entries i have to make .

    Also , i see that i don't have permission to create file at the above mentioned location . Is there any other way to make it working .

    ReplyDelete
    Replies
    1. Hi Rajat,

      Where did you ran conman? on a FTA? what do you want to achieve?
      Using default security settings you should still be able to manipulate objects in plan even if you get the above error:

      twsuser@twsfta # ./conman "cancel @#JOB_STREAM_1"
      Tivoli Workload Scheduler (UNIX)/CONMAN 8.6.0.02 (20121210)
      Licensed Materials - Property of IBM*
      5698-WSH
      (C) Copyright IBM Corp. 1998, 2012 All rights reserved.
      * Trademark of International Business Machines
      Installed for user "twsuser".
      Locale LANG set to the following: "en"
      Scheduled for (Exp) 04/24/16 (#1219) on twsfta. Batchman LIVES. Limit: 300, Fence: 0, Audit Level: 1
      CONMAN:AWSBEH002E The target host computer is not defined in the connection configuration file or the supplied command parameters.
      CONMAN:AWSBHU611W Conman could not initialize the HTTP or HTTPS connection.
      %cancel @#JOB_STREAM_1
      Process twsfta2#JOB_STREAM_1[(0004 04/10/16),(0AAAAAAAAAAOHQK2)] (enter "y" for yes, "n" for no)?y
      Command forwarded to batchman for twsfta2#JOB_STREAM_1[(0004 04/10/16),(0AAAAAAAAAAOHQK2)]
      twsuser@twsfta #

      Regards,
      Radu

      Delete