Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Section
PowerLinux MCCS에서 스크립트 파일 등록 후 CLI명령을 사용할 경우

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.

Column

MCCS CLI는 시스템의 명령 창 모드에서 MCCS서비스에 명령을 전달 할 수 있는 기능을 말합니다.

CLI는 명령 창 모드에서 MCCS 서비스에 명령을 전달 할 수 있는 기능을 말합니다.

MCCS가 제공하는 CLI 종류로는 로그에 임의의 로그를 추가 할 수 있는 mclog, 그룹에 명령을 내릴 수 있는 mcgroup, 리소스에 명령을 내릴 수 있는 mcres가 있습니다.

일반적으로 CLI는 스크립트(*.sh 등) 파일을 작성하여 다양한 명령을 MCCS 서비스에 전달하는 용도로 사용합니다.

CLI는 $MCCS_HOME\bin에 존재합니다.

Note
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

CLI를 이용한 script (CLI 활용 예)

...

Info

When you install MCCS, the initial user account ID is set to 'admin' and the password is set to 'password'.
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
# CLITestGroupCreate 그룹이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
# CLITestGroup을Create 생성합니다CLITestGroup.
$mclog -n 192.168.100.2 -p 4321 -s CLITestGroup -l INFO -m "CLITestGroup이 존재 하지 않아 그룹을 생성합니다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을 생성했습니다."

...

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."

#  CLITestProcess가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"
}