[AIX 운영 체제와 장치 관리 7] AIX Runtime Expert (2) 프로파일 작성 — Profile·Catalog·SubCat·Parameter·Property·Seed·Target 요소
https://archive.horanglab.com/posts/aix-osdev-7
핵심 정리
- 매개변수는 조정 값, 구성 파일, 환경 변수, 사용자·장치·서브시스템 같은 대상(target)의 속성이며, 영역별로 프로파일에 모입니다. 예제 프로파일은
/etc/security/artex/samples에 두고 값을 비우며, artex.base.samples 설치 때 합쳐져 snap이 쓰는 default.xml이 됩니다(매개변수가 수천 개가 되거나 특정 시스템 전용인 프로파일은 넣지 않음). - 이름 규칙은 명령 이름을 따서 예제
commandProfile.xml, 카탈로그commandParam.xml이며.xml확장자만 필수입니다. - 작성 순서: 매개변수 목록 →
<Parameter name>→ 같은 카탈로그끼리<Catalog id>로 묶기 → reboot=true면 applyType=nextboot, 설정하지 않을 것은 readOnly=true, targetClass가 있으면 발견용 빈<Target class="" instance="">나 대상별<Parameter>→artexget -r로 시험. - Catalog id는 카탈로그 파일 이름(확장자 제외), version은 MM.mm으로 카탈로그와 맞아야 하며 다르면 0590-218 경고. Parameter 속성: name(필수), value, applyType(runtime·nextboot), reboot, readOnly, disruptive, setDiscover.
- runtime 값은 지금 값, nextboot 값은 다음 재부팅 뒤 값입니다(예: sysdumpdev의 type_of_dump). Seed는 get 때 SeedDef 규칙으로 매개변수를 발견하고, Target은 class와 instance나 match(정규식) 가운데 하나를 지정합니다.
| 항목 | 내용 |
|---|---|
| 버전 | AIX 6.1 (5.3판에 없음) |
| 원문 | Operating system and device management — 5.3판에 없음, 6.1판 70~82쪽 |
| 파일 | /etc/security/artex/samples, /etc/security/artex/catalogs, default.xml, chuserProfile.xml, vmoProfile.xml, noProfile.xml, secattrProfile.xml |
| 관련 명령어 | artexget -r, artexget -n, artexget -i, artexset -d, artexlist, snap |
프로그램이 쓸 수 있는 카탈로그와 프로파일을 더해 AIX Runtime Expert의 범위를 넓힐 수 있습니다. 새 카탈로그를 작성하기 전에 AIX Runtime Expert 개념을 알아야 합니다.
AIX Runtime Expert가 다루는 가장 작은 정보 단위는 매개변수입니다. 매개변수는 조정 값, 구성 파일, 환경 변수, 사용자·장치·서브시스템 같은 객체의 속성(이런 객체를 AIX Runtime Expert에서는 대상, target이라고 함)일 수 있습니다.
매개변수는 활동 영역(user, tcpip 등)에 따라 프로파일로 모입니다. 프로파일은 사용자와 AIX Runtime Expert 틀이 상호 작용하는 수단입니다. 프로파일은 시스템에서 매개변수 값을 가져와 프로파일을 돌려주는 artexget 명령의 입력입니다. (값을 포함한) 프로파일은 프로파일에서 읽은 값으로 매개변수를 설정하는 artexset 명령의 입력입니다.
AIX Runtime Expert 프로파일 작성 개념
AIX Runtime Expert 프로파일은 구성 매개변수 목록과, 선택적으로 매개변수 값과 사용 플래그가 든 XML 파일입니다.
명령행에서 AIX Runtime Expert 명령을 바로 쓸 때 프로파일은 조정하는 시스템에 있을 수 있습니다.
프로파일 위치
AIX Runtime Expert 예제 프로파일은 /etc/security/artex/samples 디렉터리에 있습니다.
AIX Runtime Expert가 지원할 새 카탈로그를 작성할 때는 artexget 명령의 입력으로 쓸 수 있는 예제 프로파일도 함께 작성하기를 권합니다. 예제 프로파일은 매개변수에 값을 할당하지 않은 읽기 전용 프로파일입니다. 기존 예제 프로파일은 /etc/security/artex/samples 디렉터리에 있습니다. 기본으로 artexlist 명령은 기본 디렉터리에 있는 프로파일만 나열하지만, ARTEX_PROFILE_PATH 환경 변수로 기본 디렉터리를 바꿀 수 있습니다. 이 환경 변수에는 콜론(:) 구분자로 여러 디렉터리를 지정할 수 있습니다.
artex.base.samples 파일 세트를 설치하는 동안 예제 디렉터리의 모든 프로파일이 합쳐져 snap 명령이 쓰는 default.xml 프로파일이 됩니다. default.xml 프로파일에 들어가면 안 되는 프로파일은 예제 디렉터리에 두지 않아야 합니다. default.xml 프로파일에 넣지 말아야 할 프로파일의 예는 (users를 대상 클래스로 쓰는 경우처럼) 매개변수가 수천 개가 될 수 있는 프로파일과 (vios 속성 프로파일처럼) 특정 시스템에서만 실행해야 하는 프로파일입니다.
프로파일 이름 짓기
AIX Runtime Expert 프로파일은 명령을 바탕으로 이름을 짓습니다.
프로파일은 보통 명령 하나나 명령 묶음을 중심으로 만듭니다. 카탈로그가 밀접하게 관련되어 있으면 프로파일에 여러 카탈로그가 들어갈 수 있습니다. 관례는 명령 이름을 바탕으로, 예제 프로파일은 commandProfile.xml, 카탈로그는 commandParam.xml로 짓는 것이지만 필수는 아닙니다. .xml 파일 확장자만 필수입니다.
프로파일 작성 과정
새 AIX Runtime Expert 프로파일을 작성하는 과정입니다.
새 AIX Runtime Expert 프로파일을 작성할 때는 다음 단계를 해야 합니다.
프로파일에 넣을 매개변수 목록을 만듭니다.
매개변수마다
<Parameter name="...">요소를 만들고, name 속성을 카탈로그 파일의<ParameterDef>요소에 쓴 이름으로 설정합니다.같은 카탈로그 파일에 정의된 모든 매개변수를 같은
<Catalog id="...">요소 안에 묶고, id 속성을 카탈로그 파일의<Catalog>요소에 쓴 id와 같게 설정합니다.각
<Parameter>요소에 대해 다음을 합니다.카탈로그 파일에서 매개변수가 reboot=
true로 정의되어 있으면 reboot=true와 applyType=nextboot속성을 더합니다.매개변수를 가져오기만 하고 설정하지 않아야 하면
readOnly=true속성을 더합니다.카탈로그 파일에서 매개변수가 비어 있지 않은 targetClass 속성으로 정의되어 있으면 다음을 합니다.
이 매개변수에 대상 발견을 원하면 이 매개변수의
<Parameter>요소를 하나만 정의하고, 그 요소에 특수 대상<Target class="" instance="">을 씁니다.이 매개변수에 특정 대상을 정의해야 하면 대상마다
<Parameter>요소를 하나씩 정의합니다. 각<Parameter>요소 아래에 대상을 완전히 지정하는 알맞은<Target class="..." instance="..." />요소를 정의합니다.
artexget -r명령을 실행해 프로파일을 시험합니다.
AIX Runtime Expert 프로파일 요소
<Profile> 요소
<Profile> 요소는 모든 프로파일 파일의 루트 요소입니다.
구문 — 다음 속성을 지원합니다.
표 2. 속성
| 속성 | 필수 | 형 | 설명 |
|---|---|---|---|
| origin | 아니요 | string | 프로파일의 출처 |
| date | 아니요 | dateTime | 프로파일을 만들거나 마지막으로 고친 날짜. 형식은 YYYY-MM-DDThh:mm:ss입니다. |
| readOnly | 아니요 | boolean | 이 프로파일을 set 작업에 쓸 수 있는지 나타냅니다. 기본값은 false입니다. |
| version | 아니요 | string | 프로파일의 버전 번호 |
다음 자식 요소를 지원합니다.
표 3. 자식 요소
| 자식 요소 | 필수 | 개수 | 설명 |
|---|---|---|---|
<ShortDescription> |
아니요 | 0~1 | 카탈로그의 짧은 설명(원문 그대로, 프로파일 설명을 뜻함) |
<Description> |
아니요 | 0~1 | 카탈로그의 긴 설명 |
<Comments> |
아니요 | 0~1 | 사용자가 준 주석 |
<Catalog> |
아니요 | 0~여러 개 | 프로파일 작업을 처리하는 데 필요한 카탈로그 |
속성 — origin 속성은 정보용 속성이며 다음 값을 할당할 수 있습니다.
- 예제 프로파일을 만들 때는 origin 속성을
reference로 설정해야 합니다. - artexget 명령으로 프로파일을 만들면 origin 속성이 자동으로
get으로 설정됩니다.
자식 요소 — <Comments> 요소는 다른 목적으로 예약된 선택 문자열입니다. 프로파일을 직접 만들 때는 이 요소를 쓰면 안 되며, 기본 AIX Runtime Expert 명령은 이 요소를 쓰지 않습니다.
예:
- 빈 예제 프로파일은 다음과 같습니다.
<?xml version="1.0" encoding="UTF-8"?>
<Profile origin="reference" version="2.0.0" readOnly="true">
</Profile>
artexget -r /etc/security/artex/samples/smtctmProfile.xml명령은 다음 예와 비슷한 프로파일을 출력합니다.
<?xml version="1.0" encoding="UTF-8"?>
<Profile origin="get" version="2.0.1" date="2010-09-29T07:50:56Z">
<Catalog id="smtctlParam" version="2.0">
<Parameter name="enableSMT" value="1"/>
</Catalog>
</Profile>
<Description>과 <ShortDescription> 요소
<Description>과 <ShortDescription> 요소로 프로파일과 매개변수의 설명을 줄 수 있습니다.
구문 — <ShortDescription> 요소의 부모 요소는 <Profile> 요소입니다. <Description> 요소의 부모 요소는 <Profile> 요소나 <Parameter> 요소입니다. 두 요소의 형식은 같습니다. <Description> 요소가 담는 텍스트는 XML 태그의 문자열 내용입니다.
사용법 — 프로파일 파일의 설명은 지금 AIX Runtime Expert 틀이 쓰지 않습니다. AIX Runtime Expert 명령은 입력 프로파일에 들어 있는 주석을 무시합니다.
예 — <Description>과 <ShortDescription> 요소의 예입니다.
<ShortDescription>
Short summary of field contents.
</ShortDescription>
<Description>
This text field can be used to display in full detail the use of the parent element.
</Description>
<Catalog> 요소
<Catalog> 요소는 자식 <Parameter> 요소의 정의가 든 카탈로그 파일의 이름을 나타냅니다.
구문 — 부모 요소: <Profile>. 다음 속성을 지원합니다.
표 4. 속성
| 속성 | 필수 | 형 | 설명 |
|---|---|---|---|
| id | 예 | string | 카탈로그 id. 이 이름은 시스템에서 고유해야 합니다. |
| version | 아니요 | string | 이 프로파일을 만드는 데 쓴 카탈로그의 버전 |
다음 자식 요소를 지원합니다.
표 5. 자식 요소
| 자식 요소 | 필수 | 개수 | 설명 |
|---|---|---|---|
<Parameter> |
아니요 | 0~여러 개 | 카탈로그에 든 매개변수 |
<SubCat> |
아니요 | 0~여러 개 | 카탈로그에 든 하위 범주 |
<Seed> |
아니요 | 0~여러 개 | 카탈로그에 든 seed |
속성:
- id 속성:
<Catalog>요소 아래 나열한 매개변수를 정의하는 카탈로그의 이름으로 설정해야 합니다. id 속성은 디스크에 있는 카탈로그 파일의 기본 이름에서 .xml 확장자를 뗀 것입니다. 예를 들어 프로파일은<Catalog id="commandParam">요소로commandParam.xml카탈로그 파일을 가리킵니다. 기본으로 카탈로그 파일은/etc/security/artex/catalogs디렉터리에서 찾습니다. 그러나 root 사용자에 한해ARTEX_CATALOG_PATH환경 변수로 다른 디렉터리를 찾게 할 수 있습니다. 이 환경 변수에는 콜론(:) 구분자로 여러 디렉터리를 지정할 수 있습니다. - version 속성: MM.mm 형식이며 MM은 주 번호, mm은 부 번호입니다. version 속성은 가리키는 카탈로그 파일의 버전과 맞아야 합니다(AIX Runtime Expert 카탈로그 작성 절의
<Catalog>요소 참고). 버전이 틀린 카탈로그를 가리키는 프로파일에 AIX Runtime Expert 명령을 실행하면 다음 경고 메시지가 나옵니다.
0590-218 Catalog version differs from the one referenced in profile
Local catalog version is ’2.1’. Version used to build profile was ’2.0’
사용법 — <Catalog> 요소는 나열한 seed와 매개변수의 정의가 든 카탈로그 파일을 식별합니다. 프로파일의 모든 seed와 매개변수 요소는 알맞은 <Catalog> 요소 안에 있어야 합니다.
프로파일 하나가 여러 카탈로그를 가리킬 수 있습니다. 예를 들어 default.xml 프로파일은 artex.base.sample 파일 세트를 설치하는 동안 고른 다른 예제 프로파일을 합쳐 만듭니다.
예 — 보안 속성 프로파일 secattrProfile.xml은 카탈로그 세 개를 쓰며, 카탈로그마다 보안 표 하나를 다룹니다.
<Profile origin="reference" readOnly="true" version="2.0.0">
<Catalog id="privcmdParam" version="2.0"
<Parameter name="privatecommands" />
</Catalog>
<Catalog id="privdevParam" version="2.0">
<Parameter name="privatedevices"/>
</Catalog>
<Catalog id="privfileParam" version="2.0">
<Parameter name="privatefiles" />
</Catalog>
</Profile>
<SubCat> 요소
<SubCat> 요소는 <Catalog> 요소 아래 논리 하위 범주를 만드는 수단을 제공합니다.
구문 — 부모 요소: <Catalog>, <SubCat>. 다음 속성을 지원합니다.
표 6. 속성
| 속성 | 필수 | 형 | 설명 |
|---|---|---|---|
| id | 예 | string | 하위 범주 이름. 이 이름은 같은 <Catalog> 요소 안에서 고유해야 합니다. |
다음 자식 요소를 지원합니다.
표 7. 자식 요소
| 자식 요소 | 필수 | 개수 | 설명 |
|---|---|---|---|
<Parameter> |
아니요 | 0~여러 개 | 매개변수 이름을 담습니다. |
<SubCat> |
아니요 | 0~여러 개 | 중첩 하위 범주 |
속성 — id 속성은 카탈로그 안에서 하위 범주를 고유하게 식별합니다. 같은 <Catalog> 요소 아래에서 쓰지 않는 한, 프로파일에는 같은 id의 하위 범주가 여럿 있을 수 있습니다.
자식 요소 — <SubCat> 요소는 다른 <SubCat>을 자식 요소로 가질 수 있습니다. 정의할 수 있는 중첩 하위 범주 수에는 제한이 없습니다.
사용법 — 하위 범주는 읽기 쉽게 하려고 넣는 것일 뿐입니다. 매개변수를 처리하는 방식에는 영향을 주지 않습니다.
예 — noProfile.xml 프로파일에는 하위 범주가 여럿 있습니다. 다음은 그 예입니다.
<Profile origin="reference" readOnly="true" version="2.0.0">
<Catalog id="noParam" version="2.0">
<SubCat id="general_network"
<Parameter name="fasttimo"/>
<Parameter name="nbc_limit"/>
</SubCat>
<SubCat id="tcp_network">
<Parameter name="clean_partial_conns"/>
<Parameter name="delayack"/>
</SubCat>
<SubCat id="restricted">
<Parameter name="extendednetstats" readOnly="true"/>
<Parameter name="inet_stack_size" readOnly="true"/>
</SubCat>
</Catalog>
</Profile>
<Parameter> 요소
<Parameter> 요소는 구성 매개변수를 정의합니다.
구문 — 다음 속성을 지원합니다.
표 8. 속성
| 속성 | 필수 | 형 | 설명 |
|---|---|---|---|
| name | 예 | string | 매개변수 이름. 이 이름은 카탈로그 안에서 고유해야 합니다. |
| value | 아니요 | string | 정의되어 있다면 매개변수의 값 |
| applyType | 아니요 | string | 플래그를 지정하지 않았을 때 매개변수의 runtime 값과 next boot 값 가운데 어느 것을 가져오거나 설정할지 지정합니다. 기본값은 runtime입니다. |
| reboot | 아니요 | boolean | true이면 값 변경이 적용되기 전에 재부팅이 필요하다는 뜻입니다. 기본값은 false입니다. |
| readOnly | 아니요 | boolean | 매개변수 값을 설정할 수 없는지 지정합니다. 기본값은 false입니다. |
| disruptive | 아니요 | boolean | 매개변수를 설정하는 방법에 중단을 일으키는 제약이 있는지 지정합니다. 기본값은 false입니다. |
| setDiscover | 아니요 | boolean | set 방법이 대상 클래스의 발견된 모든 인스턴스에 값을 설정해야 하는지 지정합니다. 기본값은 false입니다. |
다음 자식 요소를 지원합니다.
표 9. 자식 요소
| 자식 요소 | 필수 | 개수 | 설명 |
|---|---|---|---|
<Value> |
아니요 | 0~1 | 매개변수의 값 |
<Target> |
아니요 | 0~여러 개 | 매개변수가 적용되는 대상 |
<Description> |
아니요 | 0~1 | 매개변수의 설명 |
<Property> |
아니요 | 0~여러 개 | 매개변수의 속성(property) |
속성(표 10):
- name: 매개변수 이름은
<Parameter>요소의 유일한 필수 속성입니다. 부모<Catalog>요소에 지정한 카탈로그 이름과 함께, 매개변수 이름은 카탈로그 파일의 매개변수 정의를 고유하게 식별합니다. - value: 매개변수 값은 속성이나 자식 요소로 지정할 수 있습니다.
- applyType:
runtime(기본값)이나nextboot값을 받을 수 있습니다. 이 속성은 매개변수를 처리하는 데 쓸 명령을 정합니다. set 작업에서 applyType=runtime은 카탈로그 파일의<Set type="permanent">명령으로 매개변수를 설정한다는 뜻입니다. applyType=nextboot은 대신<Set type="nextboot">명령을 쓴다는 뜻입니다. get 작업에서-p플래그를 쓰면 applyType=runtime은 카탈로그 파일의<Get type="current">명령으로 매개변수를 얻는다는 뜻입니다. applyType=nextboot은 대신<Get type="nextboot">명령을 쓴다는 뜻입니다. reboot 속성이 true면 applyType 속성은nextboot이어야 합니다. - reboot: 기본값은 false입니다. true로 설정하면 매개변수 변경이 적용되기 전에 시스템을 재부팅해야 한다는 뜻입니다. 이 속성은 카탈로그 파일의 해당
<ParameterDef>요소에 정의한 reboot 속성과 맞아야 합니다. 이 속성이 true면 applyType 속성은nextboot이어야 합니다. reboot 속성이 설정된 매개변수를 설정하면 재부팅 작업이 필요하다는 경고가 사용자에게 나옵니다:0590-206 A manual post-operation is required for the changes to take effect Please reboot the system. 매개변수 값 변경이 다음 재부팅 뒤에야 적용될 때만 reboot 속성을 true로 설정합니다. - readOnly: 매개변수 값을 artexget 명령으로 읽을 수는 있지만, artexset 명령으로 설정하지 않고 artexdiff 명령의 실시간 값 비교에도 넣지 않는다는 뜻입니다. 기본값은 false입니다. readOnly 속성을 true로 설정할 만한 상황은 다음과 같습니다.
- 매개변수가 정적이라 값을 바꿀 수 없습니다(예: vmo 명령의
memory_frames매개변수). - 매개변수 접근이 제한되어 있고 사용자가 자동 절차로 바꾸는 것을 권하지 않습니다. 이 경우 카탈로그 파일에서 이 매개변수의 set 구성 방법을 정의하되, 시스템 관리자가 매개변수를 설정하려면 프로파일에서 readOnly 속성을 직접 지워야 합니다.
- 매개변수가 정적이라 값을 바꿀 수 없습니다(예: vmo 명령의
- setDiscover: true로 설정하면, artexset 명령을
-d플래그로 부를 때 discover 명령을 불러 대상의 모든 인스턴스를 발견하고 모두 프로파일에 저장된 값으로 설정해야 한다는 뜻입니다. 기본값은 false입니다. true 값은 카탈로그 파일에서 매개변수에 대상 클래스가 정의되어 있을 때만 의미가 있습니다. 예제 프로파일을 만들 때는 이 속성을 지정하지 않습니다. 필요하다고 판단하면 숙련된 사용자가 직접 더해야 합니다.
그 밖의 속성 — type과 disruptive 속성은 artexget 명령을 -i 플래그로 부를 때 자동으로 설정되는 정보용 속성입니다. 예제 프로파일을 만들 때는 이 속성을 넣지 않습니다.
예:
- 다음 예는
vmoProfile.xml예제 카탈로그(원문 그대로, 예제 프로파일)에서 뽑은 것으로, 여러 선택 속성을 보여 줍니다.
<Profile origin="reference" readOnly="true" version="2.0.0">
<Catalog id="vmoParam" version="2.1">
<Parameter name="nokilluid"/>
<Parameter name="memory_frames" readOnly="true"/>
<Parameter name="kernel_heap_psize" reboot="true" applyType="nextboot"/>
</Catalog>
</Profile>
- 예 1의 프로파일에
artexget -r명령을 실행하면 다음 프로파일이 나옵니다.
<Profile origin="get" version="2.0.1" date="2011-03-24T13:41:01Z">
<Catalog id="vmoParam" version="2.1">
<Parameter name="nokilluid" value="0"/>
<Parameter name="memory_frames" value="393216" readOnly="true"/>
<Parameter name="kernel_heap_psize" value="4096" applyType="nextboot" reboot="true"/>
</Catalog>
</Profile>
매개변수 값
매개변수 값은 짧으면 속성으로, 아니면 <Parameter> 요소의 자식 요소로 프로파일에 설정할 수 있습니다.
쓰임 — 예제 프로파일을 작성할 때는 매개변수에 값을 할당하지 않아야 합니다. 매개변수 값이 있으면 artexget 명령을 실행해 얻는 프로파일에 자동으로 들어갑니다.
runtime 값과 nextboot 값 — runtime과 nextboot 값 개념은 AIX Runtime Expert 틀의 중요한 부분입니다.
매개변수의 runtime 값은 artexget 명령을 실행할 때 시스템에서 가져온 현재 값입니다. nextboot 값은 시스템을 다음에 재부팅한 뒤 매개변수가 가질 값입니다.
예를 들어 sysdumpdevProfile.xml 프로파일의 type_of_dump 매개변수를 봅니다. 이 매개변수의 현재(runtime) 값은 traditional이나 firmware-assisted일 수 있습니다. 이 값을 (artexset 명령이나 sysdumpdev 명령으로 직접) 바꾸면 다음 재부팅 때까지 적용되지 않습니다. 그러면 이 매개변수의 nextboot 값이 바뀐 값이 됩니다.
<Parameter name="type_of_dump" applyType="nextboot" reboot="true" />
예 — 다음 예는 값을 속성으로 지정한 매개변수와 자식 요소로 지정한 매개변수를 보여 줍니다.
<Profile origin="get" version="2.0.1" date="2010-09-28T12:30:03Z">
<Catalog id="login.cfgParam" version="2.0">
<Parameter name="shells">
<Value>
/bin/sh,/bin/bsh,/bin/csh,/bin/ksh,/bin/tsh,
/bin/ksh93,/usr/bin/sh,/usr/bin/bsh,/usr/bin/csh,
/usr/bin/ksh,/usr/bin/tsh,/usr/bin/ksh93,
/usr/bin/rksh,/usr/bin/rksh93,
/usr/sbin/uucp/uucico,/usr/sbin/sliplogin,
/usr/sbin/snappd
</Value>
</Parameter>
<Parameter name="maxlogins" value="32767"/>
</Catalog>
</Profile>
<Property> 요소
<Property> 요소는 매개변수 속성(property)에 값을 할당합니다.
구문 — 부모 요소: <Parameter>. 다음 속성을 지원합니다.
표 11. 속성
| 속성 | 필수 | 형 | 설명 |
|---|---|---|---|
| name | 예 | string | property의 이름 |
| value | 아니요 | string | property의 값 |
사용법 — <Property> 요소는 부모 요소의 property 이름에 값을 할당합니다. 이 값은 명령행 생성 중에 %p[name] 시퀀스를 펼칠 때 씁니다.
<Property> 요소는 보통 프로파일에 직접 더하지 않습니다. artexget -r과 artexget -n 명령을 실행할 때, 카탈로그 파일의 해당 <Property> 요소(원문 그대로, PropertyDef)에 정의한 명령을 바탕으로 출력 프로파일에 자동으로 들어갑니다.
예 — 다음 예는 netaddr 매개변수의 nodeId property를 설정합니다. property 값은 artexget -r 명령이 가져오며 uname -f 명령의 출력입니다.
<Parameter name="netaddr" value="172.16.128.13">
<Target class="device" instance="en0"/>
<Property name="nodeId" value="8000108390E00009"/>
</Parameter>
<Seed> 요소
<Seed> 요소는 <Get> 작업 중에 <ParameterDef> 요소 하나 이상으로 펼쳐지는 seed를 정의합니다.
구문 — 부모 요소: <Catalog>. 다음 속성을 지원합니다.
표 12. 속성
| 속성 | 필수 | 형 | 설명 |
|---|---|---|---|
| name | 예 | string | 카탈로그 파일의 SeedDef 요소와 맞는 seed 요소의 이름 |
다음 자식 요소를 지원합니다.
표 13. 자식 요소
| 자식 요소 | 필수 | 개수 | 설명 |
|---|---|---|---|
<Parameter> |
아니요 | 0~여러 개 | 매개변수 이름으로 발견된 매개변수를 거릅니다. |
<Target> |
아니요 | 0~여러 개 | 대상으로 발견된 매개변수를 거릅니다. |
사용법 — <Seed> 요소는 <Get> 작업 중에 매개변수를 동적으로 발견합니다.
artexget 명령을 실행하면 입력 프로파일의 각 <Seed> 요소가 <Parameter> 요소 하나 이상으로 펼쳐집니다. 프로파일은 카탈로그 파일의 맞는 <SeedDef> 요소에 정의한 규칙에 따라 펼쳐집니다. 이 과정을 매개변수 발견이라고 합니다. 매개변수 발견 과정이 끝나면 artexget 명령은 펼친 프로파일로 평소대로 진행합니다.
선택 <Parameter>와 <Target> 자식 요소는 발견된 매개변수를 거르는 데 씁니다. <Parameter> 하위 요소에 정의한 조건과 맞지 않는 발견된 매개변수는 버립니다. 또 <Target> 하위 요소에 정의한 조건과 맞지 않는 대상에 적용되는 매개변수도 버립니다.
예:
이 예는 devSeed 카탈로그로 모든 장치의 모든 속성을 발견하는 데 쓸 수 있는 seed를 정의합니다.
<?xml version="1.0" encoding="UTF-8"?>
<Catalog id="devSeed" version="3.0">
<SeedDef name="devAttr">
<Discover>
<Command>
/usr/sbin/lsdev -F ’name class subclass type’ |
while read DEV CLASS SUBCLASS TYPE
do
CAT=devParam.$CLASS.$SUBCLASS.$TYPE
/usr/sbin/lsattr -F attribute -l $DEV |
while read PAR
do
echo "device=$DEV $CAT $PAR"
done
done
</Command>
Mask target="1" catalog="2" name="3">(.*) (.*) (.*)</Mask>
</Discover>
</SeedDef>
</Catalog>
- 다음 프로파일로 지원되는 모든 장치의 지원되는 모든 속성을 발견할 수 있습니다.
<?xml version="1.0" encoding="UTF-8"?>
<Profile>
<Catalog id="devSeed" version="3.0">
<Seed name="devAttr"/>
</Catalog>
</Profile>
- 같은 카탈로그로
<Target>필터를 써서 모든 이더넷 어댑터의 지원되는 모든 속성을 발견할 수 있습니다.
<?xml version="1.0" encoding="UTF-8"?>
<Profile>
<Catalog id="devSeed" version="3.0">
<Seed name="devAttr">
<Target class="device" match="^en[0-9]+$"/>
</Seed>
</Catalog>
</Profile>
<Parameter>필터를 더해 모든 이더넷 어댑터의 netaddr, netaddr6, alias, alias6 속성만 가져올 수 있습니다.
<?xml version="1.0" encoding="UTF-8"?>
<Profile>
<Catalog id="devSeed" version="3.0">
<Seed name="devattr">
<Parameter match="^(netaddr|alias)6?$"/>
<Target class="device" match="^en[0-9]+$"/>
</Seed>
</Catalog>
</Profile>
<Target> 요소
<Target> 요소는 매개변수가 적용되는 대상 클래스의 인스턴스를 정의합니다.
구문 — 부모 요소: <Parameter>. 같은 카탈로그의 같은 매개변수가 여러 번 나오는 것은, 그것이 대상의 서로 다른 인스턴스에 적용될 때만 허용됩니다. 다음 속성을 지원합니다.
표 14. 속성
| 속성 | 필수 | 형 | 설명 |
|---|---|---|---|
| class | 예 | string | 대상 클래스의 이름 |
| instance | 아니요(주) | string | 클래스 인스턴스의 이름 |
| match | 아니요(주) | string | 발견된 인스턴스 이름에 적용할 정규식 |
주: instance와 match 속성 가운데 하나만, 그리고 반드시 하나를 지정해야 합니다.
쓰임 — 일부 매개변수는 시스템 전체가 아니라 특정 객체에 적용됩니다. 예를 들어 chuserProfile.xml 프로파일에 지정한 사용자의 home 디렉터리가 그렇습니다. 이 매개변수는 특정 적재 모듈(files, LDAP)의 특정 사용자(root, guest)에 적용됩니다. 이 예에서 사용자와 모듈은 두 대상 클래스입니다. home 매개변수는 이 대상 클래스의 특정 인스턴스, 예를 들어 user 클래스의 guest 인스턴스와 module 클래스의 files 인스턴스에 적용됩니다.
class와 instance 속성이 모두 빈 문자열이면, 이런 프로파일에 artexget 명령을 실행할 때 이 매개변수에 대해 발견을 합니다. 해당 카탈로그 파일에 선언한 발견 방법을 실행하고, 발견한 매개변수 인스턴스마다 출력 프로파일에 매개변수를 만듭니다. 예 1을 봅니다.
class와 instance 속성을 모두 지정하면 대상이 완전히 지정되며, 매개변수는 대상 클래스의 지정한 인스턴스에만 적용됩니다. 예 2를 봅니다.
class와 match 속성을 모두 지정하면 위처럼 발견을 하되, 이름이 match 속성에 지정한 정규식과 맞는 대상 인스턴스만 발견합니다. 예 3을 봅니다.
예제 프로파일을 작성할 때는 class와 instance 속성을 비워 두어야 합니다. 그러면 artexget 명령은 빈 대상 클래스를 만날 때 값을 가져오기 전에 그 대상 클래스의 인스턴스 목록(시스템의 모든 사용자나 서브시스템)을 발견합니다.
발견하지 않은 대상 클래스에 artexset 명령을 실행하면 경고가 나옵니다.
0590-216 Some parameters in the profile require a target discovery and will be ignored
예:
- 발견 전 대상이 있는 프로파일의 예는 사용자의 홈 디렉터리를 정의하는
chuserProfile.xml프로파일입니다. 다음은 예제 프로파일입니다.
<Profile version="2.0.0" origin="reference" readOnly="true">
<Catalog id="chuserParam" version="2.0">
<Parameter name="home">
<Target class="" instance=""/>
</Parameter>
</Catalog>
</Profile>
- 발견한 뒤
chuserProfile.xml프로파일에는 발견된 각 적재 모듈의 발견된 사용자마다 home 매개변수 사본이 들어 있습니다.
<Profile version="2.0.0" origin="get">
<Catalog id="chuserParam" version="2.0">
<Parameter name="home" value="/">
<Target class="user" instance="root"/>
<Target class="module" instance="files"/>
</Parameter>
<Parameter name="home" value="/etc">
<Target class="user" instance="daemon"/>
<Target class="module" instance="files"/>
</Parameter>
...
</Catalog>
</Profile>
- 다음 프로파일은 match 속성으로 file 모듈에서 이름이 u로 시작하는 모든 사용자의 홈 디렉터리를 발견합니다.
<Profile version="2.0.0" origin="reference" readOnly="true"
<Catalog id="chuserParam" version="2.0">
<Parameter name="home">
<Target class="user" match="^u"/>
<Target class="module" instance="files"/>
</Parameter>
</Catalog>
</Profile>
영어 원문
Writing AIX Runtime Expert profiles
You can expand the scope of AIX Runtime Expert by adding catalogs and profiles that the program can use. You must be familiar with AIX Runtime Expert concepts before attempting to write new catalogs.
The smallest piece of information handled by AIX Runtime Expert is a parameter. Parameters can be tunable, configuration files, environment variables, properties of objects such as users, devices or subsystems (such objects are called targets in the AIX Runtime Expert context).
Parameters are aggregated into profiles according to the domain of activity (such as user, tcpi). Profiles are the intended means of interaction between the users and the AIX Runtime Expert framework. Profiles are input to the artexget command that retrieve the parameter value on the system and return a profile. Profiles (including values) are input to the artexset command that set the parameters to the value read into the profile.
Concepts in writing AIX Runtime Expert profile
AIX Runtime Expert profiles are XML files that contain a list of configuration parameters and optionally the parameter values and the usage flags.
Profiles can be located on the system being tuned when using the AIX Runtime Expert commands directly on the command line.
Profile locations:
AIX Runtime Expert sample profiles are located in the directory /etc/security/artex/samples.
When you are writing a new catalog for the AIX Runtime Expert to support, it is recommended that you also write a sample profile that can be used as an entry for the artexget command. A sample profile is a read-only profile with no values assigned to the parameters. Existing sample profiles are located in the /etc/security/artex/samples directory. By default, the artexlist command lists only the profiles located in the default directory, but the default directory can be modified by setting the ARTEX_PROFILE_PATH environment variable. Multiple directories can be specified in this environment variable by using the : separator.
All profiles from the samples directory are merged during the installation of the artex.base.samples fileset, to form the default.xml profile that is used by the snap command. A profile that should not be part of the default.xml profile should not be delivered in the samples directory. Example of profiles that should not be included in the default.xml profile are the profiles that have the potential to include thousands of parameters (for example if it uses users as a target class) and profiles that should be run only on specific systems (for instance the vios attributes profile).
Profile naming:
AIX Runtime Expert profiles are named based on the commands.
Profiles are usually built around a single command or a set of commands. Profiles may include several catalogs if the catalogs are closely related. The convention is to name the files based on a command say, commandProfile.xml for the sample profile and commandParam.xml for the catalog, but this is not mandatory. Only the.xml file extension is required.
Profile process:
Discusses the process to write a new AIX Runtime Expert profile.
The following steps are required to be performed when writing a new AIX Runtime Expert profile:
Make a list of the parameters you want in the profile.
Create an
<Parametername=“...”> element for each of the parameters, setting the name attribute to the name used in the catalog file<ParameterDef>element.Group all parameters defined in a same catalog file inside the same
<Catalogid=“...”> element, setting the id attribute to the same id used in the catalog file<Catalog>element.For each
<Parameter>element, do the following: a. If the parameter is defined with the reboot=truein the catalog file, add the reboot=trueand applyType=nextbootattributes. b. If the parameter must be only captured and not set, add thereadOnly=trueattribute. c. If the parameter is defined with a non-empty targetClass attribute in the catalog file, do the following: 1) If target discovery is desired for this parameter, then define a single<Parameter>element for this parameter and use the special<Targetclass=“” instance=“” > target for this element. 2) If specific targets need to be defined for this parameter, then define one<Parameter>element for each target. Under each<Parameter>element, define the appropriate<Targetclass=“...” instance=“...” /> elements to specify the target completely.Test the profile by running the artexget –r command.
AIX Runtime Expert profile elements
<Profile> element:
The <Profile> element is the root element for all profile files.
Syntax
The following attributes are supported:
Table 2. Attributes
| Attribute | Required | Type | Description |
|---|---|---|---|
| origin | no | string | Origin of the profile. |
| date | no | dateTime | Date of creation or last modification of the profile. Format is YYYY-MM- DDThh:mm:ss. |
| readOnly | no | boolean | Tells whether this profile can be used in a set operation. Default value isfalse. |
| version | no | string | Version number of the profile. |
The following child elements are supported:
Table 3. Child Elements
| Child element | Required | Number | Description |
|---|---|---|---|
<ShortDescription> |
no | 0 - 1 | Short textual description of the catalog. |
<Description> |
no | 0 – 1 | Long textual description of the catalog. |
<Comments> |
no | 0 – 1 | User-provided comments. |
<Catalog> |
no | 0 – any | Catalog required to handle the operations on a profile. |
Attributes
The origin attribute
The origin attribute is an informational attribute that can be assigned the following values:
When creating a sample profile, the origin attribute must be set to
reference.When a profile is created by using the artexget command, the origin attribute is automatically set to
get.
Child elements
The <Comments> element is an optional string reserved for other purposes. This element must not be used when a profile is created manually, and it not used by the base AIX Runtime Expert commands.
Examples
- An empty sample profile would look like this:
<?xml version="1.0" encoding="UTF-8"?>
<Profile origin="reference" version="2.0.0" readOnly="true">
</Profile>
- The artexget -r /etc/security/artex/samples/smtctmProfile.xml command outputs a profile similar to following example:
<?xml version="1.0" encoding="UTF-8"?>
<Profile origin="get" version="2.0.1" date="2010-09-29T07:50:56Z">
<Catalog id="smtctlParam" version="2.0">
<Parameter name="enableSMT" value="1"/>
</Catalog>
</Profile>
Related information
The <Catalog> element
The <Description> and <ShortDescription> element.
<Description> and <ShortDescription> elements:
The <Description> and the <ShortDescription> elements can be used to provide a textual description for profiles and parameters.
Syntax
The parent element of the <ShortDescription> element is:
<Profile>element
The parent element of the <Description> element can be:
<Profile>element<Parameter>element
Both the <Description> and <ShortDescription> elements have the same format. The text contained by the <Description> element is the string content of the XML tag.
Usage
Descriptions in profile files are not currently used by the AIX Runtime Expert framework. AIX Runtime Expert commands ignore any comments included in the input profile.
Examples
Following is an example of the <Description> and <ShortDescription> elements:
<ShortDescription>
Short summary of field contents.
</ShortDescription>
<Description>
This text field can be used to display in full detail the use of the parent element.
</Description>
Related information
The <Profile> element.
The <Parameter> element.
<Catalog> element:
The <Catalog> element indicates the name of the catalog file that contains the definitions for the child <Parameter> elements.
Syntax
Parent element: <Profile>
The following attributes are supported:
Table 4. Attributes
| Attribute | Required | Type | Description |
|---|---|---|---|
| id | yes | string | Specifies the catalog id. This name should be unique on the system. |
| version | no | string | Specifies the version of the catalog used to build this profile. |
The following child elements are supported:
Table 5. Child elements
| Child element | Required | Number | Description |
|---|---|---|---|
<Parameter> |
no | 0 – any | Parameter included in the catalog. |
<SubCat> |
no | 0 – any | Subcategory included in the catalog. |
<Seed> |
no | 0 – any | Seed included in the catalog. |
Attributes
id attribute
The id attribute must be set to the name of the catalog that defines the parameters listed under the <Catalog> element. The id attribute is the base name of the catalog file on the disk, with the .xml extension removed. For example, a profile will use the <Catalog id=“commandParam”> element to reference the commandParam.xml catalog file.
By default, the catalog files are searched under the/etc/security/artex/catalogs directory. However it is possible, for the root user only, to search other directories by setting the ARTEX_CATALOG_PATH environment variable. Multiple directories can be specified in this environment variable using the : separator.
version attribute
The version attribute is written as MM.mm where MM is the major number and mm is the minor number. The version attribute must match the version of the referenced catalog file (see The <Catalog> element in the section Writing AIX Runtime Expert catalogs). If an AIX Runtime Expert command is run on a profile that references a catalog with the incorrect version, the following warning message is displayed:
0590-218 Catalog version differs from the one referenced in profile
Local catalog version is ’2.1’. Version used to build profile was ’2.0’
Usage
The <Catalog> element identifies the catalog file that contains the definition of the listed seeds and parameters. All seeds and parameter elements in a profile must be located in the appropriate <Catalog> element.
A profile may reference several catalogs. For example, the default.xml profile is built during the installation of the artex.base.sample fileset by merging a select set of other sample profiles.
Examples
The security attributes profile secattrProfile.xml uses three catalogs, each catalog handling, one of the security tables:
<Profile origin="reference" readOnly="true" version="2.0.0">
<Catalog id="privcmdParam" version="2.0"
<Parameter name="privatecommands" />
</Catalog>
<Catalog id="privdevParam" version="2.0">
<Parameter name="privatedevices"/>
</Catalog>
<Catalog id="privfileParam" version="2.0">
<Parameter name="privatefiles" />
</Catalog>
</Profile>
Related information
The <Catalog> element (in catalog files).
<SubCat> element:
The <SubCat> element provides a means to create logical subcategories under a <Catalog> element.
Syntax
Parent element: <Catalog>, <SubCat>
The following attributes are supported:
Table 6. Attributes
| Attribute | Required | Type | Description |
|---|---|---|---|
| id | yes | string | Specifies the subcategory name. This name should be unique within a same <Catalog> element. |
The following child elements are supported
Table 7. Child Elements
| Child element | Required | Number | Description |
|---|---|---|---|
<Parameter> |
no | 0 – any | Contains a parameter name. |
<SubCat> |
no | 0 – any | Nested subcategory |
Attributes
The id attribute uniquely identifies a subcategory within a catalog. A profile may include several subcategories with the same id, provided that these are not used under the same <Catalog> element.
Child elements
A <SubCat> element may have another <SubCat> as a child element. There is no limit to the number of nested subcategories you can define.
Usage
Subcategories are only included for readability. They do not affect the way parameters are handled.
Examples
The noProfile.xml profile includes several subcategories. Following is an example:
(16줄짜리 예는 위 한글 본문에 그대로 실었습니다.)
Related information
The <Parameter> element.
<Parameter> element:
The <Parameter> element defines a configuration parameter.
Syntax
The following attributes are supported:
Table 8. Attributes
| Attribute | Required | Type | Description |
|---|---|---|---|
| name | yes | string | Specifies the name of the parameter. This name must be unique within a catalog. |
| value | no | string | Value of the parameter, if it is defined. |
| applyType | no | string | Specifies whether the runtime or next boot value of the parameter must be retrieved or set if no flag is specified. Default value is runtime. |
| reboot | no | boolean | When true, indicates that a reboot is required before a value change is effective. Default value is false. |
| readOnly | no | boolean | Specifies whether the value of the parameter cannot be set. Default: value is false. |
| disruptive | no | boolean | Specifies whether the method used to set the parameter implies disruptive constraints. Default value is false. |
| setDiscover | no | boolean | Specifies whether the set method must be set to the value for all discovered instances of a target class. Default value is false. |
The following child elements are supported
Table 9. Child Elements
| Child element | Required | Number | Description |
|---|---|---|---|
<Value> |
no | 0 - 1 | Value of the parameter. |
<Target> |
no | 0 - any | Target to which the parameter applies. |
<Description> |
no | 0 - 1 | Description of the parameter. |
<Property> |
no | 0 - any | Property of the parameter. |
Attributes
Table 10. Attributes
- name — The name of the parameter is the only required attribute of the
<Parameter>element. Along with the catalog name specified in the parent<Catalog>element, the parameter name uniquely identifies a parameter definition in the catalog file. - value — The value of the parameter can be specified either as an attribute or as a child element.
- applyType — The applyType attribute can take the values
runtime(the default value) ornextboot. This attribute determines the command that is used to handle the parameter. For set operations, applyType=runtimeindicates that the<Settype=“permanent”> command from the catalog file should be used to set the parameter. The applyType=nextbootindicates that the<Settype=“nextboot”> command should be used instead. For get operations, when the –p flag is used, applyType=runtimeindicates that the<Gettype=“current”> command from the catalog file must be used to obtain the parameter. The<applyType>=``nextbootindicates that the<Gettype=“nextboot”> command should be used instead. The applyType attribute must be set tonextbootif the reboot attribute is set to true. - reboot — This attribute has a default value of false. When set to true, it means that the system must be rebooted before any change to the parameter is effective. This attribute must match the reboot attribute defined in the corresponding
<ParameterDef>element of the catalog file. When this attribute is set to true, the applyType attribute must be set tonextboot. When you set a parameter that has the reboot attribute set, a warning is displayed to the user, stating that a reboot operation is needed:0590-206 A manual post-operation is required for the changes to take effect Please reboot the systemOnly set the reboot attribute to true when a change to the parameter value will not be effective until after the next reboot. - readOnly — This attribute indicates that the value of the parameter can be read by the artexget command, but that it will not be set using the artexset command, nor taken into account in a comparison operation with live values by using the artexdiff commands. The default value is false. A few situations that can warrant setting the readOnly attribute to true follow: • The parameter is static and its value cannot be modified (e.g. the
memory_framesparameter in the vmo command). • Access to the parameter is restricted and it is not recommended for the user to modify it in automatic procedures. In this case, the set configuration methods should be defined for this parameter in the catalog file, but a system administrator must remove manually the readOnly attribute from the profile to be able to set the parameter.
Table 10. Attributes (continued)
- setDiscover — The setDiscover attribute, when set to true indicates that, when the artexset command is called with the –d flag, the discover command must be called to discover all instances of the target, and set all to the value stored in the profile. The setDiscover default value is false. A value of true only makes sense if the parameter has target classes defined in the catalog file. Do not specify this attribute when creating a sample profile. Advanced users must add this attribute manually when deemed necessary.
Other attributes
The type and disruptive attributes are informative attributes that are automatically set by the artexget command when it is called with the -i flag. Do not include these attributes when you are creating a sample profile
Examples
- The following example is an excerpt from the
vmoProfile.xmlsample catalog, showcasing the use of various optional attributes:
<Profile origin="reference" readOnly="true" version="2.0.0">
<Catalog id="vmoParam" version="2.1">
<Parameter name="nokilluid"/>
<Parameter name="memory_frames" readOnly="true"/>
<Parameter name="kernel_heap_psize" reboot="true" applyType="nextboot"/>
</Catalog>
</Profile>
- If you run the artexget –r command on the profile from example 1 the following profile is displayed:
<Profile origin="get" version="2.0.1" date="2011-03-24T13:41:01Z">
<Catalog id="vmoParam" version="2.1">
<Parameter name="nokilluid" value="0"/>
<Parameter name="memory_frames" value="393216" readOnly="true"/>
<Parameter name="kernel_heap_psize" value="4096" applyType="nextboot" reboot="true"/>
</Catalog>
</Profile>
Related information
The Parameter values topic.
The <ParameterDef> element.
Parameter values:
The value of a parameter can be set in a profile either as an attribute if they are short enough, or as a child element of the <Parameter> element.
Use
When writing a sample profile, no value must be assigned to the parameters. The value of a parameter, if it exists, is automatically included in the profile obtained by running an artexget command.
The runtime and nextboot values
The concept of runtime and nextboot values is an important part of the AIX Runtime Expert framework.
The runtime value of the parameter is its current value retrieved on the system at the time the artexget command is run. The nextboot value is the value the parameter will have after the next reboot of the system.
For example, the parameter type_of_dump in the profile sysdumpdevProfile.xml. The current (runtime) value of this parameter may be traditional or firmware-assisted. If this value is changed (using the artexset command or directly by using the sysdumpdev command), it will not be effective until the next reboot. The nextboot value of this parameter will then be the modified value.
<Parameter name="type_of_dump" applyType="nextboot" reboot="true" />
Example
The following example shows a parameter with the value specified as an attribute, and another parameter with the value specified as a child element:
(15줄짜리 예는 위 한글 본문에 그대로 실었습니다.)
<Property> element:
The <Property> element assigns a value to a parameter property.
Syntax
Parent element: <Parameter>
The following attributes are supported:
Table 11. Attributes
| Attribute | Required | Type | Description |
|---|---|---|---|
| name | yes | string | Specifies the name of the property. |
| value | no | string | Specifies the value of the property. |
Usage
The <Property> element assigns a value to the property name of the parent element. This value is used when the %p[name] sequence is expanded during command-line generation.
The <Property> element is generally not added manually to profiles. The element is inserted automatically in the output profile when the artexget –r and artexget –n commands are run, based on the command defined under the corresponding <Property> element of the catalog file.
Example
The following example sets the nodeId property for the netaddr parameter. The property value is captured by the artexget –r command and is the output of the uname –f command:
<Parameter name="netaddr" value="172.16.128.13">
<Target class="device" instance="en0"/>
<Property name="nodeId" value="8000108390E00009"/>
</Parameter>
Related information
The <PropertyDef> element (in catalog files).
<Seed> element:
The <Seed> element defines a seed that is expanded into one or more <ParameterDef> elements during the <Get> operation.
Syntax
Parent element: <Catalog>
The following attribute is supported:
Table 12. Attribute
| Attribute | Required | Type | Description |
|---|---|---|---|
| name | yes | string | Specifies the name of the seed element that matches a SeedDef element in the catalog file. |
The following child elements are supported:
Table 13. Child elements
| Child element | Required | Number | Description |
|---|---|---|---|
<Parameter> |
no | 0 – any | Filters discovered parameters based on the names of the parameters. |
<Target> |
no | 0 – any | Filters discovered parameters based on their targets. |
Usage
The <Seed> element discovers parameters dynamically during a <Get> operation.
When the artexget command is issued, each <Seed> element in the input profile is expanded into one or more <Parameter> elements. The profiles are expanded based on the rules defined in the matching <SeedDef> element of the catalog file. This process is called parameter discovery. After the parameter discovery process is completed, the artexget command proceeds as usual with the expanded profile.
The optional <Parameter> and <Target> child elements are used to filter the discovered parameters. Discovered parameters that do not match the criteria defined in the <Parameter> subelement, are
discarded. Also, those parameters that apply to targets that do not match the criteria defined in the <Target> subelement, are discarded.
Examples
This example uses the devSeed catalog to define a seed that can be used to discover all attributes of all devices:
(20줄짜리 예는 위 한글 본문에 그대로 실었습니다.)
The following profile can be used to discover all the supported attributes of all the supported devices:
<?xml version="1.0" encoding="UTF-8"?>
<Profile>
<Catalog id="devSeed" version="3.0">
<Seed name="devAttr"/>
</Catalog>
</Profile>
- Using the same catalog, a
<Target>filter can be used to discover all the supported attributes of all Ethernet adapters:
<?xml version="1.0" encoding="UTF-8"?>
<Profile>
<Catalog id="devSeed" version="3.0">
<Seed name="devAttr">
<Target class="device" match="^en[0-9]+$"/>
</Seed>
</Catalog>
</Profile>
- A
<Parameter>filter can be added to capture only the netaddr, netaddr6, alias, and alias6 attributes of all Ethernet adapters:
<?xml version="1.0" encoding="UTF-8"?>
<Profile>
<Catalog id="devSeed" version="3.0">
<Seed name="devattr">
<Parameter match="^(netaddr|alias)6?$"/>
<Target class="device" match="^en[0-9]+$"/>
</Seed>
</Catalog>
</Profile>
Related information
The <SeedDef> element element (in catalog files).
<Target> element:
A <Target> element defines the instance of a target class to which the parameter applies.
Syntax
Parent element: <Parameter>
Multiple occurrences of the same parameter from the same catalogs are allowed if, and only if, they apply to different instances of their target.
The following attributes are supported:
Table 14. Attributes
| Attribute | Required | Type | Description |
|---|---|---|---|
| class | yes | string | Specifies the name of the target class. |
| instance | no* |
string | Specifies the name of the instance of a class. |
| match | no* |
string | Specifies the regular expression as applied to the discovered instance names. |
* One and only one of the instance and match attributes must be specified.
Use
Some parameters do not apply to the system as a whole, but to a specific object. An example is the home directory of a user as specified in the chuserProfile.xml profile; this parameter applies to a specific user (root, guest) in a specific loadable module (files, LDAP). In this example, the user and the module are two target classes. The home parameter applies to specific instances of these target class. For example, the guest instance of the user class, and the files instance of the module class.
If the class and instance attributes are both set to the empty string, then a discovery is performed for this parameter when the artexget command is run on such a profile, the discovery method declared in the corresponding catalog file is executed, and a parameter is created in the output profile for each discovered instance of the parameter. See example 1.
If the class and instance attributes are both specified, then the target is fully qualified and the parameter only applies to the specified instance of the target class. See example 2.
If the class and match attributes are both specified, a discovery is performed as above, but only target instances with a name that matches the regular expression specified in the match attribute are discovered. See example 3.
When writing a sample profile, the class and instance attributes must be left empty. This means that, when encountering the empty target class, the artexget command will discover the list of the instances of that target class (all the users or the subsystems on the system) before retrieving the values.
Running the artexset command on an undiscovered target class displays a warning:
0590-216 Some parameters in the profile require a target discovery and will be ignored
Examples
- An example of a profile with targets before discovery is the
chuserProfile.xmlprofile that defines the home directory of a user. The following example shows a sample profile:
<Profile version="2.0.0" origin="reference" readOnly="true">
<Catalog id="chuserParam" version="2.0">
<Parameter name="home">
<Target class="" instance=""/>
</Parameter>
</Catalog>
</Profile>
- After discovery, the
chuserProfile.xmlprofile would contain a copy of the home parameter for each discovered user in each of the discovered loadable modules:
(13줄짜리 예는 위 한글 본문에 그대로 실었습니다.)
- The following profile uses the match attribute to discover the home directory of all users with a name that starts with a u in the file module:
<Profile version="2.0.0" origin="reference" readOnly="true"
<Catalog id="chuserParam" version="2.0">
<Parameter name="home">
<Target class="user" match="^u"/>
<Target class="module" instance="files"/>
</Parameter>
</Catalog>
</Profile>
Related information
The <Discover> element (in catalog files).