Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Section
Column

MCCS CLI는 시스템의 명령 창 모드에서 MCCS서비스에 명령을 전달 할 수 있는 기능을 말합니다.
CLI는 명령 창 모드에서 MCCS 서비스에 명령을 전달 할 수 있는 기능을 말합니다.
MCCS가 제공하는 CLI 종류로는 로그에 임의의 로그를 추가 할 수 있는 mclog, 그룹에 명령을 내릴 수 있는 mcgroup, 리소스에 명령을 내릴 수 있는 mcres가 있습니다.
일반적으로 CLI는 스크립트(*.sh 등) 파일을 작성하여 다양한 명령을 MCCS 서비스에 전달하는 용도로 사용합니다.
CLI는 $MCCS_HOME\bin에 존재합니다CLI is the function to send a command to the MCCS service in the system's command window.
MCCS CLI is the function to send a command to the MCCS service in the system's command window mode.
MCCS provides the following types of CLI: mclog to add arbitrary log, mcgroup to command a group, and mcres to command the resource group.
In general, CLI prepares scripts (*.sh and etc) to send various commands to the MCCS service.
CLI is located in $MCCS_HOME\bin.

Note

After registering script file in PowerLinux MCCS and use CLI command, FullPath(MCCS_HOME/bin/mclog) must be used.

Column
width350px
Panel

이 페이지의 주요 내용Table of Contents

Table of Contents
maxLevel4

Info

 MCCS는 설치 시 최초 사용자 계정으로 ID는 When you install MCCS, the initial user account ID is set to 'admin' 비밀번호는 and the password is set to 'password'인 계정이 생성됩니다.
CLI 명령을 실행 시 ID 와 비밀번호를 입력하지 않으면, 위의 최초 사용자 계정의 ID와 비밀번호로 실행됩니다.
따라서 최초 사용자의 비밀번호 변경 시, 필수적으로 CLI 명령에 ID와 비밀번호를 옵션으로 입력해야 합니다When you run the CLI command, you need to enter the ID and the password. Otherwise, the above initial ID and password will be used.
Thus, when you change the initial user password, you must enter the ID/password in the CLI command as options.

Examples of script with MCCS CLI

Create CLITestGroup

Code Block
titleCreate CLITestGroup 생성
#!/bin/bash
# Create a new group
mclog="$MCCS_HOME/bin/mclog"
mcgroup="$MCCS_HOME/bin/mcgroup"
$mclog -n 192.168.100.2 -p 4321 -s CLITestGroup -l INFO -m "Start CLI Test Code."

end
{
	$mclog -n 192.168.100.2 -p 4321 -s CLITestGroup -l INFO -m "Stop CLI Test Code"
}
$mcgroup -state CLITestGroup
if [ $? -ne 0 ]
then
	end
fi
# Create CLITestGroup.
$mclog -n 192.168.100.2 -p 4321 -s CLITestGroup -l INFO -m "Creat new group since CLITestGroup does not exist."
$mcgroup -add CLITestGroup
$mcgroup -modify CLITestGroup -a TargetNodeList Beta,Alpha
$mclog -n 192.168.100.2 -p 4321 -s CLITestGroup -l INFO -m "CLITestGroup is created"

Create and Online CLITestProcess in CLITestGroup

Code Block
title그룹 CTITestGroup에 CLITestProcess 생성 및 온라인Create and Online CLITestProcess in CLITestGroup
#/bin/bash
# CLITestProcess를 시작합니다. 
mclog="$MCCS_HOME/bin/mclog" 
mcres="$MCCS_HOME/bin/mcres" 

$mclog -n 192.168.100.2 -p 4321 -s CLITestProcess -l INFO -m "Start CLI Test Code."

#  Test if CLITestProcess exist
$mcres -list CLITestProcess
if [ $? -ne 0 ]
then
	end 
else
	cliTestProcessCreat
fi

cliTestProcessCreat
{
	# CLITestProcess  After creating a resource, enable it.
	$mclog -n 192.168.100.2 -p 4321 -s CLITestProcess -l INFO -m "Create and cause CLITestProcess resource go online."

	$mcres -add CLITestProcess -t Process -g CLITestGroup 
	$mcres -modify CLITestProcess -a Path /usr/local/testprocess
	$mcres -modify CLITestProcess -a InteractWithDesktop true
	$mcres -enable CLITestProcess
	$mcres -online CLITestProcess -n Beta
}
end
{
	# Monitors group state.
	$mclog -n 192.168.100.2 -p 4321 -s CLITestGroup -l INFO -m "Terminates CLI Test Code."
	mclog -n 192.168.100.2 -p 4321 -s cli -l ERROR -m "mclog test message"
}