Versions Compared

Key

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

MCCS 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

...

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