1mmsclient_script(4) File Formats mmsclient_script(4)
2
3
4
6 mmsclient_script - script file for mmsclient program
7
9 mmsclient_script
10
11
13 This man page describes the syntax of the script file that is driven by
14 the mmsclient(1M) utility. This file contains a list of Media Manage‐
15 ment Protocol (MMP) commands that are used to communicate with a Media
16 Management server.
17
18
19 The MMP and the commands in the script file are based, in part, on
20 IEEE 1244, the Media Management System (MMS) standards.
21
22
23 In the script file, each MMP command must start with one of the follow‐
24 ing symbols as the first character:
25
26 # Comment character
27
28 Indicates the following characters document the file or command.
29 Any character following the # character on the same line is
30 ignored.
31
32
33 @ Async command
34
35 Indicates that the command on the next line is sent in async mode.
36 Any character following the @ character on the same line is
37 ignored. The MMP command to be performed must start on the next
38 line. Commands that are not preceded with the @ character are sent
39 in sync mode, that is, the mmsclient command waits for a response
40 before continuing to the next MMP command in the file.
41
42
43 $ Sync point
44
45 Forces the mmsclient command to wait for a response to a previous
46 async command. For example, if the script contained an async com‐
47 mand such as:
48
49 @task["Get volume Names"]
50
51
52 ...a subsequent command:
53
54 $Get volume Names
55
56
57 ...stops the script until the volume names are retrieved.
58
59
60 > Interactive MMP prompt
61
62 Displays a prompt on the display device and pauses the script. To
63 respond to the prompt, type the requested information, ending with
64 the semicolon (;) character. The mmsclient utility then sends the
65 information to the MMS server. To skip the MMP prompt, type the q
66 character.
67
68
69 % Pause the script
70
71 The script stops until you press the Enter key.
72
73
74 ! Execute a command
75
76 The mmsclient utility issues a call to system(3C) to invoke a com‐
77 mand. Whatever command follows ! is run in the shell in which
78 mmsclient is run. For example:
79
80 ! date
81
82
83 See the shell commands in the example script below.
84
85
87 Example 1 Example Script
88
89
90 The following script, demo_example, demonstrates the special characters
91 and some MMP commands. It is executed with default values when the com‐
92 mand:
93
94
95 # mmsclient -f demo _example
96
97
98
99
100 ...is run.
101
102
103 #mmsclient example script
104
105 #Send show commands in sync mode
106 show task["sync show command 1"]
107 report[DM] reportmode[namevalue]
108 number[1..2];
109
110 show task["sync show command 2"]
111 report[LM LIBRARY] reportmode[namevalue]
112 number[1..2];
113
114 #Pause the script and wait for someone to
115 #press Enter to continue
116 %
117
118 #send show commands in async mode
119 @
120 show task["async show command 1"]
121 report[DRIVE] reportmode[namevalue]
122 number[1..2];
123
124 @
125 show task["async show command 2"]
126 report[CARTRIDGE VOLUME] reportmode[namevalue]
127 number[1..2];
128
129 #set a sync point for the second async command,
130 #to stop the script until the response is complete
131 $async show command 2
132
133 #set a sync point for an unsent command and set
134 #a sync pont for a command that has already received a response.
135 #mmsclient does not stop for either one
136
137 $sync show command 1
138
139
140 #Start interactive MMP prompt.
141 #To continue, enter an MMP command or 'q'
142 >
143 #Register for a some events
144 notify task["notify test3"]
145 receive[tag["client connected"]
146 object[CONNECTION] action["add"]
147 match[streq(CONNECTION."Language" "MMP")]]
148 receive[tag["client disconnected"]
149 object[CONNECTION] action["delete"]
150 match[streq(CONNECTION."Language" "MMP")]]
151 receive[tag["DM connected"]
152 object[CONNECTION] action["add"]
153 match[streq(CONNECTION."Language" "DMP")]]
154 receive[tag["DM disconnected"]
155 object[CONNECTION] action["delete"]
156 match[streq(CONNECTION."Language" "DMP")]]
157 receive[tag["LM connected"]
158 object[CONNECTION] action["add"]
159 match[streq(CONNECTION."Language" "LMP")]]
160 receive[tag["LM disconnected"]
161 object[CONNECTION] action["delete"]
162 match[streq(CONNECTION."Language" "LMP")]]
163 ;
164
165 #Pause the script
166 #Connect another mmsclient to see some events
167 #Press Enter key to continue
168 %
169
170 notify task["delete all CONNECTION events"]
171 cancel[object[CONNECTION]];
172
173 #Pause the script and wait.
174 #Connect another mmsclient to verify the events are cancelled.
175 #Press Enter key to continue
176 %
177
178 #Execute some simple shell commands
179 !echo Hello World
180 !uname -a
181 !hostname
182
183 #Pause the script and wait.
184 #Press Enter key to continue
185 %
186
187 #Send last command in async mode.
188 #mmsclient does not exit until it receives the responses
189 #for all pending commmands.
190 @
191 show task["async show command 3"]
192 report[APPLICATION] reportmode[namevalue];
193 @
194 show task["async show command 4"]
195 report[AI] reportmode[namevalue];
196
197
198
200 See attributes(5) for descriptions of the following attributes:
201
202
203
204
205 ┌─────────────────────────────┬─────────────────────────────┐
206 │ ATTRIBUTE TYPE │ ATTRIBUTE VALUE │
207 ├─────────────────────────────┼─────────────────────────────┤
208 │Availability │SUNWmmsu │
209 ├─────────────────────────────┼─────────────────────────────┤
210 │Interface Stability │Volatile │
211 └─────────────────────────────┴─────────────────────────────┘
212
214 mmsadm(1M), mmsclient(1M), mmsexplorer(1M), mmsinit(1M), system(3C),
215 attributes(5)
216
217
218 IEEE 1244, IEEE Storage Systems Standards, a set of MMS standards
219
220
221
222SunOS 5.11 10 Jul 2008 mmsclient_script(4)