~percona-toolkit-dev/percona-toolkit/fix-empty-table-bug-987393

« back to all changes in this revision

Viewing changes to t/lib/bash/report_system_info.sh

  • Committer: Daniel Nichter
  • Date: 2012-04-03 16:14:55 UTC
  • mfrom: (217.6.22 2.0.3)
  • Revision ID: daniel@percona.com-20120403161455-ntv33vju9o6njtqv
Merge summary-tools-2.1.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/usr/bin/env bash
 
2
 
 
3
plan 48
 
4
 
 
5
. "$LIB_DIR/alt_cmds.sh"
 
6
. "$LIB_DIR/log_warn_die.sh"
 
7
. "$LIB_DIR/parse_options.sh"
 
8
. "$LIB_DIR/summary_common.sh"
 
9
. "$LIB_DIR/report_formatting.sh"
 
10
. "$LIB_DIR/report_system_info.sh"
 
11
 
 
12
TMPDIR="$TEST_TMPDIR"
 
13
PATH="$PATH:$PERCONA_TOOLKIT_SANDBOX/bin"
 
14
TOOL="pt-summary"
 
15
 
 
16
samples="$PERCONA_TOOLKIT_BRANCH/t/pt-summary/samples"
 
17
NAME_VAL_LEN=12
 
18
 
 
19
# parse_proc_cpuinfo
 
20
 
 
21
cat <<EOF > "$TMPDIR/expected"
 
22
  Processors | physical = 1, cores = 2, virtual = 2, hyperthreading = no
 
23
      Speeds | 2x1300.000
 
24
      Models | 2xGenuine Intel(R) CPU U7300 @ 1.30GHz
 
25
      Caches | 2x3072 KB
 
26
EOF
 
27
 
 
28
parse_proc_cpuinfo "$samples/proc_cpuinfo001.txt" > "$TMPDIR/got"
 
29
no_diff "$TMPDIR/got" "$TMPDIR/expected" "parse_proc_cpuinfo, proc_cpuinfo001.txt"
 
30
 
 
31
cat <<EOF > "$TMPDIR/expected"
 
32
  Processors | physical = 1, cores = 1, virtual = 2, hyperthreading = yes
 
33
      Speeds | 2x1000.000
 
34
      Models | 2xIntel(R) Atom(TM) CPU N455 @ 1.66GHz
 
35
      Caches | 2x512 KB
 
36
EOF
 
37
 
 
38
parse_proc_cpuinfo "$samples/proc_cpuinfo002.txt" > "$TMPDIR/got"
 
39
no_diff "$TMPDIR/got" "$TMPDIR/expected" "parse_proc_cpuinfo, proc_cpuinfo002.txt"
 
40
 
 
41
# parse_ethtool
 
42
cat <<EOF > "$TMPDIR/in"
 
43
Settings for eth0:
 
44
   Supported ports: [ TP MII ]
 
45
   Supported link modes:   10baseT/Half 10baseT/Full 
 
46
                           100baseT/Half 100baseT/Full 
 
47
   Supports auto-negotiation: Yes
 
48
   Advertised link modes:  10baseT/Half 10baseT/Full 
 
49
                           100baseT/Half 100baseT/Full 
 
50
   Advertised pause frame use: Symmetric Receive-only
 
51
   Advertised auto-negotiation: Yes
 
52
   Speed: 10Mb/s
 
53
   Duplex: Half
 
54
   Port: MII
 
55
   PHYAD: 0
 
56
   Transceiver: internal
 
57
   Auto-negotiation: on
 
58
   Supports Wake-on: pumbg
 
59
   Wake-on: d
 
60
   Current message level: 0x00000033 (51)
 
61
                drv probe ifdown ifup
 
62
   Link detected: no
 
63
EOF
 
64
 
 
65
cat <<EOF > "$TMPDIR/expected"
 
66
  Device    Speed     Duplex
 
67
  ========= ========= =========
 
68
  eth0       10Mb/s     Half      
 
69
EOF
 
70
 
 
71
parse_ethtool "$TMPDIR/in" > "$TMPDIR/got"
 
72
no_diff \
 
73
   "$TMPDIR/expected" \
 
74
   "$TMPDIR/got" \
 
75
   "parse_ethtool works"
 
76
 
 
77
cat <<EOF > "$TMPDIR/in"
 
78
Settings for eth0:
 
79
   Supported ports: [ TP MII ]
 
80
   Supported link modes:   10baseT/Half 10baseT/Full 
 
81
                           100baseT/Half 100baseT/Full 
 
82
   Supports auto-negotiation: Yes
 
83
   Advertised link modes:  10baseT/Half 10baseT/Full 
 
84
                           100baseT/Half 100baseT/Full 
 
85
   Advertised pause frame use: Symmetric Receive-only
 
86
   Advertised auto-negotiation: Yes
 
87
   Speed: 10Mb/s
 
88
   Duplex: Half
 
89
   Port: MII
 
90
   PHYAD: 0
 
91
   Transceiver: internal
 
92
   Auto-negotiation: on
 
93
   Supports Wake-on: pumbg
 
94
   Wake-on: d
 
95
   Current message level: 0x00000033 (51)
 
96
                drv probe ifdown ifup
 
97
   Link detected: no
 
98
Settings for eth4:
 
99
   Supported ports: [ TP MII ]
 
100
   Supported link modes:   10baseT/Half 10baseT/Full 
 
101
                           100baseT/Half 100baseT/Full 
 
102
   Supports auto-negotiation: Yes
 
103
   Advertised link modes:  10baseT/Half 10baseT/Full 
 
104
                           100baseT/Half 100baseT/Full 
 
105
   Advertised pause frame use: Symmetric Receive-only
 
106
   Advertised auto-negotiation: Yes
 
107
   Speed: 100Mb/s
 
108
   Duplex: Full
 
109
   Port: MII
 
110
   PHYAD: 0
 
111
   Transceiver: internal
 
112
   Auto-negotiation: on
 
113
   Supports Wake-on: pumbg
 
114
   Wake-on: d
 
115
   Current message level: 0x00000033 (51)
 
116
                drv probe ifdown ifup
 
117
   Link detected: no
 
118
EOF
 
119
 
 
120
cat <<EOF > "$TMPDIR/expected"
 
121
  Device    Speed     Duplex
 
122
  ========= ========= =========
 
123
  eth0       10Mb/s     Half      
 
124
  eth4       100Mb/s    Full      
 
125
EOF
 
126
 
 
127
parse_ethtool "$TMPDIR/in" > "$TMPDIR/got"
 
128
no_diff \
 
129
   "$TMPDIR/expected" \
 
130
   "$TMPDIR/got" \
 
131
   "parse_ethtool works if there are multiple devices"
 
132
 
 
133
# parse_netstat
 
134
 
 
135
cat <<EOF > $TMPDIR/expected
 
136
  Connections from remote IP addresses
 
137
    192.168.243.72      1
 
138
    192.168.243.81      2
 
139
  Connections to local IP addresses
 
140
    192.168.243.71      3
 
141
  Connections to top 10 local ports
 
142
    3306                3
 
143
  States of connections
 
144
    ESTABLISHED         4
 
145
    LISTEN             15
 
146
EOF
 
147
parse_netstat "$samples/netstat-001.txt" > "$TMPDIR/got"
 
148
no_diff "$TMPDIR/got" "$TMPDIR/expected" "parse_netstat, netstat-001.txt"
 
149
 
 
150
cat <<EOF > "$TMPDIR/expected"
 
151
  Connections from remote IP addresses
 
152
    10.14.82.196      175
 
153
    10.14.82.200       10
 
154
    10.14.82.202       45
 
155
    10.17.85.70        60
 
156
    10.17.85.72         1
 
157
    10.17.85.74         2
 
158
    10.17.85.86       225
 
159
    10.17.85.88        80
 
160
    10.17.85.90        40
 
161
    10.17.85.92         1
 
162
    10.17.85.100       25
 
163
    10.17.85.104       20
 
164
    10.36.34.66       300
 
165
    10.36.34.68       300
 
166
  Connections to local IP addresses
 
167
    10.17.85.70       175
 
168
    10.17.146.20     1250
 
169
  Connections to top 10 local ports
 
170
    3306             1250
 
171
    44811               1
 
172
    44816               1
 
173
    44817               1
 
174
    44820               1
 
175
    44822               1
 
176
    44824               1
 
177
    44825               1
 
178
    54446               1
 
179
  States of connections
 
180
    ESTABLISHED       150
 
181
    LISTEN             15
 
182
    TIME_WAIT        1250
 
183
EOF
 
184
parse_netstat "$samples/netstat-002.txt" > "$TMPDIR/got"
 
185
no_diff "$TMPDIR/got" "$TMPDIR/expected" "parse_netstat, netstat-002.txt"
 
186
 
 
187
cat <<EOF > "$TMPDIR/expected"
 
188
  Connections from remote IP addresses
 
189
    10.8.0.12           6
 
190
    10.8.0.14           2
 
191
    10.8.0.65           1
 
192
    10.8.0.76          25
 
193
    10.8.0.77           1
 
194
    192.168.5.77        2
 
195
  Connections to local IP addresses
 
196
    10.8.0.75          35
 
197
  Connections to top 10 local ports
 
198
    22                  1
 
199
    3306               25
 
200
    37570               1
 
201
    51071               1
 
202
    51072               1
 
203
    51073               1
 
204
    51074               1
 
205
    52300               1
 
206
    60757               1
 
207
  States of connections
 
208
    ESTABLISHED        30
 
209
    LISTEN              3
 
210
    TIME_WAIT           3
 
211
EOF
 
212
 
 
213
parse_netstat "$samples/netstat-003.txt" > "$TMPDIR/got"
 
214
no_diff "$TMPDIR/got" "$TMPDIR/expected" "parse_netstat, netstat-003.txt"
 
215
 
 
216
# parse_lsi_megaraid
 
217
 
 
218
cat <<EOF > "$TMPDIR/expected"
 
219
         BBU | 100% Charged, Temperature 18C, isSOHGood=Yes
 
220
EOF
 
221
 
 
222
cat <<EOF > "$TMPDIR/in"
 
223
BBU status for Adapter: 0
 
224
 
 
225
BatteryType: BBU
 
226
Voltage: 4072 mV
 
227
Current: 0 mA
 
228
Temperature: 18 C
 
229
Firmware Status: 00000000
 
230
 
 
231
Battery state: 
 
232
 
 
233
GasGuageStatus:
 
234
  Fully Discharged        : No
 
235
  Fully Charged           : Yes
 
236
  Discharging             : Yes
 
237
  Initialized             : Yes
 
238
  Remaining Time Alarm    : No
 
239
  Remaining Capacity Alarm: No
 
240
  Discharge Terminated    : No
 
241
  Over Temperature        : No
 
242
  Charging Terminated     : No
 
243
  Over Charged            : No
 
244
 
 
245
Relative State of Charge: 100 %
 
246
Charger Status: Complete
 
247
Remaining Capacity: 867 mAh
 
248
Full Charge Capacity: 867 mAh
 
249
isSOHGood: Yes
 
250
 
 
251
Exit Code: 0x00
 
252
EOF
 
253
parse_lsi_megaraid_bbu_status "$TMPDIR/in" > "$TMPDIR/got"
 
254
no_diff "$TMPDIR/got" "$TMPDIR/expected"
 
255
 
 
256
# ############################################################################
 
257
cat <<EOF > "$TMPDIR/expected"
 
258
 
 
259
  PhysiclDev Type State   Errors Vendor  Model        Size
 
260
  ========== ==== ======= ====== ======= ============ ===========
 
261
  Hard Disk  SAS  Online   0/0/0 SEAGATE ST373455SS   70007MB
 
262
  Hard Disk  SAS  Online   0/0/0 SEAGATE ST373455SS   70007MB
 
263
  Hard Disk  SAS  Online   0/0/0 SEAGATE ST373455SS   70007MB
 
264
  Hard Disk  SAS  Online   0/0/0 SEAGATE ST373455SS   70007MB
 
265
EOF
 
266
 
 
267
cat <<EOF > "$TMPDIR/in"
 
268
                                     
 
269
Adapter #0
 
270
 
 
271
Enclosure Device ID: 32
 
272
Slot Number: 0
 
273
Device Id: 0
 
274
Sequence Number: 2
 
275
Media Error Count: 0
 
276
Other Error Count: 0
 
277
Predictive Failure Count: 0
 
278
Last Predictive Failure Event Seq Number: 0
 
279
PD Type: SAS
 
280
Raw Size: 70007MB [0x88bb93a Sectors]
 
281
Non Coerced Size: 69495MB [0x87bb93a Sectors]
 
282
Coerced Size: 69376MB [0x8780000 Sectors]
 
283
Firmware state: Online
 
284
SAS Address(0): 0x5000c500079f8cf9
 
285
SAS Address(1): 0x0
 
286
Connected Port Number: 0(path0) 
 
287
Inquiry Data: SEAGATE ST373455SS      S5273LQ2DZ33            
 
288
Foreign State: None 
 
289
Media Type: Hard Disk Device
 
290
 
 
291
Enclosure Device ID: 32
 
292
Slot Number: 1
 
293
Device Id: 1
 
294
Sequence Number: 2
 
295
Media Error Count: 0
 
296
Other Error Count: 0
 
297
Predictive Failure Count: 0
 
298
Last Predictive Failure Event Seq Number: 0
 
299
PD Type: SAS
 
300
Raw Size: 70007MB [0x88bb93a Sectors]
 
301
Non Coerced Size: 69495MB [0x87bb93a Sectors]
 
302
Coerced Size: 69376MB [0x8780000 Sectors]
 
303
Firmware state: Online
 
304
SAS Address(0): 0x5000c500079f5c35
 
305
SAS Address(1): 0x0
 
306
Connected Port Number: 1(path0) 
 
307
Inquiry Data: SEAGATE ST373455SS      S5273LQ2D9RH            
 
308
Foreign State: None 
 
309
Media Type: Hard Disk Device
 
310
 
 
311
Enclosure Device ID: 32
 
312
Slot Number: 2
 
313
Device Id: 2
 
314
Sequence Number: 2
 
315
Media Error Count: 0
 
316
Other Error Count: 0
 
317
Predictive Failure Count: 0
 
318
Last Predictive Failure Event Seq Number: 0
 
319
PD Type: SAS
 
320
Raw Size: 70007MB [0x88bb93a Sectors]
 
321
Non Coerced Size: 69495MB [0x87bb93a Sectors]
 
322
Coerced Size: 69376MB [0x8780000 Sectors]
 
323
Firmware state: Online
 
324
SAS Address(0): 0x5000c500079fc0c9
 
325
SAS Address(1): 0x0
 
326
Connected Port Number: 2(path0) 
 
327
Inquiry Data: SEAGATE ST373455SS      S5273LQ2DPST            
 
328
Foreign State: None 
 
329
Media Type: Hard Disk Device
 
330
 
 
331
Enclosure Device ID: 32
 
332
Slot Number: 3
 
333
Device Id: 3
 
334
Sequence Number: 2
 
335
Media Error Count: 0
 
336
Other Error Count: 0
 
337
Predictive Failure Count: 0
 
338
Last Predictive Failure Event Seq Number: 0
 
339
PD Type: SAS
 
340
Raw Size: 70007MB [0x88bb93a Sectors]
 
341
Non Coerced Size: 69495MB [0x87bb93a Sectors]
 
342
Coerced Size: 69376MB [0x8780000 Sectors]
 
343
Firmware state: Online
 
344
SAS Address(0): 0x5000c500079dc339
 
345
SAS Address(1): 0x0
 
346
Connected Port Number: 3(path0) 
 
347
Inquiry Data: SEAGATE ST373455SS      S5273LQ2CKD5            
 
348
Foreign State: None 
 
349
Media Type: Hard Disk Device
 
350
 
 
351
 
 
352
Exit Code: 0x00
 
353
EOF
 
354
parse_lsi_megaraid_devices "$TMPDIR/in" > "$TMPDIR/got"
 
355
no_diff "$TMPDIR/got" "$TMPDIR/expected"
 
356
 
 
357
 
 
358
# ############################################################################
 
359
cat <<EOF > "$TMPDIR/expected"
 
360
 
 
361
  PhysiclDev Type State   Errors Vendor  Model        Size
 
362
  ========== ==== ======= ====== ======= ============ ===========
 
363
  Hard Disk  SAS  Online   0/0/0 SEAGATE ST373455SS   70007MB
 
364
  Hard Disk  SAS  Online   0/0/0 SEAGATE ST373455SS   70007MB
 
365
  Hard Disk  SAS  Online   0/0/0 SEAGATE ST373455SS   70007MB
 
366
  Hard Disk  SAS  Online   0/0/0 SEAGATE ST373455SS   70007MB
 
367
EOF
 
368
 
 
369
cat <<EOF > "$TMPDIR/in"
 
370
[root@pc-db1 ~]# /opt/MegaRAID/MegaCli/MegaCli64 -LdPdInfo -aALL
 
371
                                     
 
372
Adapter #0
 
373
 
 
374
Number of Virtual Disks: 2
 
375
Virtual Disk: 0 (Target Id: 0)
 
376
Name:
 
377
RAID Level: Primary-1, Secondary-0, RAID Level Qualifier-0
 
378
Size:69376MB
 
379
State: Optimal
 
380
Stripe Size: 64kB
 
381
Number Of Drives:2
 
382
Span Depth:1
 
383
Default Cache Policy: WriteBack, ReadAheadNone, Direct, No Write Cache if Bad BBU
 
384
Current Cache Policy: WriteBack, ReadAheadNone, Direct, No Write Cache if Bad BBU
 
385
Access Policy: Read/Write
 
386
Disk Cache Policy: Disk's Default
 
387
Number of Spans: 1
 
388
Span: 0 - Number of PDs: 2
 
389
PD: 0 Information
 
390
Enclosure Device ID: 32
 
391
Slot Number: 0
 
392
Device Id: 0
 
393
Sequence Number: 2
 
394
Media Error Count: 0
 
395
Other Error Count: 0
 
396
Predictive Failure Count: 0
 
397
Last Predictive Failure Event Seq Number: 0
 
398
PD Type: SAS
 
399
Raw Size: 70007MB [0x88bb93a Sectors]
 
400
Non Coerced Size: 69495MB [0x87bb93a Sectors]
 
401
Coerced Size: 69376MB [0x8780000 Sectors]
 
402
Firmware state: Online
 
403
SAS Address(0): 0x5000c500079f8cf9
 
404
SAS Address(1): 0x0
 
405
Connected Port Number: 0(path0) 
 
406
Inquiry Data: SEAGATE ST373455SS      S5273LQ2DZ33            
 
407
Foreign State: None 
 
408
Media Type: Hard Disk Device
 
409
 
 
410
PD: 1 Information
 
411
Enclosure Device ID: 32
 
412
Slot Number: 1
 
413
Device Id: 1
 
414
Sequence Number: 2
 
415
Media Error Count: 0
 
416
Other Error Count: 0
 
417
Predictive Failure Count: 0
 
418
Last Predictive Failure Event Seq Number: 0
 
419
PD Type: SAS
 
420
Raw Size: 70007MB [0x88bb93a Sectors]
 
421
Non Coerced Size: 69495MB [0x87bb93a Sectors]
 
422
Coerced Size: 69376MB [0x8780000 Sectors]
 
423
Firmware state: Online
 
424
SAS Address(0): 0x5000c500079f5c35
 
425
SAS Address(1): 0x0
 
426
Connected Port Number: 1(path0) 
 
427
Inquiry Data: SEAGATE ST373455SS      S5273LQ2D9RH            
 
428
Foreign State: None 
 
429
Media Type: Hard Disk Device
 
430
 
 
431
Virtual Disk: 1 (Target Id: 1)
 
432
Name:
 
433
RAID Level: Primary-1, Secondary-0, RAID Level Qualifier-0
 
434
Size:69376MB
 
435
State: Optimal
 
436
Stripe Size: 64kB
 
437
Number Of Drives:2
 
438
Span Depth:1
 
439
Default Cache Policy: WriteBack, ReadAheadNone, Direct, No Write Cache if Bad BBU
 
440
Current Cache Policy: WriteBack, ReadAheadNone, Direct, No Write Cache if Bad BBU
 
441
Access Policy: Read/Write
 
442
Disk Cache Policy: Disk's Default
 
443
Number of Spans: 1
 
444
Span: 0 - Number of PDs: 2
 
445
PD: 0 Information
 
446
Enclosure Device ID: 32
 
447
Slot Number: 2
 
448
Device Id: 2
 
449
Sequence Number: 2
 
450
Media Error Count: 0
 
451
Other Error Count: 0
 
452
Predictive Failure Count: 0
 
453
Last Predictive Failure Event Seq Number: 0
 
454
PD Type: SAS
 
455
Raw Size: 70007MB [0x88bb93a Sectors]
 
456
Non Coerced Size: 69495MB [0x87bb93a Sectors]
 
457
Coerced Size: 69376MB [0x8780000 Sectors]
 
458
Firmware state: Online
 
459
SAS Address(0): 0x5000c500079fc0c9
 
460
SAS Address(1): 0x0
 
461
Connected Port Number: 2(path0) 
 
462
Inquiry Data: SEAGATE ST373455SS      S5273LQ2DPST            
 
463
Foreign State: None 
 
464
Media Type: Hard Disk Device
 
465
 
 
466
PD: 1 Information
 
467
Enclosure Device ID: 32
 
468
Slot Number: 3
 
469
Device Id: 3
 
470
Sequence Number: 2
 
471
Media Error Count: 0
 
472
Other Error Count: 0
 
473
Predictive Failure Count: 0
 
474
Last Predictive Failure Event Seq Number: 0
 
475
PD Type: SAS
 
476
Raw Size: 70007MB [0x88bb93a Sectors]
 
477
Non Coerced Size: 69495MB [0x87bb93a Sectors]
 
478
Coerced Size: 69376MB [0x8780000 Sectors]
 
479
Firmware state: Online
 
480
SAS Address(0): 0x5000c500079dc339
 
481
SAS Address(1): 0x0
 
482
Connected Port Number: 3(path0) 
 
483
Inquiry Data: SEAGATE ST373455SS      S5273LQ2CKD5            
 
484
Foreign State: None 
 
485
Media Type: Hard Disk Device
 
486
 
 
487
 
 
488
Exit Code: 0x00
 
489
EOF
 
490
parse_lsi_megaraid_devices "$TMPDIR/in" > "$TMPDIR/got"
 
491
no_diff "$TMPDIR/got" "$TMPDIR/expected"
 
492
 
 
493
# ############################################################################
 
494
cat <<EOF > "$TMPDIR/expected"
 
495
 
 
496
  VirtualDev Size      RAID Level Disks SpnDpth Stripe Status  Cache
 
497
  ========== ========= ========== ===== ======= ====== ======= =========
 
498
  0(no name) 69376MB   1 (1-0-0)      2     1-1   64kB Optimal WB, no RA
 
499
  1(no name) 69376MB   1 (1-0-0)      2     1-1   64kB Optimal WB, no RA
 
500
EOF
 
501
 
 
502
cat <<EOF > "$TMPDIR/in"
 
503
[root@pc-db1 ~]# /opt/MegaRAID/MegaCli/MegaCli64 -LdPdInfo -aALL
 
504
                                     
 
505
Adapter #0
 
506
 
 
507
Number of Virtual Disks: 2
 
508
Virtual Disk: 0 (Target Id: 0)
 
509
Name:
 
510
RAID Level: Primary-1, Secondary-0, RAID Level Qualifier-0
 
511
Size:69376MB
 
512
State: Optimal
 
513
Stripe Size: 64kB
 
514
Number Of Drives:2
 
515
Span Depth:1
 
516
Default Cache Policy: WriteBack, ReadAheadNone, Direct, No Write Cache if Bad BBU
 
517
Current Cache Policy: WriteBack, ReadAheadNone, Direct, No Write Cache if Bad BBU
 
518
Access Policy: Read/Write
 
519
Disk Cache Policy: Disk's Default
 
520
Number of Spans: 1
 
521
Span: 0 - Number of PDs: 2
 
522
PD: 0 Information
 
523
Enclosure Device ID: 32
 
524
Slot Number: 0
 
525
Device Id: 0
 
526
Sequence Number: 2
 
527
Media Error Count: 0
 
528
Other Error Count: 0
 
529
Predictive Failure Count: 0
 
530
Last Predictive Failure Event Seq Number: 0
 
531
PD Type: SAS
 
532
Raw Size: 70007MB [0x88bb93a Sectors]
 
533
Non Coerced Size: 69495MB [0x87bb93a Sectors]
 
534
Coerced Size: 69376MB [0x8780000 Sectors]
 
535
Firmware state: Online
 
536
SAS Address(0): 0x5000c500079f8cf9
 
537
SAS Address(1): 0x0
 
538
Connected Port Number: 0(path0) 
 
539
Inquiry Data: SEAGATE ST373455SS      S5273LQ2DZ33            
 
540
Foreign State: None 
 
541
Media Type: Hard Disk Device
 
542
 
 
543
PD: 1 Information
 
544
Enclosure Device ID: 32
 
545
Slot Number: 1
 
546
Device Id: 1
 
547
Sequence Number: 2
 
548
Media Error Count: 0
 
549
Other Error Count: 0
 
550
Predictive Failure Count: 0
 
551
Last Predictive Failure Event Seq Number: 0
 
552
PD Type: SAS
 
553
Raw Size: 70007MB [0x88bb93a Sectors]
 
554
Non Coerced Size: 69495MB [0x87bb93a Sectors]
 
555
Coerced Size: 69376MB [0x8780000 Sectors]
 
556
Firmware state: Online
 
557
SAS Address(0): 0x5000c500079f5c35
 
558
SAS Address(1): 0x0
 
559
Connected Port Number: 1(path0) 
 
560
Inquiry Data: SEAGATE ST373455SS      S5273LQ2D9RH            
 
561
Foreign State: None 
 
562
Media Type: Hard Disk Device
 
563
 
 
564
Virtual Disk: 1 (Target Id: 1)
 
565
Name:
 
566
RAID Level: Primary-1, Secondary-0, RAID Level Qualifier-0
 
567
Size:69376MB
 
568
State: Optimal
 
569
Stripe Size: 64kB
 
570
Number Of Drives:2
 
571
Span Depth:1
 
572
Default Cache Policy: WriteBack, ReadAheadNone, Direct, No Write Cache if Bad BBU
 
573
Current Cache Policy: WriteBack, ReadAheadNone, Direct, No Write Cache if Bad BBU
 
574
Access Policy: Read/Write
 
575
Disk Cache Policy: Disk's Default
 
576
Number of Spans: 1
 
577
Span: 0 - Number of PDs: 2
 
578
PD: 0 Information
 
579
Enclosure Device ID: 32
 
580
Slot Number: 2
 
581
Device Id: 2
 
582
Sequence Number: 2
 
583
Media Error Count: 0
 
584
Other Error Count: 0
 
585
Predictive Failure Count: 0
 
586
Last Predictive Failure Event Seq Number: 0
 
587
PD Type: SAS
 
588
Raw Size: 70007MB [0x88bb93a Sectors]
 
589
Non Coerced Size: 69495MB [0x87bb93a Sectors]
 
590
Coerced Size: 69376MB [0x8780000 Sectors]
 
591
Firmware state: Online
 
592
SAS Address(0): 0x5000c500079fc0c9
 
593
SAS Address(1): 0x0
 
594
Connected Port Number: 2(path0) 
 
595
Inquiry Data: SEAGATE ST373455SS      S5273LQ2DPST            
 
596
Foreign State: None 
 
597
Media Type: Hard Disk Device
 
598
 
 
599
PD: 1 Information
 
600
Enclosure Device ID: 32
 
601
Slot Number: 3
 
602
Device Id: 3
 
603
Sequence Number: 2
 
604
Media Error Count: 0
 
605
Other Error Count: 0
 
606
Predictive Failure Count: 0
 
607
Last Predictive Failure Event Seq Number: 0
 
608
PD Type: SAS
 
609
Raw Size: 70007MB [0x88bb93a Sectors]
 
610
Non Coerced Size: 69495MB [0x87bb93a Sectors]
 
611
Coerced Size: 69376MB [0x8780000 Sectors]
 
612
Firmware state: Online
 
613
SAS Address(0): 0x5000c500079dc339
 
614
SAS Address(1): 0x0
 
615
Connected Port Number: 3(path0) 
 
616
Inquiry Data: SEAGATE ST373455SS      S5273LQ2CKD5            
 
617
Foreign State: None 
 
618
Media Type: Hard Disk Device
 
619
 
 
620
 
 
621
Exit Code: 0x00
 
622
EOF
 
623
parse_lsi_megaraid_virtual_devices "$TMPDIR/in" > "$TMPDIR/got"
 
624
no_diff "$TMPDIR/got" "$TMPDIR/expected"
 
625
 
 
626
# ############################################################################
 
627
cat <<EOF > "$TMPDIR/expected"
 
628
 
 
629
  VirtualDev Size      RAID Level Disks SpnDpth Stripe Status  Cache
 
630
  ========== ========= ========== ===== ======= ====== ======= =========
 
631
  0(no name) 69376MB   1 (1-0-0)      2      1-   64kB Optimal WB, no RA
 
632
  1(no name) 69376MB   1 (1-0-0)      2      1-   64kB Optimal WB, no RA
 
633
EOF
 
634
 
 
635
cat <<EOF > "$TMPDIR/in"
 
636
[root@pc-db1 ~]# /opt/MegaRAID/MegaCli/MegaCli64 -LDInfo -Lall -aAll
 
637
                                     
 
638
 
 
639
Adapter 0 -- Virtual Drive Information:
 
640
Virtual Disk: 0 (Target Id: 0)
 
641
Name:
 
642
RAID Level: Primary-1, Secondary-0, RAID Level Qualifier-0
 
643
Size:69376MB
 
644
State: Optimal
 
645
Stripe Size: 64kB
 
646
Number Of Drives:2
 
647
Span Depth:1
 
648
Default Cache Policy: WriteBack, ReadAheadNone, Direct, No Write Cache if Bad BBU
 
649
Current Cache Policy: WriteBack, ReadAheadNone, Direct, No Write Cache if Bad BBU
 
650
Access Policy: Read/Write
 
651
Disk Cache Policy: Disk's Default
 
652
Virtual Disk: 1 (Target Id: 1)
 
653
Name:
 
654
RAID Level: Primary-1, Secondary-0, RAID Level Qualifier-0
 
655
Size:69376MB
 
656
State: Optimal
 
657
Stripe Size: 64kB
 
658
Number Of Drives:2
 
659
Span Depth:1
 
660
Default Cache Policy: WriteBack, ReadAheadNone, Direct, No Write Cache if Bad BBU
 
661
Current Cache Policy: WriteBack, ReadAheadNone, Direct, No Write Cache if Bad BBU
 
662
Access Policy: Read/Write
 
663
Disk Cache Policy: Disk's Default
 
664
 
 
665
Exit Code: 0x00
 
666
EOF
 
667
parse_lsi_megaraid_virtual_devices "$TMPDIR/in" > "$TMPDIR/got"
 
668
no_diff "$TMPDIR/got" "$TMPDIR/expected"
 
669
 
 
670
 
 
671
# ############################################################################
 
672
cat <<EOF > "$TMPDIR/expected"
 
673
       Model | PERC 6/i Integrated, PCIE interface, 8 ports
 
674
       Cache | 256MB Memory, BBU Present
 
675
EOF
 
676
 
 
677
parse_lsi_megaraid_adapter_info "$samples/MegaCli64_AdpAllInfo_aALL001.txt" > "$TMPDIR/got"
 
678
no_diff "$TMPDIR/got" "$TMPDIR/expected"
 
679
 
 
680
# Launchpad 886223
 
681
cat <<EOF > "$TMPDIR/expected"
 
682
 
 
683
  VirtualDev Size      RAID Level Disks SpnDpth Stripe Status  Cache
 
684
  ========== ========= ========== ===== ======= ====== ======= =========
 
685
  0(no name)  135.5 GB 0 (:-1-0)      2 Depth-2  64 KB Optimal WB, no RA
 
686
EOF
 
687
parse_lsi_megaraid_virtual_devices "$PERCONA_TOOLKIT_BRANCH/t/pt-summary/samples/MegaCli64_LdPdInfo_aALL_886223" > "$TMPDIR/got"
 
688
no_diff "$TMPDIR/got" "$TMPDIR/expected" "Bug 886223"
 
689
 
 
690
# parse_hpacucli
 
691
 
 
692
cat <<EOF > "$TMPDIR/expected"
 
693
      logicaldrive 1 (136.7 GB, RAID 1, OK)
 
694
      physicaldrive 1I:1:1 (port 1I:box 1:bay 1, SAS, 146 GB, OK)
 
695
      physicaldrive 1I:1:2 (port 1I:box 1:bay 2, SAS, 146 GB, OK)
 
696
EOF
 
697
 
 
698
cat <<EOF > "$TMPDIR/in"
 
699
 
 
700
Smart Array P400i in Slot 0 (Embedded)    (sn: PH73MU7325     )
 
701
 
 
702
   array A (SAS, Unused Space: 0 MB)
 
703
 
 
704
 
 
705
      logicaldrive 1 (136.7 GB, RAID 1, OK)
 
706
 
 
707
      physicaldrive 1I:1:1 (port 1I:box 1:bay 1, SAS, 146 GB, OK)
 
708
      physicaldrive 1I:1:2 (port 1I:box 1:bay 2, SAS, 146 GB, OK)
 
709
 
 
710
EOF
 
711
parse_hpacucli "$TMPDIR/in" > "$TMPDIR/got"
 
712
no_diff "$TMPDIR/got" "$TMPDIR/expected"
 
713
 
 
714
parse_hpacucli "$samples/hpaculi-003.txt" > "$TMPDIR/got"
 
715
is \
 
716
   "$(cat "$TMPDIR/got")" \
 
717
   "" \
 
718
   "parse_hpacucli, hpaculi-003.txt"
 
719
 
 
720
# parse_fusionmpt_lsiutil
 
721
 
 
722
cat <<EOF > "$TMPDIR/expected"
 
723
 
 
724
  /proc/mpt/ioc0    LSI Logic SAS1068E B3    MPT 105   Firmware 00192f00   IOC 0
 
725
   B___T___L  Type       Vendor   Product          Rev      SASAddress     PhyNum
 
726
   0   0   0  Disk       Dell     VIRTUAL DISK     1028  
 
727
   0   2   0  Disk       Dell     VIRTUAL DISK     1028  
 
728
   0   8   0  EnclServ   DP       BACKPLANE        1.05  510240805f4feb00     8
 
729
  Hidden RAID Devices:
 
730
   B___T    Device       Vendor   Product          Rev      SASAddress     PhyNum
 
731
   0   1  PhysDisk 0     SEAGATE  ST373455SS       S52A  5000c50012a8ac61     1
 
732
   0   9  PhysDisk 1     SEAGATE  ST373455SS       S52A  5000c50012a8a24d     0
 
733
   0   3  PhysDisk 2     SEAGATE  ST3146855SS      S52A  5000c500130fcaed     3
 
734
   0  10  PhysDisk 3     SEAGATE  ST3146855SS      S52A  5000c500131093f5     2
 
735
EOF
 
736
parse_fusionmpt_lsiutil "$samples/lsiutil-001.txt" > "$TMPDIR/got"
 
737
no_diff "$TMPDIR/got" "$TMPDIR/expected" "lsiutil-001.txt"
 
738
 
 
739
cat <<EOF > "$TMPDIR/expected"
 
740
 
 
741
  /proc/mpt/ioc0    LSI Logic SAS1064E B3    MPT 105   Firmware 011e0000   IOC 0
 
742
   B___T___L  Type       Vendor   Product          Rev      SASAddress     PhyNum
 
743
   0   1   0  Disk       LSILOGIC Logical Volume   3000  
 
744
  Hidden RAID Devices:
 
745
   B___T    Device       Vendor   Product          Rev      SASAddress     PhyNum
 
746
   0   2  PhysDisk 0     IBM-ESXS ST9300603SS   F  B536  5000c5001d784329     1
 
747
   0   3  PhysDisk 1     IBM-ESXS MBD2300RC        SB17  500000e113c17152     0
 
748
EOF
 
749
parse_fusionmpt_lsiutil "$samples/lsiutil-002.txt" > "$TMPDIR/got"
 
750
no_diff "$TMPDIR/got" "$TMPDIR/expected" "lsiutil-002.txt"
 
751
 
 
752
cat <<EOF > "$TMPDIR/expected"
 
753
 
 
754
  /proc/mpt/ioc0    LSI Logic SAS1064E B3    MPT 105   Firmware 011e0000   IOC 0
 
755
   B___T___L  Type       Vendor   Product          Rev      SASAddress     PhyNum
 
756
   0   1   0  Disk       LSILOGIC Logical Volume   3000  
 
757
  Hidden RAID Devices:
 
758
   B___T    Device       Vendor   Product          Rev      SASAddress     PhyNum
 
759
   0   2  PhysDisk 0     IBM-ESXS MBD2300RC        SB17  500000e113c00ed2     1
 
760
   0   3  PhysDisk 1     IBM-ESXS MBD2300RC        SB17  500000e113c17ee2     0
 
761
EOF
 
762
parse_fusionmpt_lsiutil "$samples/lsiutil-003.txt" > "$TMPDIR/got"
 
763
no_diff "$TMPDIR/got" "$TMPDIR/expected" "lsiutil-003.txt"
 
764
 
 
765
# parse_free_minus_b
 
766
 
 
767
cat <<EOF > "$TMPDIR/expected"
 
768
       Total | 3.9G
 
769
        Free | 1.4G
 
770
        Used | physical = 2.5G, swap allocated = 4.9G, swap used = 0.0, virtual = 2.5G
 
771
     Buffers | 131.8M
 
772
      Caches | 1.9G
 
773
       Dirty | 60 kB
 
774
EOF
 
775
 
 
776
cat <<EOF > "$TMPDIR/in"
 
777
             total       used       free     shared    buffers     cached
 
778
Mem:    4182048768 2653696000 1528352768          0  138240000 2060787712
 
779
-/+ buffers/cache:  454668288 3727380480
 
780
Swap:   5284814848          0 5284814848
 
781
MemTotal:        4084040 kB
 
782
MemFree:         2390720 kB
 
783
Buffers:          121868 kB
 
784
Cached:          1155116 kB
 
785
SwapCached:            0 kB
 
786
Active:           579712 kB
 
787
Inactive:         941436 kB
 
788
Active(anon):     244720 kB
 
789
Inactive(anon):    40572 kB
 
790
Active(file):     334992 kB
 
791
Inactive(file):   900864 kB
 
792
Unevictable:          48 kB
 
793
Mlocked:              48 kB
 
794
HighTotal:       3251848 kB
 
795
HighFree:        1837740 kB
 
796
LowTotal:         832192 kB
 
797
LowFree:          552980 kB
 
798
SwapTotal:       5144572 kB
 
799
SwapFree:        5144572 kB
 
800
Dirty:                60 kB
 
801
Writeback:             0 kB
 
802
AnonPages:        244264 kB
 
803
Mapped:            84452 kB
 
804
Shmem:             41140 kB
 
805
Slab:             133548 kB
 
806
SReclaimable:     107672 kB
 
807
SUnreclaim:        25876 kB
 
808
KernelStack:        2264 kB
 
809
PageTables:         7740 kB
 
810
NFS_Unstable:          0 kB
 
811
Bounce:                0 kB
 
812
WritebackTmp:          0 kB
 
813
CommitLimit:     7186592 kB
 
814
Committed_AS:    1192140 kB
 
815
VmallocTotal:     122880 kB
 
816
VmallocUsed:       32276 kB
 
817
VmallocChunk:      65120 kB
 
818
HardwareCorrupted:     0 kB
 
819
HugePages_Total:       0
 
820
HugePages_Free:        0
 
821
HugePages_Rsvd:        0
 
822
HugePages_Surp:        0
 
823
Hugepagesize:       2048 kB
 
824
DirectMap4k:       10232 kB
 
825
DirectMap2M:      897024 kB
 
826
EOF
 
827
parse_free_minus_b "$TMPDIR/in" > "$TMPDIR/got"
 
828
no_diff "$TMPDIR/got" "$TMPDIR/expected" "parse_free_minus_b"
 
829
 
 
830
# parse_filesystems
 
831
 
 
832
cat <<EOF > $TMPDIR/expected
 
833
  Filesystem  Size Used Type  Opts Mountpoint
 
834
  /dev/sda1    99M  13% ext3  rw   /boot
 
835
  /dev/sda2   540G  89% ext3  rw   /
 
836
  tmpfs        48G   0% tmpfs rw   /dev/shm
 
837
EOF
 
838
parse_filesystems "$samples/df-mount-003.txt" "Linux" > "$TMPDIR/got"
 
839
no_diff "$TMPDIR/got" "$TMPDIR/expected" "df-mount-003.txt Linux"
 
840
 
 
841
cat <<EOF > $TMPDIR/expected
 
842
  Filesystem  Size Used Type        Opts              Mountpoint
 
843
  /dev/sda1   9.9G  34% ext3        rw                /
 
844
  /dev/sdb    414G   1% ext3        rw                /mnt
 
845
  none        7.6G   0% devpts      rw,gid=5,mode=620 /dev/shm
 
846
  none        7.6G   0% tmpfs       rw                /dev/shm
 
847
  none        7.6G   0% binfmt_misc rw                /dev/shm
 
848
  none        7.6G   0% proc        rw                /dev/shm
 
849
  none        7.6G   0% sysfs       rw                /dev/shm
 
850
EOF
 
851
parse_filesystems "$samples/df-mount-004.txt" "Linux" > "$TMPDIR/got"
 
852
no_diff "$TMPDIR/got" "$TMPDIR/expected" "df-mount-004.txt Linux"
 
853
 
 
854
cat <<EOF > $TMPDIR/expected
 
855
  Filesystem                         Size Used Type  Opts       Mountpoint
 
856
  /dev/cciss/c0d0p1                   99M  24% ext3  rw         /boot
 
857
  /dev/mapper/VolGroup00-LogVol00    194G  58% ext3  rw         /
 
858
  /dev/mapper/VolGroup00-mysql_log   191G   4% ext3  rw         /data/mysql-log
 
859
  /dev/mapper/VolGroup01-mysql_data 1008G  44% ext3  rw,noatime /data/mysql-data
 
860
  tmpfs                               48G   0% tmpfs rw         /dev/shm
 
861
EOF
 
862
parse_filesystems "$samples/df-mount-005.txt" "Linux" > "$TMPDIR/got"
 
863
no_diff "$TMPDIR/got" "$TMPDIR/expected" "df-mount-005.txt Linux"
 
864
 
 
865
cat <<EOF > $TMPDIR/expected
 
866
  Filesystem   Size Used Type  Opts                Mountpoint
 
867
  /dev/ad0s1a  496M  32% ufs   local               /
 
868
  /dev/ad0s1d  1.1G   1% ufs   local, soft-updates /var
 
869
  /dev/ad0s1e  496M   0% ufs   local, soft-updates /tmp
 
870
  /dev/ad0s1f   17G   9% ufs   local, soft-updates /usr
 
871
  devfs        1.0K 100% devfs local               /dev
 
872
EOF
 
873
parse_filesystems "$samples/df-mount-006.txt" "FreeBSD" > "$TMPDIR/got"
 
874
no_diff "$TMPDIR/got" "$TMPDIR/expected" "df-mount-006.txt FreeBSD"
 
875
 
 
876
# parse_ip_s_link
 
877
 
 
878
cat <<EOF > "$TMPDIR/expected"
 
879
  interface  rx_bytes rx_packets  rx_errors   tx_bytes tx_packets  tx_errors
 
880
  ========= ========= ========== ========== ========== ========== ==========
 
881
  lo          3000000      25000          0    3000000      25000          0
 
882
  eth0      175000000   30000000          0  125000000     900000          0
 
883
  wlan0      50000000      80000          0   20000000      90000          0
 
884
  vboxnet0          0          0          0          0          0          0
 
885
EOF
 
886
parse_ip_s_link "$samples/ip-s-link-001.txt" > $TMPDIR/got
 
887
no_diff "$TMPDIR/got" "$TMPDIR/expected" "ip-s-link-001.txt"
 
888
 
 
889
cat <<EOF > "$TMPDIR/expected"
 
890
  interface  rx_bytes rx_packets  rx_errors   tx_bytes tx_packets  tx_errors
 
891
  ========= ========= ========== ========== ========== ========== ==========
 
892
  lo       3500000000  350000000          0 3500000000  350000000          0
 
893
  eth0     1750000000 1250000000          0 3500000000  700000000          0
 
894
  eth1     1250000000   60000000          0  900000000   50000000          0
 
895
  sit0              0          0          0          0          0          0
 
896
EOF
 
897
parse_ip_s_link "$samples/ip-s-link-002.txt" > "$TMPDIR/got"
 
898
no_diff "$TMPDIR/got" "$TMPDIR/expected" "ip-s-link-002.txt"
 
899
 
 
900
cat <<EOF > "$TMPDIR/expected"
 
901
  interface  rx_bytes rx_packets  rx_errors   tx_bytes tx_packets  tx_errors
 
902
  ========= ========= ========== ========== ========== ========== ==========
 
903
  lo         25000000     300000          0   25000000     300000          0
 
904
  eth0              0          0          0          0          0          0
 
905
  wlan0             0          0          0          0          0          0
 
906
  virbr0            0          0          0          0          0          0
 
907
EOF
 
908
parse_ip_s_link "$samples/ip-s-link-003.txt" > "$TMPDIR/got"
 
909
no_diff "$TMPDIR/got" "$TMPDIR/expected" "ip-s-link-003.txt"
 
910
 
 
911
# parse_fdisk
 
912
 
 
913
cat <<EOF > "$TMPDIR/expected"
 
914
Device       Type      Start        End               Size
 
915
============ ==== ========== ========== ==================
 
916
/dev/dm-0    Disk                             494609104896
 
917
/dev/dm-1    Disk                               5284823040
 
918
/dev/sda     Disk                             500107862016
 
919
/dev/sda1    Part          1         26          205632000
 
920
/dev/sda2    Part         26      60801       499891392000
 
921
EOF
 
922
parse_fdisk "$samples/fdisk-01.txt" > "$TMPDIR/got"
 
923
no_diff "$TMPDIR/got" "$TMPDIR/expected" "parse_fdisk"
 
924
 
 
925
# parse_ethernet_controller_lspci
 
926
 
 
927
cat <<EOF > $TMPDIR/expected
 
928
  Controller | Broadcom Corporation NetXtreme II BCM5708 Gigabit Ethernet (rev 12)
 
929
  Controller | Broadcom Corporation NetXtreme II BCM5708 Gigabit Ethernet (rev 12)
 
930
EOF
 
931
parse_ethernet_controller_lspci "$samples/lspci-001.txt" > "$TMPDIR/got"
 
932
no_diff "$TMPDIR/got" "$TMPDIR/expected"
 
933
 
 
934
# parse_dmidecode_mem_devices
 
935
 
 
936
cat <<EOF > $TMPDIR/expected
 
937
  Locator   Size     Speed             Form Factor   Type          Type Detail
 
938
  ========= ======== ================= ============= ============= ===========
 
939
  SODIMM0   2048 MB  800 MHz           SODIMM        Other         Synchronous
 
940
  SODIMM1   2048 MB  800 MHz           SODIMM        Other         Synchronous
 
941
EOF
 
942
parse_dmidecode_mem_devices "$samples/dmidecode-001.txt" > $TMPDIR/got
 
943
no_diff "$TMPDIR/got" "$TMPDIR/expected" "dmidecode-001.tx"
 
944
 
 
945
cat <<EOF > "$TMPDIR/expected"
 
946
  Locator   Size     Speed             Form Factor   Type          Type Detail
 
947
  ========= ======== ================= ============= ============= ===========
 
948
  DIMM1     2048 MB  667 MHz (1.5 ns)  {OUT OF SPEC} {OUT OF SPEC} Synchronous
 
949
  DIMM2     2048 MB  667 MHz (1.5 ns)  {OUT OF SPEC} {OUT OF SPEC} Synchronous
 
950
  DIMM3     2048 MB  667 MHz (1.5 ns)  {OUT OF SPEC} {OUT OF SPEC} Synchronous
 
951
  DIMM4     2048 MB  667 MHz (1.5 ns)  {OUT OF SPEC} {OUT OF SPEC} Synchronous
 
952
  DIMM5     2048 MB  667 MHz (1.5 ns)  {OUT OF SPEC} {OUT OF SPEC} Synchronous
 
953
  DIMM6     2048 MB  667 MHz (1.5 ns)  {OUT OF SPEC} {OUT OF SPEC} Synchronous
 
954
  DIMM7     2048 MB  667 MHz (1.5 ns)  {OUT OF SPEC} {OUT OF SPEC} Synchronous
 
955
  DIMM8     2048 MB  667 MHz (1.5 ns)  {OUT OF SPEC} {OUT OF SPEC} Synchronous
 
956
EOF
 
957
parse_dmidecode_mem_devices "$samples/dmidecode-002.txt" > "$TMPDIR/got"
 
958
no_diff "$TMPDIR/got" "$TMPDIR/expected" "dmidecode-002.tx"
 
959
 
 
960
cat <<EOF > "$TMPDIR/expected"
 
961
  Locator   Size     Speed             Form Factor   Type          Type Detail
 
962
  ========= ======== ================= ============= ============= ===========
 
963
            1024 kB  33 MHz            Other         Flash         Non-Volatile
 
964
  D5        4096 MB  1066 MHz          DIMM          Other         Other   
 
965
  D8        4096 MB  1066 MHz          DIMM          Other         Other   
 
966
  D0        {EMPTY}  1333 MHz          DIMM          Other         Other   
 
967
  D0        {EMPTY}  1333 MHz          DIMM          Other         Other   
 
968
  D1        {EMPTY}  1333 MHz          DIMM          Other         Other   
 
969
  D1        {EMPTY}  1333 MHz          DIMM          Other         Other   
 
970
  D2        {EMPTY}  1333 MHz          DIMM          Other         Other   
 
971
  D2        {EMPTY}  1333 MHz          DIMM          Other         Other   
 
972
  D3        {EMPTY}  1333 MHz          DIMM          Other         Other   
 
973
  D3        {EMPTY}  1333 MHz          DIMM          Other         Other   
 
974
  D4        {EMPTY}  1333 MHz          DIMM          Other         Other   
 
975
  D4        {EMPTY}  1333 MHz          DIMM          Other         Other   
 
976
  D5        {EMPTY}  1333 MHz          DIMM          Other         Other   
 
977
  D6        {EMPTY}  1333 MHz          DIMM          Other         Other   
 
978
  D6        {EMPTY}  1333 MHz          DIMM          Other         Other   
 
979
  D7        {EMPTY}  1333 MHz          DIMM          Other         Other   
 
980
  D7        {EMPTY}  1333 MHz          DIMM          Other         Other   
 
981
  D8        {EMPTY}  1333 MHz          DIMM          Other         Other   
 
982
EOF
 
983
parse_dmidecode_mem_devices "$samples/dmidecode-003.txt" > "$TMPDIR/got"
 
984
no_diff "$TMPDIR/got" "$TMPDIR/expected" "dmidecode-003.txt"
 
985
 
 
986
cat <<EOF > "$TMPDIR/expected"
 
987
  Locator   Size     Speed             Form Factor   Type          Type Detail
 
988
  ========= ======== ================= ============= ============= ===========
 
989
  DIMM_A2   4096 MB  1066 MHz (0.9 ns) DIMM          {OUT OF SPEC} Synchronous
 
990
  DIMM_A3   4096 MB  1066 MHz (0.9 ns) DIMM          {OUT OF SPEC} Synchronous
 
991
  DIMM_A5   4096 MB  1066 MHz (0.9 ns) DIMM          {OUT OF SPEC} Synchronous
 
992
  DIMM_A6   4096 MB  1066 MHz (0.9 ns) DIMM          {OUT OF SPEC} Synchronous
 
993
  DIMM_B2   4096 MB  1066 MHz (0.9 ns) DIMM          {OUT OF SPEC} Synchronous
 
994
  DIMM_B3   4096 MB  1066 MHz (0.9 ns) DIMM          {OUT OF SPEC} Synchronous
 
995
  DIMM_B5   4096 MB  1066 MHz (0.9 ns) DIMM          {OUT OF SPEC} Synchronous
 
996
  DIMM_B6   4096 MB  1066 MHz (0.9 ns) DIMM          {OUT OF SPEC} Synchronous
 
997
  DIMM_A1   {EMPTY}  Unknown           DIMM          {OUT OF SPEC} Synchronous
 
998
  DIMM_A4   {EMPTY}  Unknown           DIMM          {OUT OF SPEC} Synchronous
 
999
  DIMM_B1   {EMPTY}  Unknown           DIMM          {OUT OF SPEC} Synchronous
 
1000
  DIMM_B4   {EMPTY}  Unknown           DIMM          {OUT OF SPEC} Synchronous
 
1001
EOF
 
1002
parse_dmidecode_mem_devices "$samples/dmidecode-004.txt" > "$TMPDIR/got"
 
1003
no_diff "$TMPDIR/got" "$TMPDIR/expected" "dmidecode-004.txt"
 
1004
 
 
1005
cat <<EOF > "$TMPDIR/expected"
 
1006
  Locator   Size     Speed             Form Factor   Type          Type Detail
 
1007
  ========= ======== ================= ============= ============= ===========
 
1008
  P1-DIMM1A 16384 MB 1066 MHz (0.9 ns) DIMM          {OUT OF SPEC} Other   
 
1009
  P1-DIMM2A 16384 MB 1066 MHz (0.9 ns) DIMM          {OUT OF SPEC} Other   
 
1010
  P1-DIMM3A 16384 MB 1066 MHz (0.9 ns) DIMM          {OUT OF SPEC} Other   
 
1011
  P2-DIMM1A 16384 MB 1066 MHz (0.9 ns) DIMM          {OUT OF SPEC} Other   
 
1012
  P2-DIMM2A 16384 MB 1066 MHz (0.9 ns) DIMM          {OUT OF SPEC} Other   
 
1013
  P2-DIMM3A 16384 MB 1066 MHz (0.9 ns) DIMM          {OUT OF SPEC} Other   
 
1014
            4096 kB  33 MHz (30.3 ns)  Other         Flash         Non-Volatile
 
1015
  P1-DIMM1B {EMPTY}  Unknown           DIMM          {OUT OF SPEC} Other   
 
1016
  P1-DIMM1C {EMPTY}  Unknown           DIMM          {OUT OF SPEC} Other   
 
1017
  P1-DIMM2B {EMPTY}  Unknown           DIMM          {OUT OF SPEC} Other   
 
1018
  P1-DIMM2C {EMPTY}  Unknown           DIMM          {OUT OF SPEC} Other   
 
1019
  P1-DIMM3B {EMPTY}  Unknown           DIMM          {OUT OF SPEC} Other   
 
1020
  P1-DIMM3C {EMPTY}  Unknown           DIMM          {OUT OF SPEC} Other   
 
1021
  P2-DIMM1B {EMPTY}  Unknown           DIMM          {OUT OF SPEC} Other   
 
1022
  P2-DIMM1C {EMPTY}  Unknown           DIMM          {OUT OF SPEC} Other   
 
1023
  P2-DIMM2B {EMPTY}  Unknown           DIMM          {OUT OF SPEC} Other   
 
1024
  P2-DIMM2C {EMPTY}  Unknown           DIMM          {OUT OF SPEC} Other   
 
1025
  P2-DIMM3B {EMPTY}  Unknown           DIMM          {OUT OF SPEC} Other   
 
1026
  P2-DIMM3C {EMPTY}  Unknown           DIMM          {OUT OF SPEC} Other   
 
1027
EOF
 
1028
parse_dmidecode_mem_devices "$samples/dmidecode-005.txt" > "$TMPDIR/got"
 
1029
no_diff "$TMPDIR/got" "$TMPDIR/expected" "dmidecode-005.txt"
 
1030
 
 
1031
# parse_arcconf
 
1032
 
 
1033
cat <<EOF > "$TMPDIR/expected"
 
1034
       Specs | Adaptec 3405, SAS/SATA, 128 MB cache, Optimal
 
1035
     Battery | 99%, 3d1h11m remaining, Optimal
 
1036
 
 
1037
  LogicalDev Size      RAID Disks Stripe Status  Cache
 
1038
  ========== ========= ==== ===== ====== ======= =======
 
1039
  raid10     279800 MB   10     4 256 KB Optimal On (WB)
 
1040
 
 
1041
  PhysiclDev State   Speed         Vendor  Model        Size        Cache
 
1042
  ========== ======= ============= ======= ============ =========== =======
 
1043
  Hard drive Online  SAS 3.0 Gb/s  SEAGATE ST3146855SS  140014 MB   On (WB)
 
1044
  Hard drive Online  SAS 3.0 Gb/s  SEAGATE ST3146356SS  140014 MB   On (WB)
 
1045
  Hard drive Online  SAS 3.0 Gb/s  SEAGATE ST3146356SS  140014 MB   On (WB)
 
1046
  Hard drive Online  SAS 3.0 Gb/s  SEAGATE ST3146855SS  140014 MB   On (WB)
 
1047
EOF
 
1048
 
 
1049
cat <<EOF > "$TMPDIR/in"
 
1050
# /usr/StorMan/arcconf getconfig 1
 
1051
Controllers found: 1
 
1052
----------------------------------------------------------------------
 
1053
Controller information
 
1054
----------------------------------------------------------------------
 
1055
   Controller Status                        : Optimal
 
1056
   Channel description                      : SAS/SATA
 
1057
   Controller Model                         : Adaptec 3405
 
1058
   Controller Serial Number                 : 8C16103E017
 
1059
   Physical Slot                            : 1
 
1060
   Temperature                              : 35 C/ 95 F (Normal)
 
1061
   Installed memory                         : 128 MB
 
1062
   Copyback                                 : Disabled
 
1063
   Background consistency check             : Disabled
 
1064
   Automatic Failover                       : Enabled
 
1065
   Global task priority                     : High
 
1066
   Stayawake period                         : Disabled
 
1067
   Spinup limit internal drives             : 0
 
1068
   Spinup limit external drives             : 0
 
1069
   Defunct disk drive count                 : 0
 
1070
   Logical devices/Failed/Degraded          : 1/0/0
 
1071
   --------------------------------------------------------
 
1072
   Controller Version Information
 
1073
   --------------------------------------------------------
 
1074
   BIOS                                     : 5.2-0 (17304)
 
1075
   Firmware                                 : 5.2-0 (17304)
 
1076
   Driver                                   : 1.1-5 (2461)
 
1077
   Boot Flash                               : 5.2-0 (17304)
 
1078
   --------------------------------------------------------
 
1079
   Controller Battery Information
 
1080
   --------------------------------------------------------
 
1081
   Status                                   : Optimal
 
1082
   Over temperature                         : No
 
1083
   Capacity remaining                       : 99 percent
 
1084
   Time remaining (at current draw)         : 3 days, 1 hours, 11 minutes
 
1085
 
 
1086
----------------------------------------------------------------------
 
1087
Logical device information
 
1088
----------------------------------------------------------------------
 
1089
Logical device number 0
 
1090
   Logical device name                      : raid10
 
1091
   RAID level                               : 10
 
1092
   Status of logical device                 : Optimal
 
1093
   Size                                     : 279800 MB
 
1094
   Stripe-unit size                         : 256 KB
 
1095
   Read-cache mode                          : Enabled
 
1096
   Write-cache mode                         : Enabled (write-back)
 
1097
   Write-cache setting                      : Enabled (write-back) when protected by battery
 
1098
   Partitioned                              : Unknown
 
1099
   Protected by Hot-Spare                   : No
 
1100
   Bootable                                 : Yes
 
1101
   Failed stripes                           : No
 
1102
   Power settings                           : Disabled
 
1103
   --------------------------------------------------------
 
1104
   Logical device segment information
 
1105
   --------------------------------------------------------
 
1106
   Group 0, Segment 0                       : Present (0,0) 3LN6552C00009903T8E4
 
1107
   Group 0, Segment 1                       : Present (0,1) 3QN26HL400009009KZ0Q
 
1108
   Group 1, Segment 0                       : Present (0,2) 3QN1S2AN00009001XVFZ
 
1109
   Group 1, Segment 1                       : Present (0,3) 3LN648WZ00009903T916
 
1110
 
 
1111
 
 
1112
----------------------------------------------------------------------
 
1113
Physical Device information
 
1114
----------------------------------------------------------------------
 
1115
      Device #0
 
1116
         Device is a Hard drive
 
1117
         State                              : Online
 
1118
         Supported                          : Yes
 
1119
         Transfer Speed                     : SAS 3.0 Gb/s
 
1120
         Reported Channel,Device(T:L)       : 0,0(0:0)
 
1121
         Reported Location                  : Connector 0, Device 0
 
1122
         Vendor                             : SEAGATE
 
1123
         Model                              : ST3146855SS
 
1124
         Firmware                           : 0002
 
1125
         Serial number                      : 3LN6552C00009903T8E4
 
1126
         World-wide name                    : 5000C5000C4DDBB8
 
1127
         Size                               : 140014 MB
 
1128
         Write Cache                        : Enabled (write-back)
 
1129
         FRU                                : None
 
1130
         S.M.A.R.T.                         : No
 
1131
      Device #1
 
1132
         Device is a Hard drive
 
1133
         State                              : Online
 
1134
         Supported                          : Yes
 
1135
         Transfer Speed                     : SAS 3.0 Gb/s
 
1136
         Reported Channel,Device(T:L)       : 0,1(1:0)
 
1137
         Reported Location                  : Connector 0, Device 1
 
1138
         Vendor                             : SEAGATE
 
1139
         Model                              : ST3146356SS
 
1140
         Firmware                           : 0005
 
1141
         Serial number                      : 3QN26HL400009009KZ0Q
 
1142
         World-wide name                    : 5000C50016F5E66C
 
1143
         Size                               : 140014 MB
 
1144
         Write Cache                        : Enabled (write-back)
 
1145
         FRU                                : None
 
1146
         S.M.A.R.T.                         : No
 
1147
      Device #2
 
1148
         Device is a Hard drive
 
1149
         State                              : Online
 
1150
         Supported                          : Yes
 
1151
         Transfer Speed                     : SAS 3.0 Gb/s
 
1152
         Reported Channel,Device(T:L)       : 0,2(2:0)
 
1153
         Reported Location                  : Connector 0, Device 2
 
1154
         Vendor                             : SEAGATE
 
1155
         Model                              : ST3146356SS
 
1156
         Firmware                           : 0005
 
1157
         Serial number                      : 3QN1S2AN00009001XVFZ
 
1158
         World-wide name                    : 5000C50016F5EF4C
 
1159
         Size                               : 140014 MB
 
1160
         Write Cache                        : Enabled (write-back)
 
1161
         FRU                                : None
 
1162
         S.M.A.R.T.                         : No
 
1163
      Device #3
 
1164
         Device is a Hard drive
 
1165
         State                              : Online
 
1166
         Supported                          : Yes
 
1167
         Transfer Speed                     : SAS 3.0 Gb/s
 
1168
         Reported Channel,Device(T:L)       : 0,3(3:0)
 
1169
         Reported Location                  : Connector 0, Device 3
 
1170
         Vendor                             : SEAGATE
 
1171
         Model                              : ST3146855SS
 
1172
         Firmware                           : 0002
 
1173
         Serial number                      : 3LN648WZ00009903T916
 
1174
         World-wide name                    : 5000C5000C4DEA60
 
1175
         Size                               : 140014 MB
 
1176
         Write Cache                        : Enabled (write-back)
 
1177
         FRU                                : None
 
1178
         S.M.A.R.T.                         : No
 
1179
 
 
1180
 
 
1181
Command completed successfully.
 
1182
 
 
1183
EOF
 
1184
parse_arcconf "$TMPDIR/in" > "$TMPDIR/got"
 
1185
no_diff "$TMPDIR/got" "$TMPDIR/expected"
 
1186
 
 
1187
cat <<EOF > "$TMPDIR/expected"
 
1188
       Specs | Adaptec 3405, SAS/SATA, 128 MB cache, Optimal
 
1189
     Battery | 99%, 3d1h11m remaining, Optimal
 
1190
 
 
1191
  LogicalDev Size      RAID Disks Stripe Status  Cache
 
1192
  ========== ========= ==== ===== ====== ======= =======
 
1193
  Raid10-A   571392 MB   10     4 256 KB Optimal On (WB)
 
1194
 
 
1195
  PhysiclDev State   Speed         Vendor  Model        Size        Cache
 
1196
  ========== ======= ============= ======= ============ =========== =======
 
1197
  Hard drive Online  SAS 3.0 Gb/s  SEAGATE ST3300655SS  286102 MB   On (WB)
 
1198
  Hard drive Online  SAS 3.0 Gb/s  SEAGATE ST3300655SS  286102 MB   On (WB)
 
1199
  Hard drive Online  SAS 3.0 Gb/s  SEAGATE ST3300655SS  286102 MB   On (WB)
 
1200
  Hard drive Online  SAS 3.0 Gb/s  SEAGATE ST3300655SS  286102 MB   On (WB)
 
1201
EOF
 
1202
parse_arcconf "$samples/arcconf-002.txt" > "$TMPDIR/got"
 
1203
no_diff "$TMPDIR/got" "$TMPDIR/expected" "arcconf-002.txt"
 
1204
 
 
1205
# Launchpad 917781, parse_arcconf doesn't work with ZMM
 
1206
# https://bugs.launchpad.net/percona-toolkit/+bug/917781
 
1207
cat <<EOF > "$TMPDIR/expected"
 
1208
       Specs | Adaptec 5405Z, SAS/SATA, 512 MB cache, Optimal
 
1209
     Battery | ZMM Optimal
 
1210
 
 
1211
  LogicalDev Size      RAID Disks Stripe Status  Cache
 
1212
  ========== ========= ==== ===== ====== ======= =======
 
1213
  RAID10-A   571382 MB   10     4 256 KB Optimal On (WB)
 
1214
 
 
1215
  PhysiclDev State   Speed         Vendor  Model        Size        Cache
 
1216
  ========== ======= ============= ======= ============ =========== =======
 
1217
  Hard drive Full rpm,Powered off SATA 3.0 Gb/s WDC     WD3000HLFS-0 286168 MB   On (WB)
 
1218
  Hard drive Full rpm,Powered off SATA 3.0 Gb/s WDC     WD3000HLFS-0 286168 MB   On (WB)
 
1219
  Hard drive Full rpm,Powered off SATA 3.0 Gb/s WDC     WD3000HLFS-0 286168 MB   On (WB)
 
1220
  Hard drive Full rpm,Powered off SATA 3.0 Gb/s WDC     WD3000HLFS-0 286168 MB   On (WB)
 
1221
EOF
 
1222
 
 
1223
parse_arcconf "$samples/arcconf-004_917781.txt" > "$TMPDIR/got"
 
1224
no_diff "$TMPDIR/got" "$TMPDIR/expected" "Bug 917781"
 
1225
 
 
1226
# Launchpad 900285, ${var/ /} doesn't work in sh
 
1227
# https://bugs.launchpad.net/percona-toolkit/+bug/900285
 
1228
cat <<EOF > "$TMPDIR/expected"
 
1229
       Specs | Adaptec 5805Z, SAS/SATA, 512 MB cache, Optimal
 
1230
     Battery | ZMM Optimal
 
1231
 
 
1232
  LogicalDev Size      RAID Disks Stripe Status  Cache
 
1233
  ========== ========= ==== ===== ====== ======= =======
 
1234
  RAID10-A   121790 MB   10     4 256 KB Optimal On (WB)
 
1235
  RAID1-A    285686 MB    1     0        Optimal On (WB)
 
1236
 
 
1237
  PhysiclDev State   Speed         Vendor  Model        Size        Cache
 
1238
  ========== ======= ============= ======= ============ =========== =======
 
1239
  Hard drive Full rpm,Powered off SATA 3.0 Gb/s INTEL   SSDSA2SH064G1GC 61057 MB    On (WB)
 
1240
  Hard drive Full rpm,Powered off SATA 3.0 Gb/s INTEL   SSDSA2SH064G1GC 61057 MB    On (WB)
 
1241
  Hard drive Full rpm,Powered off SATA 3.0 Gb/s INTEL   SSDSA2SH064G1GC 61057 MB    On (WB)
 
1242
  Hard drive Full rpm,Powered off SATA 3.0 Gb/s INTEL   SSDSA2SH064G1GC 61057 MB    On (WB)
 
1243
  Hard drive Full rpm,Powered off SAS 3.0 Gb/s  SEAGATE ST3300657SS  286102 MB   On (WB)
 
1244
  Hard drive Full rpm,Powered off SAS 3.0 Gb/s  SEAGATE ST3300657SS  286102 MB   On (WB)
 
1245
EOF
 
1246
parse_arcconf "$samples/arcconf-003_900285.txt" > "$TMPDIR/got"
 
1247
no_diff "$TMPDIR/got" "$TMPDIR/expected" "Bug 900285"
 
1248
 
 
1249
# parse_uptime
 
1250
 
 
1251
cat <<EOF > "$TMPDIR/in"
 
1252
 15:10:14 up 1 day, 15:08, 11 users,  load average: 0.18, 0.09, 0.08
 
1253
EOF
 
1254
is \
 
1255
   "$( parse_uptime "$TMPDIR/in" )" \
 
1256
   "1 day, 15:08, 11 users,  load average: 0.18, 0.09, 0.08" \
 
1257
   "parse_uptime works with Ubuntu's uptime"
 
1258
 
 
1259
cat <<EOF > "$TMPDIR/in"
 
1260
 some weird format etc 1 day, 15:08, 11 users,  load average: 0.18, 0.09, 0.08
 
1261
EOF
 
1262
is \
 
1263
   "$( parse_uptime "$TMPDIR/in" )" \
 
1264
   " some weird format etc 1 day, 15:08, 11 users,  load average: 0.18, 0.09, 0.08" \
 
1265
   "parse_uptime returns uptime as-if if it doesn't contain an 'up'"
 
1266
 
 
1267
# parse_lvs
 
1268
 
 
1269
is \
 
1270
   "$(format_lvs "" "")" \
 
1271
   "Unable to collect information" \
 
1272
   "format_lvs has a meaningful error message if all goes wrong"
 
1273
 
 
1274
 
 
1275
echo "Pretending to be an lvs dump" > "$TMPDIR/in"
 
1276
is \
 
1277
   "$(format_lvs "$TMPDIR/in" "")" \
 
1278
   "Pretending to be an lvs dump" \
 
1279
   "format_lvs dumps the file passed in"
 
1280
 
 
1281
# report_system_summary
 
1282
parse_options "$BIN_DIR/pt-summary"
 
1283
 
 
1284
cat <<EOF > "$TMPDIR/expected"
 
1285
    Hostname | 
 
1286
      Uptime | 57 mins, 1 user, load averages: 0.16, 0.03, 0.07
 
1287
    Platform | FreeBSD
 
1288
     Release | 8.2-RELEASE
 
1289
      Kernel | 199506
 
1290
Architecture | CPU = 32-bit, OS = 32-bit
 
1291
 Virtualized | No virtualization detected
 
1292
# Processor ##################################################
 
1293
  Processors | virtual = 1
 
1294
      Speeds | 2109
 
1295
      Models | AMD Athlon(tm) 64 X2 Dual Core Processor 4000+
 
1296
# Memory #####################################################
 
1297
       Total | 499.4M
 
1298
     Virtual | 511.9M
 
1299
        Used | 66.4M
 
1300
     UsedRSS | 17.7M
 
1301
# Mounted Filesystems ########################################
 
1302
  Filesystem   Size Used Type    Opts                Mountpoint
 
1303
  /dev/ad0s1a  620M  30% ufs     local               /
 
1304
  /dev/ad0s1d  1.3G   0% ufs     local, soft-updates /var
 
1305
  /dev/ad0s1e  341M   0% ufs     local, soft-updates /tmp
 
1306
  /dev/ad0s1f  3.3G  32% ufs     local, soft-updates /usr
 
1307
  /dev/da0s1   3.8G   0% msdosfs local               /mnt/usb
 
1308
  devfs        1.0K 100% devfs   local, multilabel   /dev
 
1309
  procfs       4.0K 100% procfs  local               /proc
 
1310
# RAID Controller ############################################
 
1311
  Controller | No RAID controller detected
 
1312
# Top Processes ##############################################
 
1313
  PID USERNAME  THR PRI NICE   SIZE    RES STATE    TIME   WCPU COMMAND
 
1314
23318 root        1  76    0  3632K  1744K wait     0:00  0.98% sh
 
1315
  447 root        1  44    0  1888K   584K select   0:00  0.00% devd
 
1316
  945 root        1  44    0  4672K  2336K pause    0:00  0.00% csh
 
1317
  556 root        1  44    0  3352K  1264K select   0:00  0.00% syslogd
 
1318
  848 root        1  44    0  6092K  3164K select   0:00  0.00% sendmail
 
1319
  859 root        1  44    0  3380K  1308K nanslp   0:00  0.00% cron
 
1320
  931 root        1  44    0  3816K  1724K wait     0:00  0.00% login
 
1321
  937 root        1  76    0  3352K  1096K ttyin    0:00  0.00% getty
 
1322
  934 root        1  76    0  3352K  1096K ttyin    0:00  0.00% getty
 
1323
# Notable Processes ##########################################
 
1324
  PID    OOM    COMMAND
 
1325
    ?      ?    sshd doesn't appear to be running
 
1326
# Simplified and fuzzy rounded vmstat (wait please) ##########
 
1327
 procs      memory      page                    disks     faults         cpu
 
1328
 r b w     avm    fre   flt  re  pi  po    fr  sr ad0 da0   in   sy   cs us sy id
 
1329
 1 0 0   63720  339504  1158   0   0   0  1022   0   0   0  246 1201  336 22 15 63
 
1330
 0 0 0   58164  339792  7924   0   0   0  6663   0   4   3  242 5829  744 15 71 14
 
1331
 0 0 0   58164  339792     0   0   0   0     0   0   0   0  230  107  231  0  9 91
 
1332
 0 0 0   58164  339792     0   0   0   0     0   0   0   0  230  107  229  0  3 97
 
1333
 0 0 0   58164  339792     0   0   0   0     0   0   0   0  231  115  229  0  5 95
 
1334
# The End ####################################################
 
1335
EOF
 
1336
report_system_summary "$samples/BSD/freebsd_001" | tail -n +3 > "$TMPDIR/got"
 
1337
no_diff "$TMPDIR/got" "$TMPDIR/expected" "report_system_summary works with samples from a FreeBSD box"
 
1338
 
 
1339
cat <<EOF > "$TMPDIR/expected"
 
1340
    Hostname | 
 
1341
      Uptime | 43 mins, 2 users, load averages: 0.00, 0.00, 0.00
 
1342
    Platform | NetBSD
 
1343
     Release | 5.1.2
 
1344
      Kernel | 501000200
 
1345
Architecture | CPU = 32-bit, OS = 32-bit
 
1346
 Virtualized | No virtualization detected
 
1347
# Processor ##################################################
 
1348
  Processors | physical = 1, cores = 0, virtual = 1, hyperthreading = no
 
1349
      Speeds | 1x2178.48
 
1350
      Models | 1xAMD Athlon(tm) 64 X2 Dual Core Processor 4000+
 
1351
      Caches | 
 
1352
# Memory #####################################################
 
1353
       Total | 127.6M
 
1354
        User | 127.2M
 
1355
        Swap | 64.5M
 
1356
     UsedRSS | 10.6M
 
1357
# Mounted Filesystems ########################################
 
1358
  Filesystem  Size Used Type Opts                                                             Mountpoint
 
1359
  /dev/sd0e   3.8G   0% yp   dev/sd0e 3.8G 17M 3.7G 0% /mnt/usb on /mnt/usb type msdos (local /mnt/usb
 
1360
  /dev/wd0a   1.8G  30% yp   dev/wd0a 1.8G 545M 1.2G 30% / on / type ffs (local               /
 
1361
  kernfs      1.0K 100% yp   ernfs 1.0K 1.0K 0B 100% /kern on /kern type kernfs (local        /kern
 
1362
  procfs      4.0K 100% yp   rocfs 4.0K 4.0K 0B 100% /proc on /proc type procfs (local        /proc
 
1363
  ptyfs       1.0K 100% yp   tyfs 1.0K 1.0K 0B 100% /dev/pts on /dev/pts type ptyfs (local    /dev/pts
 
1364
# RAID Controller ############################################
 
1365
  Controller | No RAID controller detected
 
1366
# Top Processes ##############################################
 
1367
  PID USERNAME PRI NICE   SIZE   RES STATE      TIME   WCPU    CPU COMMAND
 
1368
    0 root     124    0     0K   20M syncer     0:01  0.00%  0.00% [system]
 
1369
 3922 root      43    0  2976K  984K CPU        0:00  0.00%  0.00% top
 
1370
  277 root      85    0  5592K 2232K wait       0:00  0.00%  0.00% login
 
1371
  279 root      85    0  5592K 2164K wait       0:00  0.00%  0.00% login
 
1372
 3501 root      85    0  2836K 1396K pause      0:00  0.00%  0.00% ksh
 
1373
  284 root      85    0  2960K 1192K wait       0:00  0.00%  0.00% sh
 
1374
 1957 root      85    0  2960K 1164K ttyraw     0:00  0.00%  0.00% sh
 
1375
  116 root      85    0  2940K 1016K kqueue     0:00  0.00%  0.00% syslogd
 
1376
  272 root      85    0  2920K  940K ttyraw     0:00  0.00%  0.00% getty
 
1377
# Notable Processes ##########################################
 
1378
  PID    OOM    COMMAND
 
1379
    ?      ?    sshd doesn't appear to be running
 
1380
# Simplified and fuzzy rounded vmstat (wait please) ##########
 
1381
 procs    memory      page                       disks   faults      cpu
 
1382
 r b w    avm    fre  flt  re  pi   po   fr   sr w0 c0   in   sy  cs us sy id
 
1383
 2 0 0  78624  21544  103   0   0    0    0    0  6  0  113  154  33  0  2 98
 
1384
 2 0 0  78652  21260 12425  0   0    0    0    0  0  0   92 6208 355 12 84  4
 
1385
 0 0 0  78564  21364 1208   0   0    0    0    0  0  0   98  806  43  2  9 89
 
1386
 0 0 0  78564  21364    0   0   0    0    0    0  0  0  101   11   9  0 0 100
 
1387
 0 0 0  78564  21364    0   0   0    0    0    0  0  0  101   11  10  0 0 100
 
1388
# The End ####################################################
 
1389
EOF
 
1390
report_system_summary "$samples/BSD/netbsd_001" | tail -n +3 > "$TMPDIR/got"
 
1391
no_diff "$TMPDIR/got" "$TMPDIR/expected" "report_system_summary works with samples from a NetBSD box"
 
1392
 
 
1393
cat <<EOF > "$TMPDIR/expected"
 
1394
    Hostname | openbsd.my.domain
 
1395
      Uptime | 1:14, 1 user, load averages: 0.44, 0.20, 0.16
 
1396
    Platform | OpenBSD
 
1397
     Release | 5.0
 
1398
      Kernel | 201111
 
1399
Architecture | CPU = 32-bit, OS = 32-bit
 
1400
 Virtualized | No virtualization detected
 
1401
# Processor ##################################################
 
1402
  Processors | 1
 
1403
      Speeds | 2111
 
1404
      Models | AMD 
 
1405
# Memory #####################################################
 
1406
       Total | 255.5M
 
1407
        User | 255.5M
 
1408
        Swap | 81.1M
 
1409
     UsedRSS | 5.3M
 
1410
# Mounted Filesystems ########################################
 
1411
  Filesystem  Size Used Type Opts                                               Mountpoint
 
1412
  /dev/sd0i   3.8G   0% yp   long                                               /mnt/usb
 
1413
  /dev/wd0a   788M   6% yp   dev/wd0a 788M 42.5M 706M 6% / on / type ffs (local /
 
1414
  /dev/wd0d   893M  48% yp   nodev                                              /usr
 
1415
  /dev/wd0e   252M  37% yp   nodev, nosuid                                      /home
 
1416
# RAID Controller ############################################
 
1417
  Controller | No RAID controller detected
 
1418
# Top Processes ##############################################
 
1419
  PID USERNAME PRI NICE  SIZE   RES STATE     WAIT      TIME    CPU COMMAND
 
1420
22422 root      18    0  888K 1012K sleep     pause     0:00  0.93% sh
 
1421
20216 _pflogd    4    0  528K  312K sleep     bpf       0:01  0.00% pflogd
 
1422
22982 root       2    0 1372K 1956K sleep     select    0:00  0.00% sendmail
 
1423
26829 root      18    0  544K  532K sleep     pause     0:00  0.00% ksh
 
1424
17299 _syslogd   2    0  524K  752K sleep     poll      0:00  0.00% syslogd
 
1425
 7254 root       2    0  508K  872K idle      select    0:00  0.00% cron
 
1426
    1 root      10    0  544K  324K idle      wait      0:00  0.00% init
 
1427
28237 root       2    0  500K  696K idle      netio     0:00  0.00% syslogd
 
1428
30259 root       3    0  408K  812K idle      ttyin     0:00  0.00% getty
 
1429
# Notable Processes ##########################################
 
1430
  PID    OOM    COMMAND
 
1431
    ?      ?    sshd doesn't appear to be running
 
1432
# Simplified and fuzzy rounded vmstat (wait please) ##########
 
1433
 procs    memory       page                    disks    traps          cpu
 
1434
 r b w    avm     fre  flt  re  pi  po  fr  sr wd0 cd0  int   sys   cs us sy id
 
1435
 2 1 0   7608  191356   66   0   0   0   0   0   2   0  231   108   14  0  1 99
 
1436
 1 1 0   7804  191192 9916   0   0   0   0   0   0   0  234 14726  315  9 90  1
 
1437
 1 0 0   7600  191360 9461   0   0   0   0   0   0   0  256 14435  285  6 94  0
 
1438
 0 0 0   7496  191456 1272   0   0   0   0   0   0   0  256  1973   50  2 12 85
 
1439
 0 0 0   7496  191456   11   0   0   0   0   0   0   0  230    23   12  0  0 100
 
1440
# The End ####################################################
 
1441
EOF
 
1442
report_system_summary "$samples/BSD/openbsd_001" | tail -n +3  > "$TMPDIR/got"
 
1443
no_diff "$TMPDIR/got" "$TMPDIR/expected" "report_system_summary works with samples from a OpenBSD box"
 
1444
 
 
1445
cat <<EOF > "$TMPDIR/expected"
 
1446
    Hostname | hugmeir
 
1447
      Uptime | 1 day, 15:14,  5 users,  load average: 0.00, 0.06, 0.07
 
1448
      System | Quanta; UW3; vTBD (Other)
 
1449
 Service Tag | 123456789
 
1450
    Platform | Linux
 
1451
     Release | Ubuntu 11.10 (oneiric)
 
1452
      Kernel | 3.0.0-16-generic
 
1453
Architecture | CPU = 32-bit, OS = 32-bit
 
1454
   Threading | NPTL 2.13
 
1455
     SELinux | No SELinux detected
 
1456
 Virtualized | No virtualization detected
 
1457
# Processor ##################################################
 
1458
  Processors | physical = 1, cores = 1, virtual = 2, hyperthreading = yes
 
1459
      Speeds | 1x1000.000, 1x1666.000
 
1460
      Models | 2xIntel(R) Atom(TM) CPU N455 @ 1.66GHz
 
1461
      Caches | 2x512 KB
 
1462
# Memory #####################################################
 
1463
       Total | 2.0G
 
1464
        Free | 477.3M
 
1465
        Used | physical = 1.5G, swap allocated = 2.0G, swap used = 0.0, virtual = 1.5G
 
1466
     Buffers | 194.9M
 
1467
      Caches | 726.8M
 
1468
       Dirty | 144 kB
 
1469
     UsedRSS | 1.1G
 
1470
  Swappiness | 60
 
1471
 DirtyPolicy | 20, 10
 
1472
  Locator   Size     Speed             Form Factor   Type          Type Detail
 
1473
  ========= ======== ================= ============= ============= ===========
 
1474
  DIMM0     2048 MB  667 MHz (1.5 ns)  SODIMM        DDR2          Synchronous
 
1475
# Mounted Filesystems ########################################
 
1476
  Filesystem  Size Used Type       Opts                                                                                              Mountpoint
 
1477
  /dev/sda7   333G  12% ext4       rw,errors=remount-ro,commit=0                                                                     /
 
1478
  /dev/sdb1   3.8G   1% vfat       rw,nosuid,nodev,uid=1000,gid=1000,shortname=mixed,dmask=0077,utf8=1,showexec,flush,uhelper=udisks /media/PENDRIVE
 
1479
  none       1002M   1% tmpfs      rw,noexec,nosuid,nodev,size=5242880                                                               /run/shm
 
1480
  none       1002M   1% tmpfs      rw,nosuid,nodev                                                                                   /run/shm
 
1481
  none       1002M   1% debugfs    rw                                                                                                /run/shm
 
1482
  none       1002M   1% securityfs rw                                                                                                /run/shm
 
1483
  none        5.0M   0% tmpfs      rw,noexec,nosuid,nodev,size=5242880                                                               /run/lock
 
1484
  none        5.0M   0% tmpfs      rw,nosuid,nodev                                                                                   /run/lock
 
1485
  none        5.0M   0% debugfs    rw                                                                                                /run/lock
 
1486
  none        5.0M   0% securityfs rw                                                                                                /run/lock
 
1487
  tmpfs       401M   1% tmpfs      rw,noexec,nosuid,size=10%,mode=0755                                                               /run
 
1488
  udev        995M   1% devtmpfs   rw,mode=0755                                                                                      /dev
 
1489
# Disk Schedulers And Queue Size #############################
 
1490
         sda | [cfq] 128
 
1491
         sdb | [cfq] 128
 
1492
# Disk Partioning ############################################
 
1493
Device       Type      Start        End               Size
 
1494
============ ==== ========== ========== ==================
 
1495
/dev/sda     Disk                             500107862016
 
1496
/dev/sda1    Part       2048     206847          104857088
 
1497
/dev/sda2    Part     206848   12494847         6291455488
 
1498
/dev/sda3    Part   12494848  207808587       100000634368
 
1499
/dev/sda4    Part  207810558  976771071       393707782656
 
1500
/dev/sda5    Part  207810560  259807667        26622518784
 
1501
/dev/sda6    Part  972603392  976771071         2133851648
 
1502
/dev/sda7    Part  259809280  968421375       362809392640
 
1503
/dev/sda8    Part  968423424  972591103         2133851648
 
1504
/dev/sdb     Disk                               4041211904
 
1505
/dev/sdb1    Part         63    7892991         4041179136
 
1506
# Kernel Inode State #########################################
 
1507
dentry-state | 78471 67588 45 0  0  0
 
1508
     file-nr | 9248  0  203574
 
1509
    inode-nr | 70996 10387
 
1510
# LVM Volumes ################################################
 
1511
  No volume groups found
 
1512
# LVM Volume Groups ##########################################
 
1513
Unable to collect information
 
1514
# RAID Controller ############################################
 
1515
  Controller | No RAID controller detected
 
1516
# Network Config #############################################
 
1517
  Controller | Realtek Semiconductor Co., Ltd. RTL8101E/RTL8102E PCI Express Fast Ethernet controller (rev 02)
 
1518
 FIN Timeout | 60
 
1519
  Port Range | 61000
 
1520
# Interface Statistics #######################################
 
1521
  interface  rx_bytes rx_packets  rx_errors   tx_bytes tx_packets  tx_errors
 
1522
  ========= ========= ========== ========== ========== ========== ==========
 
1523
  lo         25000000     350000          0   25000000     350000          0
 
1524
  eth0              0          0          0          0          0          0
 
1525
  wlan0             0          0          0          0          0          0
 
1526
  virbr0            0          0          0          0          0          0
 
1527
# Network Connections ########################################
 
1528
  Connections from remote IP addresses
 
1529
  Connections to local IP addresses
 
1530
  Connections to top 10 local ports
 
1531
  States of connections
 
1532
    LISTEN              4
 
1533
# Top Processes ##############################################
 
1534
  PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
 
1535
 1548 hugmeir   20   0  122m  14m  10m S    2  0.7   1:44.97 gnome-settings-
 
1536
 1567 hugmeir   20   0  257m  88m  22m S    2  4.4  83:35.58 compiz
 
1537
 4455 hugmeir   20   0  283m  30m  21m S    2  1.5  30:42.87 knotify4
 
1538
17394 hugmeir   20   0  118m  37m  26m S    2  1.9   0:29.35 kwrite
 
1539
30819 root      20   0  2824 1144  844 R    2  0.1   0:00.03 top
 
1540
    1 root      20   0  3328 1912 1248 S    0  0.1   0:01.55 init
 
1541
    2 root      20   0     0    0    0 S    0  0.0   0:00.07 kthreadd
 
1542
    3 root      20   0     0    0    0 S    0  0.0   0:05.54 ksoftirqd/0
 
1543
    6 root      RT   0     0    0    0 S    0  0.0   0:00.00 migration/0
 
1544
# Notable Processes ##########################################
 
1545
  PID    OOM    COMMAND
 
1546
    ?      ?    sshd doesn't appear to be running
 
1547
  305    -17    udevd
 
1548
29745    -17    udevd
 
1549
29746    -17    udevd
 
1550
# Simplified and fuzzy rounded vmstat (wait please) ##########
 
1551
  procs  ---swap-- -----io---- ---system---- --------cpu--------
 
1552
   r  b    si   so    bi    bo     ir     cs  us  sy  il  wa  st
 
1553
   2  0     0    0     2     1    150     50   4   1  95   0    
 
1554
   0  0     0    0     0     8    900   2250  28  26  46   0    
 
1555
   0  0     0    0     0     0    200    200   1   0  99   0    
 
1556
   1  0     0    0     0   150    225    225   1   1  95   3    
 
1557
   0  0     0    0     0   150    250    250   1   0  99   0    
 
1558
# The End ####################################################
 
1559
EOF
 
1560
 
 
1561
report_system_summary "$samples/Linux/001" | tail -n +3 > "$TMPDIR/got"
 
1562
cp "$TMPDIR/got" yadda.txt
 
1563
no_diff "$TMPDIR/got" "$TMPDIR/expected" "report_system_summary works with samples from Linux (Ubuntu)"
 
1564
 
 
1565
report_system_summary "$samples/Linux/002" | tail -n +3 > "$TMPDIR/got"
 
1566
no_diff "$TMPDIR/got" "$samples/Linux/output_002.txt" "report_system_summary works with samples from Linux (CentOS 5.7, as root)"
 
1567
 
 
1568
report_system_summary "$samples/Linux/003" | tail -n +3 > "$TMPDIR/got"
 
1569
no_diff "$TMPDIR/got" "$samples/Linux/output_003.txt" "report_system_summary works with samples from Linux (CentOS 5.7, as non-root)"