Ejemplo n.º 1
0
int
main (int argc, char **argv)
{
  struct submit req;
  struct submitReply reply;
  char *job;
  LS_LONG_INT jobId = -1, *jobIdList = NULL;
  int numJobIds;
  time_t beginTime, terminTime;
  int rc;

  rc = _i18n_init (I18N_CAT_MIN);

  if (lsb_init (argv[0]) < 0)
    {
      sub_perror ("lsb_init");
      fprintf (stderr, ". %s.\n", (_i18n_msg_get (ls_catd, NL_SETN, 351, "Job not modified")));	/* catgets  351  */
      exit (-1);
    }

  if (fillReq (argc, argv, CMD_BMODIFY, &req) < 0)
    {
      fprintf (stderr, ". %s.\n",
	       (_i18n_msg_get (ls_catd, NL_SETN, 351, "Job not modified")));
      exit (-1);
    }

  job = req.command;
  beginTime = req.beginTime;
  terminTime = req.termTime;

  if ((numJobIds = getJobIdList (job, &jobIdList)) < 0)
    {
      exit (-1);
    }
  jobId = jobIdList[0];
  if ((jobId = lsb_modify (&req, &reply, jobId)) < 0)
    {
      if (lsberrno == LSBE_JOB_ARRAY)
	{
	  fprintf (stderr, (_i18n_msg_get (ls_catd, NL_SETN, 352, "Options -q and -O cannot be applied on job array")));	/* catgets  352  */
	}
      else
	prtErrMsg (&req, &reply);
      fprintf (stderr, ". %s.\n",
	       (_i18n_msg_get (ls_catd, NL_SETN, 351, "Job not modified")));
      if (req.nxf)
	free (req.xf);
      exit (-1);
    }

  printf ((_i18n_msg_get (ls_catd, NL_SETN, 353, "Parameters of job <%s> are being changed\n")), job);	/* catgets  353 */
  if (beginTime > 0 || terminTime > 0)
    prtBETime_ (&req);
  if (req.nxf)
    free (req.xf);

  _i18n_end (ls_catd);
  exit (0);
}
Ejemplo n.º 2
0
int 
main (int argc, char **argv)
{

    int rc;

    rc = _i18n_init ( I18N_CAT_MIN );	
    exit(do_sub(argc, argv, CMD_BSUB));
    _i18n_end ( ls_catd );			
} 
Ejemplo n.º 3
0
int
main (int argc, char *argv[])
{
  int rt;

  rt = _i18n_init (I18N_CAT_MIN);

  setdefaults ();
  getoptions (argc, argv);
  getpids (argc, argv);
  printheader ();
  initstats ();
  processlogfile ();
  printsummary ();

  _i18n_end (ls_catd);
  return (0);

}
Ejemplo n.º 4
0
int
main (int argc, char **argv, char **environ)
{
  char *queue = NULL, *host = NULL, *jobName = NULL, *user = NULL;
  LS_LONG_INT jobId;
  int options;
  struct jobInfoEnt *jInfo;
  char *outFile;
  char fflag = FALSE;
  int cc;
  int rc;

  rc = _i18n_init (I18N_CAT_MIN);

  if (lsb_init (argv[0]) < 0)
    {
      lsb_perror ("lsb_init");
      exit (-1);
    }

  while ((cc = getopt (argc, argv, "Vhfq:m:J:")) != EOF)
    {
      switch (cc)
	{
	case 'q':
	  if (queue || host || jobName)
	    oneOf (argv[0]);
	  queue = optarg;
	  break;
	case 'm':
	  if (queue || host || jobName)
	    oneOf (argv[0]);
	  host = optarg;
	  break;
	case 'J':
	  if (queue || host || jobName)
	    oneOf (argv[0]);
	  jobName = optarg;
	  break;
	case 'V':
	  fputs (_LS_VERSION_, stderr);
	  exit (0);
	case 'f':
	  fflag = TRUE;
	  break;
	case 'h':
	default:
	  usage (argv[0]);
	}
    }

  jobId = 0;
  options = LAST_JOB;
  if (argc >= optind + 1)
    {
      if (queue || host || jobName)
	{
	  oneOf (argv[0]);
	}
      else if ((argc > 2 && !fflag) || (argc > 3 && fflag))
	usage (argv[0]);

      if (getOneJobId (argv[optind], &jobId, 0))
	{
	  usage (argv[0]);
	}

      options = 0;
    }



  if (lsb_openjobinfo (jobId, jobName, NULL, queue, host, options) < 0
      || (jInfo = lsb_readjobinfo (NULL)) == NULL)
    {

      if (jobId != 0 || jobName != NULL)
	{
	  user = ALL_USERS;
	  if (lsb_openjobinfo (jobId, jobName, user, queue, host, options) < 0
	      || (jInfo = lsb_readjobinfo (NULL)) == NULL)
	    {
	      jobInfoErr (jobId, jobName, NULL, queue, host, options);
	      exit (-1);
	    }
	}
      else
	{
	  jobInfoErr (jobId, jobName, NULL, queue, host, options);
	  exit (-1);
	}
    }
  lsb_closejobinfo ();


  if (jobId && jInfo->jobId != jobId)
    {
      lsberrno = LSBE_JOB_ARRAY;
      lsb_perror ("bpeek");
      exit (-1);
    }


  if ((jInfo->submit.options & SUB_INTERACTIVE) &&
      !(jInfo->submit.options & (SUB_OUT_FILE | SUB_ERR_FILE)))
    {
      fprintf (stderr, _i18n_msg_get (ls_catd, NL_SETN, 2456, "Job <%s> : Cannot bpeek an interactive job.\n"),	/* catgets  2456 */
	       lsb_jobid2str (jInfo->jobId));
      exit (-1);
    }

  if (IS_PEND (jInfo->status) || jInfo->execUsername[0] == '\0')
    {
      fprintf (stderr, _i18n_msg_get (ls_catd, NL_SETN, 2454, "Job <%s> : Not yet started.\n"),	/* catgets  2454 */
	       lsb_jobid2str (jInfo->jobId));

      exit (-1);
    }
  if (IS_FINISH (jInfo->status))
    {
      fprintf (stderr, _i18n_msg_get (ls_catd, NL_SETN, 2455, "Job <%s> : Already finished.\n"),	/* catgets  2455  */
	       lsb_jobid2str (jInfo->jobId));
      exit (-1);
    }

  if ((outFile = lsb_peekjob (jInfo->jobId)) == NULL)
    {
      char msg[50];
      sprintf (msg, "%s <%s>", I18N_Job, lsb_jobid2str (jInfo->jobId));
      lsb_perror (msg);
      exit (-1);
    }
  displayOutput (outFile, jInfo, fflag, environ);
  _i18n_end (ls_catd);
  exit (0);

}
Ejemplo n.º 5
0
int 
main (int argc, char **argv)
{
    int i, cc, local = FALSE;
    struct hostInfoEnt *hInfo;
    char **hosts=NULL, **hostPoint, *resReq = NULL;
    char lflag = FALSE, sOption = FALSE, otherOption = FALSE;
    int numHosts;
    int rc;

    _lsb_recvtimeout = 30;
    rc = _i18n_init ( I18N_CAT_MIN );	

    if (lsb_init(argv[0]) < 0) {
	lsb_perror("lsb_init");
        _i18n_end ( ls_catd );			
	exit(-1);
    }

    for  (i = 1; i < argc; i++) {
        if (strcmp(argv[i], "-h") == 0) {
            usage(argv[0]);
            _i18n_end ( ls_catd );			
            exit (0);
        } else if (strcmp(argv[i], "-V") == 0) {
            fputs(_LS_VERSION_, stderr);
            _i18n_end ( ls_catd );			
            exit(0);
        } else if (strcmp(argv[i], "-s") == 0) {
            if (otherOption == TRUE) {
                usage(argv[0]);
                _i18n_end ( ls_catd );			
                exit(-1);
            }
            sOption = TRUE;
            optind = i + 1;
        } else if (strcmp(argv[i], "-R") == 0 || strcmp(argv[i], "-l") == 0
                   || strcmp(argv[i], "-w") == 0) {
            otherOption = TRUE;
            if (sOption == TRUE) {
                usage(argv[0]);
                _i18n_end ( ls_catd );			
                exit(-1);
            }
        }
    }

    if (sOption) {
        displayShareRes(argc, argv, optind);
        return (0);
    }
    while ((cc = getopt(argc, argv, "lwR:")) != EOF) {
        switch (cc) {
	case 'l':
	    lflag = TRUE;
            if (wflag)
                usage(argv[0]);
	    break;
	case 'w':
	    wflag = TRUE;
            if (lflag)
                usage(argv[0]);
	    break;
	case 'R':
	    resReq = optarg;
	    break;
        default:
            usage(argv[0]);
        }
    }
    numHosts = getNames (argc, argv, optind, &hosts, &local, "host");
    if ((local && numHosts == 1) || !numHosts) 
        hostPoint = NULL;
    else 
        hostPoint = hosts;
    TIMEIT(0, (hInfo = lsb_hostinfo_ex(hostPoint, &numHosts, resReq, 0)), "lsb_hostinfo");
    if (!hInfo) {
        if (lsberrno == LSBE_BAD_HOST && hostPoint)
            lsb_perror (hosts[numHosts]);
        else
            lsb_perror (NULL);
        exit (-1);
    }

    if (numHosts > 1 && resReq == NULL)    
	sort_host (numHosts, hInfo);   

    if ( lflag )
        prtHostsLong(numHosts, hInfo);
    else
        prtHostsShort(numHosts, hInfo);

    _i18n_end ( ls_catd );			
    exit(0);
    
} 
Ejemplo n.º 6
0
int
main( int argc, char *argv[] )
{

    lsRcpXfer lsXfer;
    int iCount;
    char* buf;
    int rc;

    rc = _i18n_init ( I18N_CAT_MIN );


    Signal_(SIGUSR1, SIG_IGN);



    if (ls_initdebug(argv[0]) < 0) {
        ls_perror("ls_initdebug");
        exit(-1);
    }


    if (ls_initrex(1,0) == -1) {
        ls_perror("lsrcp: ls_initrex");
        return(-1);
    }


    ls_rfcontrol(RF_CMD_RXFLAGS, REXF_CLNTDIR);


    if (setuid(getuid()) < 0) {
        perror("lsrcp: setuid");
        goto handle_error;
    }

    if (createXfer(&lsXfer)) {
        perror("lsrcp");
        goto handle_error;
    }

    doXferOptions(&lsXfer, argc, argv);



    buf = (char*)malloc(LSRCP_MSGSIZE);
    if(!buf) {

        ls_donerex();
        ls_syslog(LOG_ERR, I18N_FUNC_FAIL_S,"lsrcp","main",
	    _i18n_msg_get(ls_catd,NL_SETN,2301,"try rcp...")); /* catgets 2301 */
        if (doXferRcp(&lsXfer, 0) < 0)
            return(-1);
        return(0);
    }
    for (iCount=0;iCount < lsXfer.iNumFiles; iCount++) {
        if (copyFile(&lsXfer, buf, 0)) {

                ls_donerex();
        	ls_syslog(LOG_ERR, I18N_FUNC_FAIL_S,"lsrcp","main",
		    _i18n_msg_get(ls_catd,NL_SETN,2301,"try rcp..."));
                if (doXferRcp(&lsXfer, 0) < 0)
		    return(-1);
                return(0);
        }
	if (logclass & (LC_FILE))
            ls_syslog(LOG_DEBUG, "main(), copy file succeeded.");
    }
    free(buf);

    ls_donerex();

    if (destroyXfer(&lsXfer)) {
        perror("lsrcp");
        return(-1);
    }


    _i18n_end ( ls_catd );

    return(0);

handle_error:
    ls_donerex();
    return(-1);

}
Ejemplo n.º 7
0
int
main(int argc, char** argv)
{
    char*                 hosts   = NULL;
    struct runJobRequest  runJobRequest;
    int                   cc;
    int                   c;
    bool_t                fFlag = FALSE;
    bool_t		  bFlag = FALSE;
    int rc;

    rc = _i18n_init ( I18N_CAT_MIN );


    if (lsb_init(argv[0]) < 0) {
	lsb_perror("lsb_init");
	exit (-1);
    }

    while((c = getopt(argc, argv, "m:fbhV")) != EOF) {
	switch(c) {
	case 'm':
	    hosts = putstr_(optarg);
	    if (hosts == NULL) {
		perror("putstr_");
		exit(-1);
	    }
	    break;
        case 'f':
	    fFlag = TRUE;
	    break;
	case 'b':
	    bFlag = TRUE;
	    break;
	case 'V':
	    fputs(_LS_VERSION_, stderr);
	    return (0);
	case 'h':
	    usage(argv[0]);
	    exit(-1);
	}
    }

    if (argc <= optind) {
	usage(argv[0]);
	exit(-1);
    }

    memset((struct runJobRequest* )&runJobRequest, 0,
	   sizeof(struct runJobRequest));


    if (getOneJobId (argv[argc - 1], &(runJobRequest.jobId), 0)) {
	usage(argv[0]);
	exit(-1);
    }
    runJobRequest.numHosts = countHosts(hosts);

    if (runJobRequest.numHosts > 1) {
	int     i;

	runJobRequest.hostname = (char **)calloc(runJobRequest.numHosts,
						 sizeof(char *));
	if (runJobRequest.hostname == NULL) {
	    perror("calloc");
	    exit(-1);
	}

	for (i = 0; i < runJobRequest.numHosts; i++) {
	    while (isspace(*hosts)) hosts++;
	    runJobRequest.hostname[i] = hosts;
	    hosts += strlen(hosts) + 1;
	}
    } else
	runJobRequest.hostname = &hosts;

    runJobRequest.options = (fFlag == TRUE) ?
	RUNJOB_OPT_NOSTOP : RUNJOB_OPT_NORMAL;

    if (bFlag) {
	runJobRequest.options |= RUNJOB_OPT_FROM_BEGIN;
    }


    cc = lsb_runjob(&runJobRequest);
    if (cc < 0) {
	lsb_perror((_i18n_msg_get(ls_catd,NL_SETN,2755, "Failed to run the job"))); /* catgets  2755  */
	exit(-1);
    }

    printf((_i18n_msg_get(ls_catd,NL_SETN,2756, "Job <%s> is being forced to run.\n")), /* catgets  2756  */
	   lsb_jobid2str(runJobRequest.jobId));

    _i18n_end ( ls_catd );
    return (0);
}
Ejemplo n.º 8
0
int
main (int argc, char **argv)
{
  int cc, myIndex;
  const char prompt[] = "badmin> ";
  static char line[MAXLINELEN];
  int rc;

  rc = _i18n_init (I18N_CAT_MIN);

  if (lsb_init (argv[0]) < 0)
    {
      lsb_perror ("lsb_init");
      _i18n_end (ls_catd);
      exit (-1);
    }

  while ((cc = getopt (argc, argv, "Vh")) != EOF)
    {
      switch (cc)
	{
	case 'V':
	  fputs (_LS_VERSION_, stderr);
	  exit (0);
	case 'h':
	default:


	  cmdsUsage ("badmin", cmdList,
		     _i18n_msgArray_get (ls_catd, NL_SETN, cmdInfo_ID,
					 cmdInfo));
	}
    }
  if (argc > optind)
    {
      int rc;

      if ((myIndex = adminCmdIndex (argv[optind], cmdList)) == -1)
	{
	  fprintf (stderr, (_i18n_msg_get (ls_catd, NL_SETN, 2552, "Invalid command <%s> \n")), argv[optind]);	/* catgets  2552  */

	  cmdsUsage ("badmin", cmdList,
		     _i18n_msgArray_get (ls_catd, NL_SETN, cmdInfo_ID,
					 cmdInfo));
	}
      optind++;
      rc = doBatchCmd (argc, argv);
      _i18n_end (ls_catd);
      exit (rc);
    }

  for (;;)
    {
      printf ("%s", prompt);
      fflush (stdout);
      if (fgets (line, MAXLINELEN, stdin) == NULL)
	{
	  printf ("\n");
	  _i18n_end (ls_catd);
	  exit (-1);
	}

      parseAndDo (line, doBatchCmd);
    }
  return (0);

}
Ejemplo n.º 9
0
int
main(int argc, char **argv)
{
    static char fname[] = "lsinfo/main";
    struct lsInfo *lsInfo;
    int i, cc, nnames;
    char *namebufs[256];
    char longFormat = FALSE;
    char rFlag = FALSE;
    char tFlag = FALSE;
    char mFlag = FALSE;
    char mmFlag = FALSE;
    int rc;

    rc = _i18n_init ( I18N_CAT_MIN );

    if (ls_initdebug(argv[0]) < 0) {
        ls_perror("ls_initdebug");
        exit(-1);
    }
    if (logclass & (LC_TRACE))
        ls_syslog(LOG_DEBUG, "%s: Entering this routine...", fname);

    while ((cc = getopt(argc, argv, "VhlrmMt")) != EOF) {
        switch(cc) {
            case 'V':
                fputs(_LS_VERSION_, stderr);
                exit(0);
            case 'l':
                longFormat = TRUE;
                break;
            case 'r':
                rFlag = TRUE;
                break;
            case 't':
                tFlag = TRUE;
                break;
            case 'm':
                mFlag = TRUE;
                break;
            case 'M':
                mFlag  = TRUE;
                mmFlag = TRUE;
                break;
            case 'h':
            default:
                usage(argv[0]);
        }
    }

    for (nnames=0; optind < argc; optind++, nnames++)
        namebufs[nnames] = argv[optind];

    if ((lsInfo = ls_info()) == NULL) {
	ls_perror("lsinfo");
        exit(-10);
    }


    if (!nnames && !rFlag && !mFlag && !tFlag && !mmFlag)
        rFlag = mFlag = tFlag = TRUE;
    else if (nnames)
        rFlag = TRUE;

    if (rFlag) {
        if (!longFormat) {
	    char *buf1, *buf2, *buf3, *buf4;

	    buf1 = putstr_(_i18n_msg_get(ls_catd,NL_SETN,1804, "RESOURCE_NAME")), /* catgets  1804  */
	    buf2 = putstr_(_i18n_msg_get(ls_catd,NL_SETN,1805, "  TYPE ")), /* catgets  1805  */
	    buf3 = putstr_(_i18n_msg_get(ls_catd,NL_SETN,1806, "ORDER")), /* catgets  1806  */
	    buf4 = putstr_(_i18n_msg_get(ls_catd,NL_SETN,1807, "DESCRIPTION")), /* catgets  1807  */

            printf("%-13.13s %7.7s  %5.5s  %s\n",
		buf1, buf2, buf3, buf4);

	    FREEUP(buf1);
	    FREEUP(buf2);
	    FREEUP(buf3);
	    FREEUP(buf4);
	}

        for (i=0; i < lsInfo->nRes; i++) {
            if (!nameInList(namebufs, nnames, lsInfo->resTable[i].name))
                continue;
            if (!longFormat) {
               printf("%-13.13s %7.7s %5.5s   %s\n",
                   lsInfo->resTable[i].name,
                   valueTypeToStr(lsInfo->resTable[i].valueType),
                   orderTypeToStr(lsInfo->resTable[i].orderType),
                   lsInfo->resTable[i].des);
            } else
               print_long(&(lsInfo->resTable[i]));
        }

        for (i=0; i < nnames; i++)
            if (namebufs[i])
                printf(_i18n_msg_get(ls_catd,NL_SETN,1808, "%s: Resource name not found\n"),/* catgets  1808  */
		    namebufs[i]);

    }

    if (tFlag) {
        if (rFlag)
            putchar('\n');
        puts(_i18n_msg_get(ls_catd,NL_SETN,1809, "TYPE_NAME")); /* catgets  1809  */
        for (i=0;i<lsInfo->nTypes;i++)
            puts(lsInfo->hostTypes[i]);
    }

    if (mFlag) {
        if (rFlag || tFlag)
            putchar('\n');
        puts(_i18n_msg_get(ls_catd,NL_SETN,1810,
            "MODEL_NAME      CPU_FACTOR      ARCHITECTURE")); /* catgets  1810  */
        for (i = 0; i < lsInfo->nModels; ++i)
            if (mmFlag || lsInfo->modelRefs[i])
                printf("%-16s    %6.2f      %s\n", lsInfo->hostModels[i],
                    lsInfo->cpuFactor[i], lsInfo->hostArchs[i]);
    }

    _i18n_end ( ls_catd );

    exit(0);
}
Ejemplo n.º 10
0
int
main(int argc, char **argv)
{
    static char fname[] = "lshosts/main";
    char   *namebufs[256];
    struct hostInfo *hostinfo;
    int    numhosts = 0;
    struct hostent *hp;
    int    i, j;
    char   *resReq = NULL;
    char   longformat = FALSE;
    char   longname = FALSE;
    char   staticResource = FALSE, otherOption = FALSE;
    int extView = FALSE;
    int achar;
    int     unknown;
    int     options=0;
    int isClus;
    int rc;


    rc = _i18n_init ( I18N_CAT_MIN );

    if (ls_initdebug(argv[0]) < 0) {
        ls_perror("ls_initdebug");
        exit(-1);
    }
    if (logclass & (LC_TRACE))
        ls_syslog(LOG_DEBUG, "%s: Entering this routine...", fname);

    for (i = 1; i < argc; i++) {
        if (strcmp(argv[i], "-h") == 0) {
            usage(argv[0]);
            exit (0);
        } else if (strcmp(argv[i], "-V") == 0) {
            fputs(_LS_VERSION_, stderr);
            exit(0);
        } else if (strcmp(argv[i], "-s") == 0) {
            if (otherOption == TRUE) {
                usage(argv[0]);
                exit(-1);
            }
            staticResource = TRUE;
            optind = i + 1;
        } else if (strcmp(argv[i], "-e") == 0) {
            if (otherOption == TRUE || staticResource == FALSE) {
                usage(argv[0]);
                exit(-1);
            }
            optind = i + 1;
            extView = TRUE;
        } else if (strcmp(argv[i], "-R") == 0 || strcmp(argv[i], "-l") == 0
                  || strcmp(argv[i], "-w") == 0) {
            otherOption = TRUE;
            if (staticResource == TRUE) {
                usage(argv[0]);
                exit(-1);
            }
        }
    }

    if (staticResource == TRUE) {
        displayShareResource(argc, argv, optind, TRUE, extView );
    } else {
        while ((achar = getopt(argc, argv, "R:lw")) != EOF) {
 	    switch (achar) {
            case 'R':
	        if (strlen(optarg) > MAXLINELEN) {
                        printf(" %s", I18N(1645, "The resource requirement string exceeds the maximum length of 512 characters. Specify a shorter resource requirement.\n")); /* catgets  1645  */
		        exit (-1);
	        }
	        resReq = optarg;
	        break;
            case 'l':
	        longformat = TRUE;
	        break;
            case 'w':
	        longname = TRUE;
	        break;
            default:
	        usage(argv[0]);
	        exit(-1);
	    }
        }

        i=0;
        unknown = 0;
        for ( ; optind < argc ; optind++) {
    	    if (strcmp(argv[optind],"allclusters") == 0) {
	        options = ALL_CLUSTERS;
	        i = 0;
                break;
            }
            if ( (isClus = ls_isclustername(argv[optind])) < 0 ) {
	        fprintf(stderr, "lshosts: %s\n", ls_sysmsg());
                unknown = 1;
                continue;
            } else if ((isClus == 0) &&
                       ((hp = Gethostbyname_(argv[optind])) == NULL)) {
                fprintf(stderr, "\
%s: gethostbyname() failed for host %s.\n", __func__, argv[optind]);
                unknown = 1;
                continue;
            }
            namebufs[i] = strdup(hp->h_name);
            if (namebufs[i] == NULL) {
                perror("strdup()");
                exit(-1);
            }
            i++;
        }

        if (i == 0 && unknown == 1)
            exit(-1);

        if (i == 0) {
            TIMEIT(0, (hostinfo = ls_gethostinfo(resReq, &numhosts, NULL, 0,
                                                 options)), "ls_gethostinfo");
            if (hostinfo == NULL) {
                ls_perror("ls_gethostinfo()");
                exit(-1);
            }
        } else {
    	    TIMEIT(0, (hostinfo = ls_gethostinfo(resReq, &numhosts, namebufs,
                                                 i, 0)), "ls_gethostinfo");
	    if (hostinfo == NULL) {
	        ls_perror("ls_gethostinfo");
	        exit(-1);
	    }
        }

        if (!longformat && !longname) {
	    char *buf1, *buf2, *buf3, *buf4, *buf5;
	    char *buf6, *buf7, *buf8, *buf9;

	    buf1 = putstr_(_i18n_msg_get(ls_catd,NL_SETN,1628, "HOST_NAME")); /* catgets 1628 */
	    buf2 = putstr_(_i18n_msg_get(ls_catd,NL_SETN,1602, "type")); /* catgets  1602  */
	    buf3 = putstr_(_i18n_msg_get(ls_catd,NL_SETN,1603, "model")); /* catgets  1603  */
	    buf4 = putstr_(_i18n_msg_get(ls_catd,NL_SETN,1604, "cpuf")); /* catgets  1604 */
	    buf5 = putstr_(_i18n_msg_get(ls_catd,NL_SETN,1605, "ncpus")); /* catgets  1605  */
	    buf6 = putstr_(_i18n_msg_get(ls_catd,NL_SETN,1607, "maxmem")); /* catgets  1607  */
	    buf7 = putstr_(_i18n_msg_get(ls_catd,NL_SETN,1608, "maxswp")); /* catgets  1608  */
	    buf8 = putstr_(_i18n_msg_get(ls_catd,NL_SETN,1611, "server")); /* catgets  1611  */
	    buf9 = putstr_(_i18n_msg_get(ls_catd,NL_SETN,1614, "RESOURCES")); /* catgets  1614  */

            printf("%-11.11s %7.7s %8.8s %5.5s %5.5s %6.6s %6.6s %6.6s %9.9s\n",
		buf1, buf2, buf3, buf4, buf5, buf6, buf7, buf8, buf9);

	    FREEUP(buf1);
	    FREEUP(buf2);
	    FREEUP(buf3);
	    FREEUP(buf4);
	    FREEUP(buf5);
	    FREEUP(buf6);
	    FREEUP(buf7);
	    FREEUP(buf8);
	    FREEUP(buf9);

        } else if (longname) {
	    char *buf1, *buf2, *buf3, *buf4, *buf5;
	    char *buf6, *buf7, *buf8, *buf9;

	    buf1 = putstr_(_i18n_msg_get(ls_catd,NL_SETN,1628, "HOST_NAME")); /* catgets  1628 */
	    buf2 = putstr_(_i18n_msg_get(ls_catd,NL_SETN,1602, "type")); /* catgets  1602  */
	    buf3 = putstr_(_i18n_msg_get(ls_catd,NL_SETN,1603, "model")); /* catgets  1603  */
	    buf4 = putstr_(_i18n_msg_get(ls_catd,NL_SETN,1604, "cpuf")); /* catgets  1604  */
	    buf5 = putstr_(_i18n_msg_get(ls_catd,NL_SETN,1605, "ncpus")); /* catgets  1605  */
	    buf6 = putstr_(_i18n_msg_get(ls_catd,NL_SETN,1607, "maxmem")); /* catgets  1607  */
	    buf7 = putstr_(_i18n_msg_get(ls_catd,NL_SETN,1608, "maxswp")); /* catgets  1608  */
	    buf8 = putstr_(_i18n_msg_get(ls_catd,NL_SETN,1611, "server")); /* catgets  1611  */
	    buf9 = putstr_(_i18n_msg_get(ls_catd,NL_SETN,1614, "RESOURCES")); /* catgets  1614  */

            printf("%-25.25s %10.10s %11.11s %5.5s %5.5s %6.6s %6.6s %6.6s %9.9s\n",
		buf1, buf2, buf3, buf4, buf5, buf6, buf7, buf8, buf9);

	    FREEUP(buf1);
	    FREEUP(buf2);
	    FREEUP(buf3);
	    FREEUP(buf4);
	    FREEUP(buf5);
	    FREEUP(buf6);
	    FREEUP(buf7);
	    FREEUP(buf8);
	    FREEUP(buf9);
        }

        for (i=0;i<numhosts;i++) {
            char *server;
            int first;

            if (longformat) {
                print_long(&hostinfo[i]);
                continue;
            }

            if (hostinfo[i].isServer)
                server = I18N_Yes;
            else
                server = I18N_No;


    	    if(longname)
	        printf("%-25s %10s %11s %5.1f ", hostinfo[i].hostName,
	               hostinfo[i].hostType, hostinfo[i].hostModel,
                       hostinfo[i].cpuFactor);
            else
	        printf("%-11.11s %7.7s %8.8s %5.1f ", hostinfo[i].hostName,
	               hostinfo[i].hostType, hostinfo[i].hostModel,
                       hostinfo[i].cpuFactor);

	    if (hostinfo[i].maxCpus > 0)
	        printf("%5d",hostinfo[i].maxCpus);
	    else
                printf("%5.5s", "-");

	    if (hostinfo[i].maxMem > 0)
	        printf(" %5dM",hostinfo[i].maxMem);
	    else
	        printf(" %6.6s", "-");

            if (hostinfo[i].maxSwap > 0)
	        printf(" %5dM",hostinfo[i].maxSwap);
            else
	        printf(" %6.6s", "-");

            printf(" %6.6s", server);
            printf(" (");

            first = TRUE;
	    for (j=0; j<hostinfo[i].nRes; j++) {
                if (! first)
                   printf(" ");
	        printf("%s", hostinfo[i].resources[j]);
                first = FALSE;
            }

            fputs(")\n", stdout);
        }


        _i18n_end ( ls_catd );
        exit(0);
    }