1acctadm(1M) System Administration Commands acctadm(1M)
2
3
4
6 acctadm - configure extended accounting facility
7
9 /usr/sbin/acctadm [-DEsrux] [-d resource_list]
10 [-e resource_list] [-f filename]
11 [task | process | flow | net]
12
13
15 acctadm configures various attributes of the extended accounting facil‐
16 ity. Without arguments, acctadm displays the current status of the
17 extended accounting facility.
18
20 The following options are supported:
21
22 -d resource_list
23
24 Disable reporting of resource usage for resource. Specify
25 resource_list as a comma-separated list of resources or resource
26 groups.
27
28 This option requires an operand. See OPERANDS.
29
30
31 -D
32
33 Disable accounting of the given operand type without closing the
34 accounting file. This option can be used to temporarily stop writ‐
35 ing accounting records to the accounting file without closing it.
36 To close the file use the -x option. See -x.
37
38
39 -e resource_list
40
41 Enable reporting of resource usage for resource. Specify
42 resource_list as a comma-separated list of resources or resource
43 groups.
44
45 This option requires an operand. See OPERANDS.
46
47
48 -E
49
50 Enable accounting of the given operand type without sending the
51 accounting output to a file. This option requires an operand. See
52 OPERANDS.
53
54
55 -f filename
56
57 Send the accounting output for the given operand type to filename.
58 If filename exists, its contents must be of the given accounting
59 type.
60
61 This option requires an operand. See OPERANDS.
62
63
64 -r
65
66 Display available resource groups.
67
68 When this option is used with an operand, it displays resource
69 groups available for a given accounting type. When no operand is
70 specified, this option displays resource groups for all available
71 accounting types. See OPERANDS.
72
73
74 -s
75
76 Start method for the smf(5) instance. This option is used to
77 restore the extended accounting configuration at boot.
78
79
80 -x
81
82 Deactivate accounting of the given operand type. This option also
83 closes the accounting file for the given accounting type if it is
84 currently open.
85
86 This option requires an operand. See OPERANDS.
87
88
90 The -d, -D, -e, -E, -f, and -x options require an operand.
91
92
93 The following operands are supported:
94
95 process
96
97 Run acctadm on the process accounting components of the extended
98 accounting facility.
99
100
101 task
102
103 Run acctadm on the task accounting components of the extended
104 accounting facility.
105
106
107 flow
108
109 Run acctadm on the IPQoS accounting components of the extended
110 accounting facility.
111
112
113 net
114
115 Run acctadm on links and flows administered by dladm(1M) and
116 flowadm(1M), respectively. Basic network accounting relates only to
117 links, while extended network accounting includes both link and
118 flow accounting.
119
120
121
122 The optional final parameter to acctadm represents whether the command
123 should act on the process, system task, IPQoS, or network accounting
124 components of the extended accounting facility.
125
127 Example 1 Displaying the Current Status
128
129
130 The following command displays the current status. In this example,
131 system task accounting is active and tracking only CPU resources.
132 Process and flow accounting are not active.
133
134
135 $ acctadm
136 Task accounting: active
137 Task accounting file: /var/adm/exacct/task
138 Tracked task resources: extended
139 Untracked task resources: host
140 Process accounting: inactive
141 Process accounting file: none
142 Tracked process resources: none
143 Untracked process resources: extended,host
144 Flow accounting: inactive
145 Flow accounting file: none
146 Tracked flow resources: none
147 Untracked flow resources: extended
148 Net accounting: inactive
149 Net accounting file: none
150 Tracked Net resources: none
151 Untracked Net resources: extended
152
153
154
155 Example 2 Activating Basic Process Accounting
156
157
158 The following command activates basic process accounting:
159
160
161 $ acctadm -e basic -f /var/adm/exacct/proc process
162
163
164
165 Example 3 Displaying Available Resource Groups
166
167
168 The following command displays available resource groups:
169
170
171 $ acctadm -r
172 process:
173 extended pid,uid,gid,cpu,time,command,tty,projid, \
174 taskid,ancpid,wait-status,zone,flag,memory,mstate
175 basic pid,uid,gid,cpu,time,command,tty,flag
176 task:
177 extended taskid,projid,cpu,time,host,mstate,anctaskid,zone
178 basic taskid,projid,cpu,time
179 flow:
180 extended saddr,daddr,sport,dport,proto,dsfield,nbytes,npkts, \
181 action,ctime,lseen,projid,uid
182 basic saddr,daddr,sport,dport,proto,nbytes,npkts,action
183 net:
184 extended name,devname,edest,vlan_tpid,vlan_tci,sap,cpuid, \
185 priority,bwlimit,curtime,ibytes,obytes,ipkts,opks,ierrpkts \
186 oerrpkts,saddr,daddr,sport,dport,protocol,dsfield
187 basic name,devname,edest,vlan_tpid,vlan_tci,sap,cpuid, \
188 priority,bwlimit,curtime,ibytes,obytes,ipkts,opks,ierrpkts \
189 oerrpkts
190
191
192
193
194 In the output above, the lines beginning with extended are shown with a
195 backslash character. In actual acctadm output, these lines are dis‐
196 played as unbroken, long lines.
197
198
199 Example 4 Displaying Resource Groups for Task Accounting
200
201
202 The following command displays resource groups for task accounting:
203
204
205 $ acctadm -r task
206 extended taskid,projid,cpu,time,host,mstate,anctaskid,zone
207 basic taskid,projid,cpu,time
208
209
210
212 The following exit values are returned:
213
214 0
215
216 Successful completion.
217
218 The modifications to the current configuration were valid and made
219 successfully.
220
221
222 1
223
224 An error occurred.
225
226 A fatal error occured either in obtaining or modifying the account‐
227 ing configuration.
228
229
230 2
231
232 Invalid command line options were specified.
233
234
235 95
236
237 A fatal, non-configuration error occurred during the start of the
238 smf(5) service instance.
239
240
241 96
242
243 A fatal configuration error occurred during the start of the smf(5)
244 service instance.
245
246
248 See attributes(5) for descriptions of the following attributes:
249
250
251
252
253 ┌─────────────────────────────┬─────────────────────────────┐
254 │ ATTRIBUTE TYPE │ ATTRIBUTE VALUE │
255 ├─────────────────────────────┼─────────────────────────────┤
256 │Availability │SUNWcsu │
257 ├─────────────────────────────┼─────────────────────────────┤
258 │Interface Stability │Committed │
259 └─────────────────────────────┴─────────────────────────────┘
260
262 dladm(1M), flowadm(1M), acct(2), attributes(5), smf(5), ipqos(7IPP)
263
265 Both extended accounting and regular accounting can be active.
266
267
268 Available resources can vary from system to system, and from platform
269 to platform.
270
271
272 Extended accounting configuration is stored in the service management
273 facility (smf(5)) repository. The configuration is restored at boot by
274 a transient service instance, one per accounting type:
275
276 svc:/system/extended-accounting:flow Flow accounting
277 svc:/system/extended-accounting:process Process accounting
278 svc:/system/extended-accounting:task Task accounting
279 svc:/system/extended-accounting:net Network accounting
280
281
282
283
284 The instances are enabled or disabled by acctadm as needed. Configura‐
285 tion changes are made using acctadm; service properties should not be
286 modified directly using svccfg(1M).
287
288
289 Users can manage extended accounting (start accounting, stop account‐
290 ing, change accounting configuration parameters) if they have the
291 appropriate RBAC Rights profile for the accounting type to be managed:
292
293 o Extended Accounting Flow Management
294
295 o Extended Accounting Process Management
296
297 o Extended Accounting Task Management
298
299 o Extended Accounting Network Management
300
301
302 The preceding profiles are for, respectively, flow accounting, process
303 accounting, task accounting, and network accounting.
304
305
306
307SunOS 5.11 17 Dec 2008 acctadm(1M)