Appendix C- CLI(Command Line Interface) Example

Appendix C- CLI(Command Line Interface) Example

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

Create 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

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