File Coverage

blib/lib/Parse/NetApp/ASUP.pm
Criterion Covered Total %
statement 849 1512 56.1
branch 345 780 44.2
condition 4 48 8.3
subroutine 134 149 89.9
pod 139 140 99.2
total 1471 2629 55.9


line stmt bran cond sub pod time code
1             $Parse::NetApp::ASUP::VERSION='1.17';
2              
3             =head1 NAME:
4              
5             Parse::NetApp::ASUP - Parse NetApp Weekly Auto Support Files
6              
7             =head1 SYNOPSIS:
8              
9             Parse NetApp Weekly Auto Support Files
10              
11             =head1 USAGE:
12              
13             use Parse::NetApp::ASUP;
14            
15             my $pna = Parse::NetApp::ASUP->new();
16            
17             $pna->load($raw_asup_data_as_scalar);
18            
19             =cut
20              
21 126     126   6208243 use Carp;
  126         407  
  126         10524  
22              
23 126     126   1129 use strict;
  126         293  
  126         5221  
24 126     126   856 use warnings;
  126         242  
  126         12679849  
25              
26             package Parse::NetApp::ASUP;
27              
28             =head3 new()
29              
30             Instance a new parser.
31              
32             =cut
33              
34             sub new {
35 1000     1000 1 635125 my $self = {};
36 1000         2210 bless $self;
37 1000         10035 return $self;
38             }
39              
40             =head3 load($raw_asup_data)
41              
42             Load a raw asup data file for parsing.
43              
44             =cut
45              
46             sub load {
47 1000     1000 1 26389612 my $self = shift @_;
48 1000         3774 my $asup = shift @_;
49 1000 50 33     33128 if ( not defined $asup or not length $asup ) {
50 0         0 warn "load() called without input data.";
51 0         0 return undef;
52             }
53 1000         5072 $self->{asup} = $asup;
54 1000         4200 return 1;
55             }
56              
57             sub version {
58 0     0 0 0 return $Parse::NetApp::ASUP::VERSION;
59             }
60              
61             ### Utilties
62              
63             sub _agnostic_line_split { # Now dealing with CRLF and the occasional standalone LF
64 13     13   33 my $all = $_[0];
65 13         681781 my @lines = split /\r?\n/, $all;
66 13         163451 return @lines;
67             }
68              
69             sub _regex_lun_name {
70 7     7   382 return qr/[\d\w\/\{\}\.-]+/;
71             }
72              
73             sub _regex_qtree_name {
74 0     0   0 return qr/[\w\-\? ]+/;
75             }
76              
77             sub _regex_vol_name {
78 0     0   0 return qr/[\w\-\?]+/;
79             }
80              
81             sub _regex_path {
82 1     1   19 return qr/[\w\-\?\$\\]+/;
83             }
84              
85             =head1 GENERAL METHODS
86              
87             =head3 asup_version()
88              
89             Returns the version of the loaded ASUP file.
90              
91             =cut
92              
93             sub asup_version {
94 1000 50   1000 1 458253 my $raw = defined $_[0]->{asup} ? $_[0]->{asup} : $_[0];
95            
96 1000 50       205492 if ( $raw =~ /^VERSION=NetApp Release ([\w\.\d]+)/ms ) {
97 1000         7538 return "$1";
98             }
99            
100 0 0       0 if ( $raw =~ /^X-Netapp-asup-os-version: NetApp Release ([\w\.\d]+)/ms ) {
101 0         0 return "$1";
102             }
103              
104 0         0 return 'unknown';
105             }
106              
107             =head3 extract($raw)
108              
109             This method attempts to return key and commonly used sections of the ASUP as
110             a parsed data structure.
111              
112             =cut
113              
114             sub extract {
115 0     0 1 0 my $raw = shift @_;
116              
117 0         0 my $version = Parse::NetApp::ASUP::asup_version($raw);
118 0         0 $version =~ /^(\d)\.(\d)/;
119 0         0 my $maj = $1;
120 0         0 my $min = $2;
121              
122 0         0 my $extracts;
123            
124 0 0 0     0 if ( $maj == 8 and $min > 0 ) {
125 0         0 my $export = Parse::NetApp::ASUP::extract_exports($raw);
126 0         0 my $lun_conf = Parse::NetApp::ASUP::extract_lun_configuration($raw);
127 0         0 my $qtree_stat = Parse::NetApp::ASUP::extract_qtree_status($raw);
128 0         0 my $xheader = Parse::NetApp::ASUP::extract_xheader($raw);
129              
130 0         0 $extracts = ASUP::iterative_extract($raw);
131 0         0 $extracts->{_METHOD} = 'Progressive';
132            
133 0         0 $extracts->{export} = $export;
134 0         0 $extracts->{lun_conf} = $lun_conf;
135 0         0 $extracts->{qtree_stat} = $qtree_stat;
136 0         0 $extracts->{xheader} = $xheader;
137             } else {
138 0         0 $extracts->{_METHOD} = 'Singular';
139 0         0 $extracts->{xml} = [];
140              
141 0         0 $extracts->{df} = Parse::NetApp::ASUP::extract_df($raw);
142 0         0 $extracts->{export} = Parse::NetApp::ASUP::extract_exports($raw);
143 0         0 $extracts->{header} = Parse::NetApp::ASUP::extract_headers($raw);
144 0         0 $extracts->{lun_conf} = Parse::NetApp::ASUP::extract_lun_configuration($raw);
145 0         0 $extracts->{qtree_stat} = Parse::NetApp::ASUP::extract_qtree_status($raw);
146 0         0 $extracts->{sysconfig_a} = Parse::NetApp::ASUP::extract_sysconfig_a($raw);
147 0         0 $extracts->{vol_status} = Parse::NetApp::ASUP::extract_vol_status($raw);
148 0         0 $extracts->{xheader} = Parse::NetApp::ASUP::extract_xheader($raw);
149             }
150              
151 0         0 $extracts->{_VERSION} = $version;
152 0         0 return $extracts;
153             }
154              
155             =head3 iterative_extract()
156              
157             Version 8 and higher extract has to be iterative
158              
159             =cut
160              
161             sub iterative_extract {
162 0     0 1 0 my $raw = shift @_;
163 0         0 my %ex = ( xml => [] );
164            
165 0         0 ($ex{mailheader},$ex{header},$raw) = split /\n\n+/, $raw, 3;
166              
167             # Now dealing with CRLF and the occasional standalone LF
168            
169 0         0 my @lines = Parse::NetApp::ASUP::_agnostic_line_split($raw);
170              
171             # sysconfig -a
172            
173 0         0 while ( $lines[0] =~ /^(\t|\s{5})/ ) {
174 0         0 $ex{sysconfig_a} .= (shift @lines) . "\n";
175             }
176              
177             # sysconfig -d
178              
179 0 0       0 $ex{sysconfig_d} .= (shift @lines) . "\n" if ( $lines[0] =~ /^Device/ );
180 0 0       0 $ex{sysconfig_d} .= (shift @lines) . "\n" if ( $lines[0] =~ /^------/ );
181 0         0 while ( $lines[0] =~ /^[0-9a-f]{2}\.[0-9a-f]{2}/ ) {
182 0         0 $ex{sysconfig_d} .= (shift @lines) . "\n";
183             }
184            
185             # sn
186              
187 0 0       0 $ex{serialnum} = (shift @lines) . "\n" if $lines[0] =~ /^system serial number/;
188            
189             # options
190              
191 0         0 while ( $lines[0] =~ /^[a-z_\-0-9]+(\.[a-z_\-0-9]+)+\s+/i ) {
192 0         0 $ex{options} .= (shift @lines) . "\n";
193             }
194              
195             # service usage
196            
197 0         0 while ( $lines[0] =~ /^Service statistics as of/ ) {
198 0         0 $ex{service_usage} .= (shift @lines)."\n";
199 0         0 while ( $lines[0] =~ /^ \S+\s+\(\S+\).+recorded/ ) {
200 0         0 $ex{service_usage} .= (shift @lines)."\n";
201 0         0 while ( $lines[0] =~ /^\s+[A-Z](\s+\d+,){3}/ ) {
202 0         0 $ex{service_usage} .= (shift @lines)."\n";
203             }
204             }
205             }
206              
207             # ifconfig -a
208            
209 0         0 while ( $lines[0] =~ /^[a-zA-Z0-9\-]+: flags/ ) {
210 0         0 $ex{ifconfig_a} .= (shift @lines) . "\n";
211 0         0 while ( $lines[0] =~ /^(\t|\s{3})/ ) {
212 0         0 $ex{ifconfig_a} .= (shift @lines) . "\n";
213             }
214             }
215            
216             # ifstat -a
217            
218 0 0       0 shift @lines if $lines[0] =~ /^$/; # Remove a blank line
219            
220 0         0 while ( $lines[0] =~ /^-- interface/ ) {
221 0         0 $ex{ifstat_a} .= (shift @lines)."\n";
222 0 0       0 $ex{ifstat_a} .= (shift @lines)."\n" if $lines[0] =~ /^$/;
223 0         0 while ( $lines[0] =~ /^[A-Z_]+\w/ ) {
224 0         0 $ex{ifstat_a} .= (shift @lines)."\n";
225 0         0 while ( $lines[0] =~ /^ [A-Z]/i ) {
226 0         0 $ex{ifstat_a} .= (shift @lines)."\n";
227             }
228             }
229 0         0 while ( $lines[0] =~ /^$/ ) { $ex{ifstat_a} .= (shift @lines)."\n"; }
  0         0  
230             }
231            
232             # cifs_stat
233            
234 0         0 while ( $lines[0] =~ /^\s+(\S+\s+)+\d+(\s+\d+\%)?$/ ) {
235 0         0 $ex{cifs_stat} .= (shift @lines)."\n";
236             }
237 0         0 while ( $lines[0] =~ /^(Max|Local|RPC)/ ) {
238 0         0 $ex{cifs_stat} .= (shift @lines)."\n";
239             }
240            
241             # Volume-language
242              
243 0         0 while ( $lines[0] =~ /^\s+Volume Language$/ ) {
244 0         0 $ex{volume_language} .= (shift @lines)."\n";
245 0         0 while ( $lines[0] =~ /^(\s+)?\S+( \S+){1,2} \(.+\)$/ ) {
246 0         0 $ex{volume_language} .= (shift @lines)."\n";
247             }
248             }
249              
250             # httpstat
251            
252 0         0 while ( $lines[0] =~ /^ Requests$/ ) {
253 0         0 $ex{httpstat} .= (shift @lines)."\n";
254 0 0       0 $ex{httpstat} .= (shift @lines) . "\n" if ( $lines[0] =~ /^\s+Accept\s+Reuse\s+Response\s+InBytes\s+OutBytes$/ );
255 0 0       0 $ex{httpstat} .= (shift @lines)."\n" if $lines[0] =~ /^$/;
256 0         0 while ( $lines[0] =~ /^\S+ Stats:$/ ) {
257 0         0 $ex{httpstat} .= (shift @lines)."\n";
258 0         0 while ( $lines[0] =~ /^(\s+\d+)+$/ ) {
259 0         0 $ex{httpstat} .= (shift @lines)."\n";
260 0 0       0 $ex{httpstat} .= (shift @lines)."\n" if $lines[0] =~ /^$/;
261             }
262             }
263             }
264              
265             # df
266              
267 0         0 while ( $lines[0] =~ /^Filesystem\s+kbytes/ ) {
268 0         0 $ex{df} .= (shift @lines)."\n";
269 0         0 while ( $lines[0] =~ /^(\/vol|snap reserve)/ ) {
270 0         0 $ex{df} .= (shift @lines)."\n";
271             }
272             }
273              
274             # df_i
275              
276 0         0 while ( $lines[0] =~ /^Filesystem\s+iused/ ) {
277 0         0 $ex{df_i} .= (shift @lines)."\n";
278 0         0 while ( $lines[0] =~ /^\/vol/ ) {
279 0         0 $ex{df_i} .= (shift @lines)."\n";
280             }
281             }
282            
283             # snap-sched
284              
285 0         0 while ( $lines[0] =~ /^Volume \S+: \d+/ ) {
286 0         0 $ex{snapsched} .= (shift @lines)."\n";
287             }
288              
289             # vol-status
290              
291 0         0 while ( $lines[0] =~ /^\s+Volume\s+State\s+Status\s+Options/ ) {
292 0         0 $ex{vol_status} .= (shift @lines)."\n";
293 0         0 while ( $lines[0] =~ /^(\s+)?\S+\s+(online|offline|restricted)\s+\S+/ ) {
294 0         0 $ex{vol_status} .= (shift @lines)."\n";
295 0         0 while ( $lines[0] =~ /^\s{14}\s+\S+/ ) {
296 0         0 $ex{vol_status} .= (shift @lines)."\n";
297             }
298             }
299             }
300              
301             # sysconfig_r
302              
303 0         0 while ( $lines[0] =~ /^(Volume|Aggregate) \S+ \(.+?\) \(.+?\)$/ ) {
304 0         0 $ex{sysconfig_r} .= (shift @lines)."\n";
305 0         0 while ( $lines[0] =~ /^ Plex \S+ \(.+?\)$/ ) {
306 0         0 $ex{sysconfig_r} .= (shift @lines)."\n";
307 0         0 while ( $lines[0] =~ /^ RAID group \S+ \(.+?\)$/ ) {
308 0         0 $ex{sysconfig_r} .= (shift @lines)."\n";
309 0 0       0 $ex{sysconfig_r} .= (shift @lines)."\n" if $lines[0] =~ /^$/;
310 0 0       0 $ex{sysconfig_r} .= (shift @lines)."\n" if $lines[0] =~ /^ RAID Disk/;
311 0 0       0 $ex{sysconfig_r} .= (shift @lines)."\n" if $lines[0] =~ /^ ---------/;
312 0         0 while ( $lines[0] =~ /^(\s+\S+){3}(\s+\d+){2}(\s+\S+\s+(\d+|\-)){2}(\s+\d+\/\d+){2}(\s+)?$/ ) {
313 0         0 $ex{sysconfig_r} .= (shift @lines)."\n";
314             }
315 0         0 while ( $lines[0] =~ /^$/ ) {
316 0         0 $ex{sysconfig_r} .= (shift @lines)."\n";
317             }
318 0         0 while ( $lines[0] =~ /(spare|broken|partner) disks/i ) {
319 0         0 $ex{sysconfig_r} .= (shift @lines)."\n";
320 0 0       0 $ex{sysconfig_r} .= (shift @lines)."\n" if $lines[0] =~ /^$/;
321 0 0       0 $ex{sysconfig_r} .= (shift @lines)."\n" if $lines[0] =~ /^RAID Disk/;
322 0 0       0 $ex{sysconfig_r} .= (shift @lines)."\n" if $lines[0] =~ /^---------/;
323 0         0 while ( $lines[0] =~ /^(spare|failed|partner)/i ) {
324 0         0 $ex{sysconfig_r} .= (shift @lines)."\n";
325             }
326 0 0       0 $ex{sysconfig_r} .= (shift @lines)."\n" if $lines[0] =~ /^$/;
327             }
328             }
329             }
330             }
331              
332             # fc stats
333              
334 0         0 while ( $lines[0] =~ /^\S+ driver statistics for slot/ ) {
335 0         0 $ex{fc_stats} .= (shift @lines)."\n";
336 0         0 while ( $lines[0] =~ /^ \S+\s+\d+$/ ) {
337 0         0 $ex{fc_stats} .= (shift @lines)."\n";
338             }
339 0 0       0 $ex{fc_stats} .= (shift @lines)."\n" if $lines[0] =~ /^ device status:\s+/;
340 0         0 while ( $lines[0] =~ /^ \S+\s+.*total:\s+\d+$/ ) {
341 0         0 $ex{fc_stats} .= (shift @lines)."\n";
342             }
343             }
344 0         0 while ( $lines[0] =~ /^Cannot complete operation on channel \S+; link is DOWN/ ) {
345 0         0 $ex{fc_stats} .= (shift @lines)."\n";
346 0         0 while ( $lines[0] =~ /^$/ ) { $ex{fc_stats} .= (shift @lines)."\n" }
  0         0  
347             }
348            
349             # FC device map
350              
351 0         0 while ( $lines[0] =~ /^Loop Map for channel/ ) {
352 0         0 $ex{fc_dev_map} .= (shift @lines)."\n";
353 0         0 while ( $lines[0] =~ /^(Translated Map|Shelf mapping|(Target SES devices|Initiators) on this loop):/ ) {
354 0         0 $ex{fc_dev_map} .= (shift @lines)."\n";
355 0         0 while ( $lines[0] =~ /^$/ ) { $ex{fc_dev_map} .= (shift @lines)."\n" }
  0         0  
356 0         0 while ( $lines[0] =~ /^\s+(Shelf (\d+|Unknown):\s+)?((\d+|XXX)\s+)+/ ) {
357 0         0 $ex{fc_dev_map} .= (shift @lines)."\n";
358             }
359 0         0 while ( $lines[0] =~ /^$/ ) { $ex{fc_dev_map} .= (shift @lines)."\n" }
  0         0  
360             }
361 0         0 while ( $lines[0] =~ /^$/ ) { $ex{fc_dev_map} .= (shift @lines)."\n" }
  0         0  
362 0         0 while ( $lines[0] =~ /^Cannot complete operation on channel \S+; link is DOWN/ ) {
363 0         0 $ex{fc_dev_map} .= (shift @lines)."\n";
364 0         0 while ( $lines[0] =~ /^$/ ) { $ex{fc_dev_map} .= (shift @lines)."\n" }
  0         0  
365             }
366             }
367              
368             # FC link stats
369            
370 0         0 while ( $lines[0] =~ /Loop\s+Link\s+Transport\s+Loss of\s+Invalid\s+Frame In\s+Frame Out/ ) {
371 0         0 $ex{fc_link_stats} .= (shift @lines)."\n".(shift @lines)."\n".(shift @lines)."\n";
372 0         0 while ( $lines[0] =~ /^\w+\.\w+(\s+\d+){6}$/ ) {
373 0         0 $ex{fc_link_stats} .= (shift @lines)."\n";
374             }
375 0         0 while ( $lines[0] =~ /^$/ ) { $ex{fc_link_stats} .= (shift @lines)."\n" }
  0         0  
376 0         0 while ( $lines[0] =~ /^Cannot complete operation on channel \S+; link is DOWN/ ) {
377 0         0 $ex{fc_link_stats} .= (shift @lines)."\n";
378 0         0 while ( $lines[0] =~ /^$/ ) { $ex{fc_link_stats} .= (shift @lines)."\n" }
  0         0  
379             }
380             }
381            
382             # Registry
383            
384 0         0 while ( $lines[0] =~ /^Loaded=/ ) {
385 0         0 for ( 1 .. 15 ) { $ex{registry} .= (shift @lines)."\n"; }
  0         0  
386             }
387            
388             # Usage
389            
390 0         0 while ( $lines[0] =~ /^[\w\-]+(\.[\w\-]+)+=\d+$/ ) {
391 0         0 $ex{usage} .= (shift @lines)."\n";
392             }
393              
394             # ACP list all
395            
396 0 0       0 $ex{acp_list_all} .= (shift @lines)."\n" if $lines[0] =~ /^\[acpadmin list.all\]/;
397 0 0 0     0 $ex{acp_list_all} .= (shift @lines)."\n" if length($ex{acp_list_all}) and $lines[0] =~ /^$/;
398            
399             # DNS info? - should be IP?
400              
401 0 0       0 $ex{dns_info} .= (shift @lines)."\n" if $lines[0] =~ /^IP\s+MAC/;
402 0 0       0 $ex{dns_info} .= (shift @lines)."\n" if $lines[0] =~ /^Address\s+Address/;
403 0 0       0 $ex{dns_info} .= (shift @lines)."\n" if $lines[0] =~ /^\-+$/;
404 0         0 while ( $lines[0] =~ /^\d{1,3}(\.\d{1,3}){3}/ ) {
405 0         0 $ex{dns_info} .= (shift @lines)."\n";
406             }
407            
408             # media_scrub
409              
410 0         0 while ( $lines[0] =~ /^\S+ media_scrub: status/ ) {
411 0         0 $ex{media_scrub} .= (shift @lines)."\n";
412 0         0 while ( $lines[0] =~ /^\t\S/ ) {
413 0         0 $ex{media_scrub} .= (shift @lines)."\n";
414             }
415 0 0       0 $ex{media_scrub} .= (shift @lines)."\n" if $lines[0] =~ /^$/;
416             }
417            
418             # scrub
419            
420 0         0 while ( $lines[0] =~ /^\S+ scrub/ ) {
421 0         0 $ex{scrub} .= (shift @lines)."\n";
422             }
423              
424             # UNKNOWN
425            
426 0         0 while ( $lines[0] =~ /^(Aggregate|Volume) \S+ \(.+?\) \(.+?\)$/ ) {
427 0         0 $ex{UNKNOWN} .= (shift @lines)."\n";
428 0         0 while ( $lines[0] =~ /^ Plex \S+ \(.+?\)$/ ) {
429 0         0 $ex{UNKNOWN} .= (shift @lines)."\n";
430 0         0 while ( $lines[0] =~ /^ RAID group \S+ \(.+?\)$/ ) {
431 0         0 $ex{UNKNOWN} .= (shift @lines)."\n";
432 0 0       0 $ex{UNKNOWN} .= (shift @lines)."\n" if $lines[0] =~ /^$/;
433 0 0       0 $ex{UNKNOWN} .= (shift @lines)."\n" if $lines[0] =~ /^ RAID Disk/;
434 0 0       0 $ex{UNKNOWN} .= (shift @lines)."\n" if $lines[0] =~ /^ ---------/;
435 0         0 while ( $lines[0] =~ /^ (dparity|data|parity)/ ) {
436 0         0 $ex{UNKNOWN} .= (shift @lines)."\n";
437             }
438 0         0 while ( $lines[0] =~ /^$/ ) {
439 0         0 $ex{UNKNOWN} .= (shift @lines)."\n";
440             }
441             }
442             }
443             }
444              
445             # aggr_status
446            
447 0         0 while ( $lines[0] =~ /^\s+Aggr\s+State\s+Status\s+Options/ ) {
448 0         0 $ex{aggr_status} .= (shift @lines)."\n";
449 0         0 while ( $lines[0] =~ /^(\s+)?\S+\s+(online|offline|restricted)\s+\S+/ ) {
450 0         0 $ex{aggr_status} .= (shift @lines)."\n";
451 0         0 while ( $lines[0] =~ /^\s{14}\s+\S+/ ) {
452 0         0 $ex{aggr_status} .= (shift @lines)."\n";
453             }
454             }
455 0 0       0 $ex{aggr_status} .= (shift @lines)."\n" if $lines[0] =~ /^$/;
456 0         0 while ( $lines[0] =~ /^\s+Volumes: \S/ ) {
457 0         0 $ex{aggr_status} .= (shift @lines)."\n";
458 0         0 while ( $lines[0] =~ /^\s{8}\s+\S/ ) {
459 0         0 $ex{aggr_status} .= (shift @lines)."\n";
460             }
461 0 0       0 $ex{aggr_status} .= (shift @lines)."\n" if $lines[0] =~ /^$/;
462 0         0 while ( $lines[0] =~ /^\s+Plex \S+: \S/ ) {
463 0         0 $ex{aggr_status} .= (shift @lines)."\n";
464 0         0 while ( $lines[0] =~ /^\s+RAID group \S+: \S/ ) {
465 0         0 $ex{aggr_status} .= (shift @lines)."\n";
466             }
467             }
468 0 0       0 $ex{aggr_status} .= (shift @lines)."\n" if $lines[0] =~ /^$/;
469 0         0 while ( $lines[0] =~ /^\s*\S+\s+(online|offline|restricted)(\s+\S+){2}/ ) {
470 0         0 $ex{aggr_status} .= (shift @lines)."\n";
471 0         0 while ( $lines[0] =~ /^\s{19}\s+\S+/ ) {
472 0         0 $ex{aggr_status} .= (shift @lines)."\n";
473             }
474             }
475 0 0       0 $ex{aggr_status} .= (shift @lines)."\n" if $lines[0] =~ /^$/;
476             }
477             }
478              
479             # xml
480              
481 0   0     0 while ( scalar(@lines) and $lines[0] =~ /<\?xml version="1.0"\?>/ ) {
482 0         0 my $xml = (shift @lines)."\n";
483 0   0     0 while ( scalar(@lines) and $lines[0] !~ /<\?xml version="1.0"\?>/ ) {
484 0         0 $xml .= (shift @lines)."\n";
485             }
486 0         0 push @{$ex{xml}}, $xml;
  0         0  
487             }
488              
489 0         0 $ex{_REMAINDER} = \@lines;
490            
491 0         0 return \%ex;
492             }
493              
494             =head3 parse($raw)
495              
496             Returns an array of hash references representing key information:
497              
498             ( \%header, \%luns, \%qtree, \%vols )
499              
500             =cut
501              
502             sub parse {
503 0     0 1 0 my $asup = shift @_;
504 0         0 my $extracts = ASUP::extract($asup);
505            
506 0         0 my $df = $extracts->{df};
507 0         0 my $export = $extracts->{export};
508 0         0 my $header = $extracts->{header};
509 0         0 my $lun_conf = $extracts->{lun_conf};
510 0         0 my $qtree_stat = $extracts->{qtree_stat};
511 0         0 my $sysconfig_a = $extracts->{sysconfig_a};
512 0         0 my $vol_status = $extracts->{vol_status};
513 0         0 my $xheader = $extracts->{xheader};
514              
515 0 0       0 Interface::warning("NO DF DATA IN ASUP") unless $df;
516 0 0       0 Interface::warning("NO EXPORT DATA IN ASUP") unless $export;
517 0 0       0 Interface::warning("NO HEADER DATA IN ASUP") unless $header;
518             # It's ok not to have LUN conf data
519 0 0       0 Interface::warning("NO QTREE STATUS IN ASUP") unless $qtree_stat;
520 0 0       0 Interface::warning("NO SYSYCONFIG-A DATA IN ASUP") unless $sysconfig_a;
521 0 0       0 Interface::warning("NO VOL-STATUS DATA IN ASUP") unless $vol_status;
522 0 0       0 Interface::warning("NO X-HEADER DATA IN ASUP") unless $xheader;
523              
524             # Parse header data;
525              
526 0         0 my %header = Parse::NetApp::ASUP::parse_header($header);
527 0         0 Interface::message("Filer version is $header{short_version}");
528 0         0 my %xheader = Parse::NetApp::ASUP::parse_xheader($xheader);
529 0 0       0 for my $key ( keys %xheader ) { $header{$key} = $xheader{$key} unless defined $header{$key}; }
  0         0  
530              
531             # Parse sysconfig data
532              
533 0         0 my %sysconfig = Parse::NetApp::ASUP::parse_sysconfig($sysconfig_a);
534              
535             # Add to header info, unless already there
536 0         0 for my $key ( keys %sysconfig ) {
537 0 0 0     0 if ( defined $header{$key} and $key ne 'SERIAL_NUM' ) {
    0 0        
538 0         0 Interface::warning("Skipping duplicate sysconfig data of type $key alread found in \%header");
539 0         0 push(@Parse::NetApp::ASUP::concerns,"Duplicate header data of type $key");
540             } elsif ( defined $header{$key} and $header{$key} ne $sysconfig{$key} ) {
541 0         0 Interface::warning("Duplicate header key of $key has varying data: [$header{$key}] vs [$sysconfig{$key}]");
542 0         0 push(@Parse::NetApp::ASUP::concerns,"Duplicate and varied header data of type $key");
543             } else {
544 0         0 $header{$key} = $sysconfig{$key};
545             }
546             }
547              
548             # Parse LUN CONFiguration
549              
550 0         0 my %luns = Parse::NetApp::ASUP::parse_lun($lun_conf);
551 0 0 0     0 Interface::message("No lun data found.") unless scalar( keys %luns ) or not defined $lun_conf;
552              
553             # Parse DF
554              
555 0         0 my %vols = Parse::NetApp::ASUP::parse_df($df);
556 0 0       0 Interface::warning("NO VOLUME DATA!") unless scalar( keys %vols );
557              
558             # Parse qtree status data
559              
560 0         0 my %qtree = Parse::NetApp::ASUP::parse_qtree($qtree_stat);
561              
562             # Form a deduped list of styles of qtree on each volume for the Volume tab
563 0         0 my %dedupe;
564 0         0 for my $key ( keys %qtree ) {
565 0         0 my $vol = $qtree{$key}{volume};
566 0         0 my $style = $qtree{$key}{style};
567 0         0 $dedupe{$vol}{$style}++;
568             }
569              
570 0         0 for my $vol ( keys %dedupe ) {
571 0         0 my @qtree_styles = sort keys %{ $dedupe{$vol} };
  0         0  
572 0         0 $vols{$vol}{qtree} = join( ', ', @qtree_styles );
573             }
574              
575             # parse Volstatus data
576              
577 0         0 my %volstatus = Parse::NetApp::ASUP::parse_volstatus($vol_status);
578              
579             # Add to vol info, unless already there
580 0         0 for my $volume ( keys %volstatus ) {
581 0         0 for my $key ( keys %{ $volstatus{$volume} } ) {
  0         0  
582              
583 0 0       0 if ( defined $vols{$volume}{$key} ) {
584 0         0 Interface::warning("Skipping duplicate volstatus data of type $key alread found in \%vols");
585             } else {
586 0         0 $vols{$volume}{$key} = $volstatus{$volume}{$key};
587             }
588             }
589             }
590              
591             # Parse Export dara
592              
593 0         0 my %export = Parse::NetApp::ASUP::parse_export($export);
594              
595 0         0 for my $exported ( keys %export ) {
596 0         0 for my $volume ( keys %vols ) {
597 0 0       0 my $test = defined $vols{$volume}{mounted_on} ? $vols{$volume}{mounted_on} : '';
598 0 0       0 chop $test if $test =~ /\/$/; # The export can have a closing slash
599 0 0       0 if ( $exported =~ /^$test$/ ) {
600 0         0 $vols{$volume}{export} = $export{$exported};
601             }
602             }
603             }
604              
605 0         0 return ( \%header, \%luns, \%qtree, \%vols );
606             }
607              
608             =head1 PARSE METHODS:
609              
610             Parse methods first extract the raw section and then parse them into a perl
611             data structure for quick usage.
612              
613             =head3 parse_df()
614              
615             =cut
616              
617             sub parse_df {
618 0     0 1 0 my %vols = ();
619 0 0       0 return ( wantarray ? %vols : \%vols ) unless defined $_[0];
    0          
620              
621 0         0 my @df = split "\n", $_[0];
622 0 0       0 shift @df if $df[0] =~ /^===== DF =====$/;
623 0 0       0 shift @df if $df[0] =~ /^Filesystem.*kbytes.*used.*avail.*capacity.*Mounted on/; # Drop the header row
624              
625 0         0 while ( scalar(@df) ) {
626 0         0 my $line = shift @df;
627 0 0 0     0 $line .= shift @df if defined $df[0] and $df[0] =~ /^[\w\d\/\.]+$/; # Wraparound on mount point
628              
629 0 0       0 Carp::croak "BAD DF LINE: '$line'\n"
630             unless $line =~ /^([\w\d\/\.]+).+?(\d+).+?(\d+).+?(\d+).+?([-\d]+\%).+?([\w\d\/\.]+)$/;
631              
632 0         0 my ( $volume, $kbytes, $used, $avail, $capacity, $mounted_on ) = ( $1, $2, $3, $4, $5, $6 );
633 0 0       0 next if $volume =~ /.snapshot$/;
634              
635 0         0 my $volname_clean = $volume;
636 0         0 $volname_clean =~ s/^\/vol\///i;
637 0         0 $volname_clean =~ s/\/$//;
638              
639 0 0       0 next if $volume =~ /^snap$/;
640              
641 0         0 $vols{$volname_clean}{kbytes} = $kbytes;
642 0         0 $vols{$volname_clean}{used} = $used;
643 0         0 $vols{$volname_clean}{avail} = $avail;
644 0         0 $vols{$volname_clean}{capacity} = $capacity;
645 0         0 $vols{$volname_clean}{mounted_on} = $mounted_on;
646             }
647              
648 0 0       0 return wantarray ? %vols : \%vols;
649             }
650              
651             =head3 parse_export()
652              
653             =cut
654              
655             sub parse_export {
656 0     0 1 0 my %export = ();
657 0 0       0 return ( wantarray ? %export : \%export ) unless defined $_[0];
    0          
658 0         0 my @lines = split "\n", $_[0];
659 0         0 for my $line (@lines) {
660 0 0       0 next if $line =~ /^#/;
661 0 0       0 next if $line =~ /^\s*$/;
662 0 0       0 if ( $line =~ /^(\S+)\s+(\S+)$/ ) {
663 0         0 $export{$1} = $2;
664             }
665             }
666 0 0       0 return wantarray ? %export : \%export;
667             }
668              
669             =head3 parse_header()
670              
671             =cut
672              
673             sub parse_header {
674 0     0 1 0 my %header = ();
675 0 0       0 return ( wantarray ? %header : \%header ) unless defined $_[0];
    0          
676              
677 0         0 my @lines = split "\n", $_[0];
678 0         0 for my $line (@lines) {
679 0 0       0 next if $line =~ /^\s*$/;
680 0 0       0 if ( $line =~ /Console is using (.+)$/ ) {
    0          
    0          
681 0         0 $header{'console_charset'} = $1;
682             } elsif ( $line =~ /^(\w+)=(.*)$/ ) {
683 0         0 $header{$1} = $2;
684             } elsif ( $line =~ /Console encoding is nfs but/ ) {
685 0         0 chomp $line;
686 0         0 $header{warnings} = $line;
687             } else {
688 0         0 Carp::croak "Bad header line: [$line]";
689             }
690             }
691              
692 0 0       0 $header{short_version} = $1 if $header{VERSION} =~ /NetApp Release ([\w\.\d]+)/;
693 0 0       0 $header{short_version} = $header{VERSION} unless defined $header{short_version};
694              
695 0 0       0 return wantarray ? %header : \%header;
696             }
697              
698             =head3 parse_lun()
699              
700             =cut
701              
702             sub parse_lun {
703 0     0 1 0 my %luns = ();
704 0 0       0 return ( wantarray ? %luns : \%luns ) unless length $_[0]; # Return empty if no data given
    0          
705              
706 0         0 my @lun_conf = split "\n", $_[0];
707              
708 0         0 shift @lun_conf while $lun_conf[0] =~ /^\s*$/;
709 0 0 0     0 shift @lun_conf if defined $lun_conf[0] and $lun_conf[0] eq '===== LUN CONFIGURATION ====='; # remove the first line
710              
711 0         0 my $regex_lun_name = Parse::NetApp::ASUP::_regex_lun_name();
712              
713 0         0 while ( scalar(@lun_conf) ) {
714 0         0 my $line = shift @lun_conf;
715 0 0       0 next if $line =~ /^\s*$/;
716            
717 0 0       0 Carp::croak "Bad LUN Conf Line: [$line]" unless $line =~ /^(\s{7,8}|\t)(\/.+)$/;
718              
719 0         0 my $rawluninfo = $2;
720              
721 0 0       0 $rawluninfo .= ' ' . shift @lun_conf if $lun_conf[0] =~ /^\w/; # handle possible line wrap
722 0 0       0 $rawluninfo =~ /^($regex_lun_name) +(.*?) +\((\d+)\).*\((.+)\)$/
723             or Carp::croak "CAN'T PARSE LUN SUMMARY LINE: [$rawluninfo]";
724              
725 0         0 my $lun = $1;
726              
727 0         0 $luns{$lun}{_size} = $2;
728 0         0 $luns{$lun}{_raw_size} = $3;
729 0         0 $luns{$lun}{_status} = $4;
730              
731 0         0 $luns{$lun}{_size} =~ s/g$//;
732 0 0       0 $luns{$lun}{_size} = ( $1 * 1024 ) if $luns{$lun}{_size} =~ /(.*)t$/;
733              
734 0   0     0 while ( defined $lun_conf[0] and $lun_conf[0] =~ /^(\s{15,16}|\t{2})(\w.+): (.+)$/ ) {
735 0         0 my $name = $2; my $data = $3;
  0         0  
736 0         0 shift @lun_conf;
737              
738 0 0 0     0 $data .= ' ' . shift @lun_conf
739             if defined $lun_conf[0] and $lun_conf[0] =~ /^\w/; # handle possible line wrap
740              
741 0         0 $luns{$lun}{$name} = $data;
742             }
743             }
744 0 0       0 return wantarray ? %luns : \%luns;
745             }
746              
747             =head3 parse_qtree()
748              
749             =cut
750              
751             sub parse_qtree {
752 0     0 1 0 my %qtree = ();
753 0 0       0 return ( wantarray ? %qtree : \%qtree ) unless defined $_[0];
    0          
754              
755 0         0 my @lines = split "\n", $_[0];
756 0 0       0 shift @lines if $lines[0] eq '===== QTREE-STATUS =====';
757              
758 0         0 my $reg_path = Parse::NetApp::ASUP::_regex_path();
759 0         0 my $reg_qtree_name = Parse::NetApp::ASUP::_regex_qtree_name();
760 0         0 my $reg_vol_name = Parse::NetApp::ASUP::_regex_vol_name();
761              
762 0         0 for my $line (@lines) {
763 0 0       0 next if $line =~ /^[\s-]*$/; # Blank and line rows.
764 0 0       0 next if $line =~ /Volume.*Tree.*Style.*Oplocks.*Status.*ID/; # header row
765              
766 0         0 my ( $vol, $tree, $style, $oplocks, $status, $id, $vfiler );
767 0 0       0 if ( $line =~ /^($reg_vol_name)\s+($reg_qtree_name)\s+(\w+)\s+(\w+)\s+(\w+)\s+(\d+)\s+(\w+)$/ ) { # v8 with vfiler
    0          
    0          
    0          
768 0         0 ( $vol, $tree, $style, $oplocks, $status, $id, $vfiler ) = ( $1, $2, $3, $4, $5, $6, $7 );
769             } elsif ( $line =~ /^($reg_vol_name)\s+($reg_qtree_name)\s+(\w+)\s+(\w+)\s+(\d+)\s+(\w+)$/ ) { # v8
770 0         0 ( $vol, $style, $oplocks, $status, $id, $vfiler ) = ( $1, $2, $3, $4, $5, $6 );
771             } elsif ( $line =~ /^($reg_vol_name)\s+($reg_qtree_name)\s+(\w+)\s+(\w+)\s+(\w+)\s+(\d+)\s*$/ ) { # v7 and earlier
772 0         0 ( $vol, $tree, $style, $oplocks, $status, $id ) = ( $1, $2, $3, $4, $5, $6 );
773             } elsif ( $line =~ /^($reg_path)\s+(\w+)\s+(\w+)\s+(\w+)\s+(\d+)\s*$/ ) { # v7 and earlier
774 0         0 ( $vol, $style, $oplocks, $status, $id ) = ( $1, $2, $3, $4, $5 );
775             } else {
776 0         0 Carp::croak "Bad Qtree Status Line: [$line]\n";
777             }
778 0         0 my $key = $vol . $id;
779              
780 0         0 $qtree{$key}{volume} = $vol;
781 0         0 $qtree{$key}{tree} = $tree;
782 0         0 $qtree{$key}{style} = $style;
783 0         0 $qtree{$key}{oplocks} = $oplocks;
784 0         0 $qtree{$key}{status} = $status;
785 0         0 $qtree{$key}{id} = $id;
786              
787             }
788 0 0       0 return wantarray ? %qtree : \%qtree;
789             }
790              
791             =head3 parse_sysconfig()
792              
793             =cut
794              
795             sub parse_sysconfig {
796 0     0 1 0 my %sysconfig = ();
797 0 0       0 return ( wantarray ? %sysconfig : \%sysconfig ) unless defined $_[0];
    0          
798              
799 0         0 my @lines = split "\n", $_[0];
800 0         0 for my $line (@lines) {
801 0 0       0 $sysconfig{SERIAL_NUM} = $1 if $line =~ /System Serial Number: (\d+) \(/;
802             }
803              
804 0 0       0 return wantarray ? %sysconfig : \%sysconfig;
805             }
806              
807             =head3 parse_volstatus()
808              
809             =cut
810              
811             sub parse_volstatus {
812 0     0 1 0 my %vols = ();
813 0 0       0 return ( wantarray ? %vols : \%vols ) unless defined $_[0];
    0          
814              
815 0         0 my @lines = split "\n", $_[0];
816 0 0       0 shift @lines if $lines[0] eq '===== VOL-STATUS =====';
817              
818 0         0 my @chunk; my @next_chunk; my $header_count;
  0         0  
819              
820 0         0 for my $line (@lines) {
821 0 0       0 next if $line =~ /^[\s-]*$/; # Blank and line rows.
822              
823 0 0       0 if ( $line =~ /Volume.*State.*Status.*Options/ ) { # header row
824 0         0 $header_count++;
825 0         0 next;
826             }
827              
828 0 0       0 last if $header_count > 1;
829              
830 0 0 0     0 if ( scalar(@chunk) > 0 and $line =~ /^\s*([\w\-]+)\s+(online|offline)\s+(.+?)\s\s\s+(.+)$/ ) {
831 0         0 push @next_chunk, $line;
832              
833 0         0 my ( $volname, $volopts ) = Parse::NetApp::ASUP::_parse_volstatus_block(@chunk);
834 0         0 $vols{$volname} = $volopts;
835              
836 0         0 @chunk = @next_chunk;
837 0         0 @next_chunk = ();
838             } else {
839 0         0 push @chunk, $line;
840             }
841             }
842              
843 0 0       0 if (@chunk) {
844 0         0 my ( $volname, $volinfo ) = Parse::NetApp::ASUP::_parse_volstatus_block(@chunk);
845 0         0 $vols{$volname} = $volinfo;
846             }
847              
848 0 0       0 return wantarray ? %vols : \%vols;
849             }
850              
851             sub _parse_volstatus_block {
852 0     0   0 my @lines = @_;
853 0         0 my %volinfo;
854              
855 0         0 my ( $volname, $volstate, $voloptions, $volstatus, $volaggr ) = ('','','','','');
856            
857 0         0 for my $line (@lines) {
858              
859             # v7 unused
860 0 0       0 next if $line =~ /Plex \//;
861 0 0       0 next if $line =~ /RAID group/;
862 0 0       0 next if $line =~ /Snapshot autodelete settings/;
863 0 0       0 next if $line =~ /Volume autosize settings/;
864              
865             # v8
866 0 0       0 next if $line =~ /Volume UUID: /;
867 0 0       0 next if $line =~ /Volinfo mode: /;
868 0 0       0 next if $line =~ /Volume has clones: /;
869 0 0       0 next if $line =~ /Clone, backed by volume '/;
870              
871 0 0       0 if ( $line =~ /^\s*([\w\-]+)\s+(online|offline|restricted)\s+(.+?)\s\s\s+(.+)$/ ) {
    0          
    0          
    0          
    0          
    0          
872 0         0 $volname = $1;
873 0         0 $volstate = $2;
874 0         0 $volstatus = $3;
875 0         0 $voloptions = $4;
876             } elsif ( $line =~ /^(\s{27,30}\s*|\t{5})(\S+)\s\s\s+(\S.+)$/ ) { # v7 and earlier
877 0         0 $volstatus .= ', ' . $2;
878 0         0 $voloptions .= $3;
879             } elsif ( $line =~ /^(\s{27,30}\s*|\t{5})(.*)$/ ) { # v7 and earlier
880 0         0 $voloptions .= $2;
881             } elsif ( $line =~ /^\s*(\w+=[\w\(\)]+,?)$/ ) { # v8
882 0         0 $voloptions .= $1;
883             } elsif ( $line =~ /^vol status: Volume '(.*?)' is temporarily busy \(snapmirror destination\)/ ) {
884 0         0 $volname = $1;
885 0         0 $volstate = 'busy';
886             } elsif ( $line =~ /Containing aggregate: ('[\w\-]+'|)/ ) {
887 0         0 $volaggr = $1;
888 0 0       0 $volaggr = $1 if $volaggr =~ /^'(.+)'$/;
889             } else {
890 0         0 Carp::croak "Bad Vol Status Line: [$line]\n";
891             }
892             }
893              
894 0         0 $volinfo{state} = $volstate;
895 0         0 $volinfo{status} = $volstatus;
896 0         0 $volinfo{options} = $voloptions;
897 0         0 $volinfo{aggregate} = $volaggr;
898 0         0 $volinfo{notes} = '';
899              
900 0 0       0 $volinfo{notes} = 'Volume is offline' if $volstate eq 'offline';
901 0 0       0 $volinfo{notes} = 'Volume is busy' if $volstate eq 'busy';
902 0 0 0     0 push(@Parse::NetApp::ASUP::concerns, "$volname is marked as $volstate") if $volstate eq 'offline' or $volstate eq 'busy';
903              
904 0         0 return ( $volname, \%volinfo );
905             }
906              
907             =head3 parse_xheader()
908              
909             =cut
910              
911             sub parse_xheader {
912 0     0 1 0 my %xheader = ();
913 0 0       0 return ( wantarray ? %xheader : \%xheader ) unless defined $_[0];
    0          
914              
915 0         0 my @lines = split "\n", $_[0];
916 0 0       0 shift @lines if $lines[0] eq '===== X-HEADER DATA =====';
917              
918 0         0 for my $line (@lines) {
919 0 0       0 next if $line =~ /^\s*$/;
920 0 0       0 if ( $line =~ /^([\w\-]+): (.*)$/ ) {
921 0         0 $xheader{$1} = $2;
922             } else {
923 0         0 Carp::croak "Bad x-header line: [$line]";
924             }
925             }
926              
927 0 0       0 return wantarray ? %xheader : \%xheader;
928             }
929              
930             =head1 EXTRACT METHODS:
931              
932             =head3 extract_acp_list_all()
933              
934             =cut
935              
936             sub extract_acp_list_all {
937 8 50   8 1 2176 my $raw = defined $_[0]->{asup} ? $_[0]->{asup} : $_[0];
938 8         78 my $trim = '';
939 8 50       21167 if ( $raw =~ /(===== ACP LIST ALL =====.*?)=====/s ) {
940 0         0 $trim = $1;
941 0         0 while ( $trim !~ /\n\n$/s ) { $trim .= "\n"; }
  0         0  
942             }
943 8         29 undef($raw);
944 8         50 return $trim;
945             }
946              
947             =head3 extract_aggr_status()
948              
949             =cut
950              
951             sub extract_aggr_status {
952 8 50   8 1 1812 my $raw = defined $_[0]->{asup} ? $_[0]->{asup} : $_[0];
953 8         22 my $trim = '';
954 8 100       3365 if ( $raw =~ /(===== AGGR-STATUS =====.*?)=====/s ) {
955 7         45 $trim = $1;
956 7         47 while ( $trim !~ /\n\n$/s ) { $trim .= "\n"; }
  0         0  
957             }
958 8         17 undef($raw);
959 8         30 return $trim;
960             }
961              
962             =head3 extract_cf_monitor()
963              
964             =cut
965              
966             sub extract_cf_monitor {
967 8 50   8 1 1890 my $raw = defined $_[0]->{asup} ? $_[0]->{asup} : $_[0];
968 8         15 my $trim = '';
969 8 50       9396 if ( $raw =~ /(===== CF MONITOR =====.*?)=====/s ) {
970 0         0 $trim = $1;
971 0         0 while ( $trim !~ /\n\n$/s ) { $trim .= "\n"; }
  0         0  
972             }
973 8         23 undef($raw);
974 8         42 return $trim;
975             }
976              
977             =head3 extract_cifs_domaininfo()
978              
979             =cut
980              
981             sub extract_cifs_domaininfo {
982 8 50   8 1 1763 my $raw = defined $_[0]->{asup} ? $_[0]->{asup} : $_[0];
983 8         17 my $trim = '';
984 8 100       7699 if ( $raw =~ /(===== CIFS DOMAININFO =====.*?)=====/s ) {
985 1         4 $trim = $1;
986 1         7 while ( $trim !~ /\n\n$/s ) { $trim .= "\n"; }
  0         0  
987             }
988 8         27 undef($raw);
989 8         36 return $trim;
990             }
991              
992             =head3 extract_cifs_sessions()
993              
994             =cut
995              
996             sub extract_cifs_sessions {
997 8 50   8 1 1830 my $raw = defined $_[0]->{asup} ? $_[0]->{asup} : $_[0];
998 8         22 my $trim = '';
999 8 100       7554 if ( $raw =~ /(===== CIFS SESSIONS =====.*?)=====/s ) {
1000 1         7 $trim = $1;
1001 1         8 while ( $trim !~ /\n\n$/s ) { $trim .= "\n"; }
  0         0  
1002             }
1003 8         21 undef($raw);
1004 8         39 return $trim;
1005             }
1006              
1007             =head3 extract_cifs_shares()
1008              
1009             =cut
1010              
1011             sub extract_cifs_shares {
1012 8 50   8 1 1494 my $raw = defined $_[0]->{asup} ? $_[0]->{asup} : $_[0];
1013 8         15 my $trim = '';
1014 8 100       7421 if ( $raw =~ /(===== CIFS SHARES =====.*?)=====/s ) {
1015 1         3 $trim = $1;
1016 1         7 while ( $trim !~ /\n\n$/s ) { $trim .= "\n"; }
  0         0  
1017             }
1018 8         20 undef($raw);
1019 8         33 return $trim;
1020             }
1021              
1022             =head3 extract_cifs_stat()
1023              
1024             =cut
1025              
1026             sub extract_cifs_stat {
1027 8 50   8 1 2126 my $raw = defined $_[0]->{asup} ? $_[0]->{asup} : $_[0];
1028 8         18 my $trim = '';
1029 8 100       8957 if ( $raw =~ /(===== CIFS STAT =====.*?)=====/s ) {
1030 1         8 $trim = $1;
1031 1         8 while ( $trim !~ /\n\n$/s ) { $trim .= "\n"; }
  0         0  
1032             }
1033 8         26 undef($raw);
1034 8         45 return $trim;
1035             }
1036              
1037             =head3 extract_cluster_monitor()
1038              
1039             =cut
1040              
1041             sub extract_cluster_monitor {
1042 8 50   8 1 1252 my $raw = defined $_[0]->{asup} ? $_[0]->{asup} : $_[0];
1043 8         17 my $trim = '';
1044 8 100       6284 if ( $raw =~ /(===== CLUSTER MONITOR =====.*?)=====/s ) {
1045 4         21 $trim = $1;
1046 4         23 while ( $trim !~ /\n\n$/s ) { $trim .= "\n"; }
  0         0  
1047             }
1048 8         20 undef($raw);
1049 8         35 return $trim;
1050             }
1051              
1052             =head3 extract_df()
1053              
1054             =cut
1055              
1056             sub extract_df {
1057 8 50   8 1 9850 my $raw = defined $_[0]->{asup} ? $_[0]->{asup} : $_[0];
1058 8         18 my $trim = '';
1059 8 100       5601 if ( $raw =~ /(===== DF =====.*?)=====/s ) {
1060 7         49 $trim = $1;
1061 7         42 while ( $trim !~ /\n\n$/s ) { $trim .= "\n"; }
  0         0  
1062             }
1063 8         18 undef($raw);
1064 8         26 return $trim;
1065             }
1066              
1067             =head3 extract_df_a()
1068              
1069             =cut
1070              
1071             sub extract_df_a {
1072 8 50   8 1 2468 my $raw = defined $_[0]->{asup} ? $_[0]->{asup} : $_[0];
1073 8         17 my $trim = '';
1074 8 100       9574 if ( $raw =~ /(===== DF-A =====.*?)=====/s ) {
1075 7         127 $trim = $1;
1076 7         55 while ( $trim !~ /\n\n$/s ) { $trim .= "\n"; }
  0         0  
1077             }
1078 8         54 undef($raw);
1079 8         32 return $trim;
1080             }
1081              
1082             =head3 extract_df_i()
1083              
1084             =cut
1085              
1086             sub extract_df_i {
1087 8 50   8 1 1463 my $raw = defined $_[0]->{asup} ? $_[0]->{asup} : $_[0];
1088 8         15 my $trim = '';
1089 8 100       5493 if ( $raw =~ /(===== DF-I =====.*?)=====/s ) {
1090 7         41 $trim = $1;
1091 7         43 while ( $trim !~ /\n\n$/s ) { $trim .= "\n"; }
  0         0  
1092             }
1093 8         18 undef($raw);
1094 8         31 return $trim;
1095             }
1096              
1097             =head3 extract_df_r()
1098              
1099             =cut
1100              
1101             sub extract_df_r {
1102 8 50   8 1 2384 my $raw = defined $_[0]->{asup} ? $_[0]->{asup} : $_[0];
1103 8         21 my $trim = '';
1104 8 100       11027 if ( $raw =~ /(===== DF-R =====.*?)=====/s ) {
1105 7         52 $trim = $1;
1106 7         50 while ( $trim !~ /\n\n$/s ) { $trim .= "\n"; }
  0         0  
1107             }
1108 8         22 undef($raw);
1109 8         28 return $trim;
1110             }
1111              
1112             =head3 extract_df_s()
1113              
1114             =cut
1115              
1116             sub extract_df_s {
1117 8 50   8 1 1889 my $raw = defined $_[0]->{asup} ? $_[0]->{asup} : $_[0];
1118 8         15 my $trim = '';
1119 8 50       9658 if ( $raw =~ /(===== DF-S =====.*?)=====/s ) {
1120 0         0 $trim = $1;
1121 0         0 while ( $trim !~ /\n\n$/s ) { $trim .= "\n"; }
  0         0  
1122             }
1123 8         26 undef($raw);
1124 8         86 return $trim;
1125             }
1126              
1127             =head3 extract_dns_info()
1128              
1129             =cut
1130              
1131             sub extract_dns_info {
1132 8 50   8 1 1736 my $raw = defined $_[0]->{asup} ? $_[0]->{asup} : $_[0];
1133 8         16 my $trim = '';
1134 8 100       3480 if ( $raw =~ /(===== DNS info =====.*?)=====/s ) {
1135 7         32 $trim = $1;
1136 7         57 while ( $trim !~ /\n\n$/s ) { $trim .= "\n"; }
  0         0  
1137             }
1138 8         17 undef($raw);
1139 8         31 return $trim;
1140             }
1141              
1142             =head3 extract_ecc_memory_scrubber_stats()
1143              
1144             =cut
1145              
1146             sub extract_ecc_memory_scrubber_stats {
1147 8 50   8 1 1374 my $raw = defined $_[0]->{asup} ? $_[0]->{asup} : $_[0];
1148 8         15 my $trim = '';
1149 8 100       4593 if ( $raw =~ /(===== ECC MEMORY SCRUBBER STATS =====.*?)=====/s ) {
1150 7         28 $trim = $1;
1151 7         36 while ( $trim !~ /\n\n$/s ) { $trim .= "\n"; }
  0         0  
1152             }
1153 8         93 undef($raw);
1154 8         25 return $trim;
1155             }
1156              
1157             =head3 extract_environment()
1158              
1159             =cut
1160              
1161             sub extract_environment {
1162 8 50   8 1 1704 my $raw = defined $_[0]->{asup} ? $_[0]->{asup} : $_[0];
1163 8         16 my $trim = '';
1164 8 100       5227 if ( $raw =~ /(===== ENVIRONMENT =====.*?)=====/s ) {
1165 7         94 $trim = $1;
1166 7         45 while ( $trim !~ /\n\n$/s ) { $trim .= "\n"; }
  0         0  
1167             }
1168 8         19 undef($raw);
1169 8         29 return $trim;
1170             }
1171              
1172             =head3 extract_exports()
1173              
1174             =cut
1175              
1176             sub extract_exports {
1177 8 50   8 1 1604 my $raw = defined $_[0]->{asup} ? $_[0]->{asup} : $_[0];
1178            
1179             # v7
1180            
1181 8 100       5992 if ( $raw =~ /(===== EXPORTS =====.*?)=====/s ) {
1182 4         27 my $trim = $1;
1183 4         16 while ( $trim !~ /\n\n$/s ) { $trim .= "\n"; }
  4         26  
1184 4         16 return $trim;
1185             }
1186            
1187             # v8
1188              
1189 4         21 my @lines = Parse::NetApp::ASUP::_agnostic_line_split($raw);
1190 4         6192 my @trim;
1191            
1192 4         30 while ( @lines ) {
1193 108434         147560 my $line = shift @lines;
1194 108434 100       355992 if ( $line =~ /^\/vol\/\S+\s+-sec=/ ) {
1195 4         19 @trim = ( $line );
1196 4         35 while ( $lines[0] =~ /^\/vol\/\S+\s+-sec=/ ) {
1197 74         267 push @trim, shift @lines;
1198             }
1199             }
1200             }
1201            
1202 4 100       2040 return join("\n",@trim) . "\n" if scalar(@trim);
1203              
1204             # give up
1205 1         14 return '';
1206             }
1207              
1208             =head3 extract_failed_disk_registry()
1209              
1210             =cut
1211              
1212             sub extract_failed_disk_registry {
1213 8 50   8 1 1699 my $raw = defined $_[0]->{asup} ? $_[0]->{asup} : $_[0];
1214 8         14 my $trim = '';
1215 8 100       4065 if ( $raw =~ /(===== FAILED_DISK_REGISTRY =====.*?)=====/s ) {
1216 7         21 $trim = $1;
1217 7         38 while ( $trim !~ /\n\n$/s ) { $trim .= "\n"; }
  0         0  
1218             }
1219 8         132 undef($raw);
1220 8         28 return $trim;
1221             }
1222              
1223             =head3 extract_fc_device_map()
1224              
1225             =cut
1226              
1227             sub extract_fc_device_map {
1228 8 50   8 1 1475 my $raw = defined $_[0]->{asup} ? $_[0]->{asup} : $_[0];
1229 8         15 my $trim = '';
1230 8 100       4054 if ( $raw =~ /(===== FC DEVICE MAP =====.*?)=====/s ) {
1231 7         37 $trim = $1;
1232 7         40 while ( $trim !~ /\n\n$/s ) { $trim .= "\n"; }
  0         0  
1233             }
1234 8         15 undef($raw);
1235 8         26 return $trim;
1236             }
1237              
1238             =head3 extract_fc_link_stats()
1239              
1240             =cut
1241              
1242             sub extract_fc_link_stats {
1243 8 50   8 1 1566 my $raw = defined $_[0]->{asup} ? $_[0]->{asup} : $_[0];
1244 8         16 my $trim = '';
1245 8 100       3178 if ( $raw =~ /(===== FC LINK STATS =====.*?)=====/s ) {
1246 7         61 $trim = $1;
1247 7         44 while ( $trim !~ /\n\n$/s ) { $trim .= "\n"; }
  0         0  
1248             }
1249 8         15 undef($raw);
1250 8         28 return $trim;
1251             }
1252              
1253             =head3 extract_fc_stats()
1254              
1255             =cut
1256              
1257             sub extract_fc_stats {
1258 8 50   8 1 1571 my $raw = defined $_[0]->{asup} ? $_[0]->{asup} : $_[0];
1259 8         16 my $trim = '';
1260 8 100       3497 if ( $raw =~ /(===== FC STATS =====.*?)=====/s ) {
1261 7         166 $trim = $1;
1262 7         44 while ( $trim !~ /\n\n$/s ) { $trim .= "\n"; }
  0         0  
1263             }
1264 8         14 undef($raw);
1265 8         29 return $trim;
1266             }
1267              
1268             =head3 extract_fcp_cfmode()
1269              
1270             =cut
1271              
1272             sub extract_fcp_cfmode {
1273 8 50   8 1 1873 my $raw = defined $_[0]->{asup} ? $_[0]->{asup} : $_[0];
1274 8         25 my $trim = '';
1275 8 50       11544 if ( $raw =~ /(===== FCP CFMODE =====.*?)=====/s ) {
1276 0         0 $trim = $1;
1277 0         0 while ( $trim !~ /\n\n$/s ) { $trim .= "\n"; }
  0         0  
1278             }
1279 8         33 undef($raw);
1280 8         68 return $trim;
1281             }
1282              
1283             =head3 extract_fcp_initiator_status()
1284              
1285             =cut
1286              
1287             sub extract_fcp_initiator_status {
1288 8 50   8 1 1612 my $raw = defined $_[0]->{asup} ? $_[0]->{asup} : $_[0];
1289 8         19 my $trim = '';
1290 8 50       7967 if ( $raw =~ /(===== FCP INITIATOR STATUS =====.*?)=====/s ) {
1291 0         0 $trim = $1;
1292 0         0 while ( $trim !~ /\n\n$/s ) { $trim .= "\n"; }
  0         0  
1293             }
1294 8         21 undef($raw);
1295 8         37 return $trim;
1296             }
1297              
1298             =head3 extract_fcp_status()
1299              
1300             =cut
1301              
1302             sub extract_fcp_status {
1303 8 50   8 1 1855 my $raw = defined $_[0]->{asup} ? $_[0]->{asup} : $_[0];
1304 8         19 my $trim = '';
1305 8 50       8345 if ( $raw =~ /(===== FCP STATUS =====.*?)=====/s ) {
1306 0         0 $trim = $1;
1307 0         0 while ( $trim !~ /\n\n$/s ) { $trim .= "\n"; }
  0         0  
1308             }
1309 8         25 undef($raw);
1310 8         53 return $trim;
1311             }
1312              
1313             =head3 extract_fcp_target_adapters()
1314              
1315             =cut
1316              
1317             sub extract_fcp_target_adapters {
1318 8 50   8 1 1802 my $raw = defined $_[0]->{asup} ? $_[0]->{asup} : $_[0];
1319 8         16 my $trim = '';
1320 8 50       9292 if ( $raw =~ /(===== FCP TARGET ADAPTERS =====.*?)=====/s ) {
1321 0         0 $trim = $1;
1322 0         0 while ( $trim !~ /\n\n$/s ) { $trim .= "\n"; }
  0         0  
1323             }
1324 8         24 undef($raw);
1325 8         55 return $trim;
1326             }
1327              
1328             =head3 extract_fcp_target_configuration()
1329              
1330             =cut
1331              
1332             sub extract_fcp_target_configuration {
1333 8 50   8 1 3040 my $raw = defined $_[0]->{asup} ? $_[0]->{asup} : $_[0];
1334 8         16 my $trim = '';
1335 8 50       20625 if ( $raw =~ /(===== FCP TARGET CONFIGURATION =====.*?)=====/s ) {
1336 0         0 $trim = $1;
1337 0         0 while ( $trim !~ /\n\n$/s ) { $trim .= "\n"; }
  0         0  
1338             }
1339 8         25 undef($raw);
1340 8         54 return $trim;
1341             }
1342              
1343             =head3 extract_fcp_target_stats()
1344              
1345             =cut
1346              
1347             sub extract_fcp_target_stats {
1348 8 50   8 1 1693 my $raw = defined $_[0]->{asup} ? $_[0]->{asup} : $_[0];
1349 8         20 my $trim = '';
1350 8 50       8103 if ( $raw =~ /(===== FCP TARGET STATS =====.*?)=====/s ) {
1351 0         0 $trim = $1;
1352 0         0 while ( $trim !~ /\n\n$/s ) { $trim .= "\n"; }
  0         0  
1353             }
1354 8         18 undef($raw);
1355 8         48 return $trim;
1356             }
1357              
1358             =head3 extract_flash_card_info()
1359              
1360             =cut
1361              
1362             sub extract_flash_card_info {
1363 8 50   8 1 1579 my $raw = defined $_[0]->{asup} ? $_[0]->{asup} : $_[0];
1364 8         17 my $trim = '';
1365 8 100       5538 if ( $raw =~ /(===== FLASH CARD INFO =====.*?)=====/s ) {
1366 7         190 $trim = $1;
1367 7         52 while ( $trim !~ /\n\n$/s ) { $trim .= "\n"; }
  0         0  
1368             }
1369 8         17 undef($raw);
1370 8         35 return $trim;
1371             }
1372              
1373             =head3 extract_fmm_data()
1374              
1375             =cut
1376              
1377             sub extract_fmm_data {
1378             # Space at end to handle lots of equal signs in the content.
1379 8 50   8 1 1738 my $raw = defined $_[0]->{asup} ? $_[0]->{asup} : $_[0];
1380 8         18 my $trim = '';
1381 8 50       9206 if ( $raw =~ /(===== FMM-DATA =====.*?)===== /s ) {
1382 0         0 $trim = $1;
1383 0         0 while ( $trim !~ /\n\n$/s ) { $trim .= "\n"; }
  0         0  
1384             }
1385 8         20 undef($raw);
1386 8         37 return $trim;
1387             }
1388              
1389             =head3 extract_fpolicy()
1390              
1391             =cut
1392              
1393             sub extract_fpolicy {
1394 8 50   8 1 1655 my $raw = defined $_[0]->{asup} ? $_[0]->{asup} : $_[0];
1395 8         17 my $trim = '';
1396 8 100       4418 if ( $raw =~ /(===== FPOLICY =====.*?)=====/s ) {
1397 7         58 $trim = $1;
1398 7         37 while ( $trim !~ /\n\n$/s ) { $trim .= "\n"; }
  0         0  
1399             }
1400 8         16 undef($raw);
1401 8         25 return $trim;
1402             }
1403              
1404             =head3 extract_headers()
1405              
1406             =cut
1407              
1408             sub extract_headers {
1409 8 50   8 1 1604 my $raw = defined $_[0]->{asup} ? $_[0]->{asup} : $_[0];
1410 8         15 my $trim = '';
1411 8 100       4799 if ( $raw =~ /(GENERATED_ON=.*?\n)=====/s ) {
1412 7         26 $trim = $1;
1413 7         38 while ( $trim !~ /\n\n$/s ) { $trim .= "\n"; }
  0         0  
1414             }
1415 8         14 undef($raw);
1416 8         28 return $trim;
1417             }
1418              
1419             =head3 extract_hosts()
1420              
1421             =cut
1422              
1423             sub extract_hosts {
1424 8 50   8 1 1678 my $raw = defined $_[0]->{asup} ? $_[0]->{asup} : $_[0];
1425 8         19 my $trim = '';
1426 8 100       6363 if ( $raw =~ /(===== HOSTS =====.*?)=====/s ) {
1427 4         16 $trim = $1;
1428 4         17 while ( $trim !~ /\n\n$/s ) { $trim .= "\n"; }
  4         21  
1429             }
1430 8         23 undef($raw);
1431 8         34 return $trim;
1432             }
1433              
1434             =head3 extract_httpstat()
1435              
1436             =cut
1437              
1438             sub extract_httpstat {
1439 8 50   8 1 1572 my $raw = defined $_[0]->{asup} ? $_[0]->{asup} : $_[0];
1440 8         14 my $trim = '';
1441 8 100       4220 if ( $raw =~ /(===== HTTPSTAT =====.*?)=====/s ) {
1442 7         23 $trim = $1;
1443 7         46 while ( $trim !~ /\n\n$/s ) { $trim .= "\n"; }
  0         0  
1444             }
1445 8         17 undef($raw);
1446 8         27 return $trim;
1447             }
1448              
1449             =head3 extract_hwassist_stats()
1450              
1451             =cut
1452              
1453             sub extract_hwassist_stats {
1454 8 50   8 1 3694 my $raw = defined $_[0]->{asup} ? $_[0]->{asup} : $_[0];
1455 8         16 my $trim = '';
1456 8 50       9252 if ( $raw =~ /(===== HWASSIST_STATS =====.*?)=====/s ) {
1457 0         0 $trim = $1;
1458 0         0 while ( $trim !~ /\n\n$/s ) { $trim .= "\n"; }
  0         0  
1459             }
1460 8         19 undef($raw);
1461 8         37 return $trim;
1462             }
1463              
1464             =head3 extract_ifconfig_a()
1465              
1466             =cut
1467              
1468             sub extract_ifconfig_a {
1469 8 50   8 1 1510 my $raw = defined $_[0]->{asup} ? $_[0]->{asup} : $_[0];
1470 8         15 my $trim = '';
1471 8 100       4075 if ( $raw =~ /(===== IFCONFIG-A =====.*?)=====/s ) {
1472 7         37 $trim = $1;
1473 7         60 while ( $trim !~ /\n\n$/s ) { $trim .= "\n"; }
  0         0  
1474             }
1475 8         15 undef($raw);
1476 8         27 return $trim;
1477             }
1478              
1479             =head3 extract_ifgrp_status()
1480              
1481             =cut
1482              
1483             sub extract_ifgrp_status {
1484 8 50   8 1 3319 my $raw = defined $_[0]->{asup} ? $_[0]->{asup} : $_[0];
1485 8         93 my $trim = '';
1486 8 50       14445 if ( $raw =~ /(===== IFGRP-STATUS =====.*?)=====/s ) {
1487 0         0 $trim = $1;
1488 0         0 while ( $trim !~ /\n\n$/s ) { $trim .= "\n"; }
  0         0  
1489             }
1490 8         25 undef($raw);
1491 8         49 return $trim;
1492             }
1493              
1494             =head3 extract_ifstat_a()
1495              
1496             =cut
1497              
1498             sub extract_ifstat_a {
1499 8 50   8 1 1757 my $raw = defined $_[0]->{asup} ? $_[0]->{asup} : $_[0];
1500 8         14 my $trim = '';
1501 8 100       5809 if ( $raw =~ /(===== IFSTAT-A =====.*?)=====/s ) {
1502 7         81 $trim = $1;
1503 7         51 while ( $trim !~ /\n\n$/s ) { $trim .= "\n"; }
  0         0  
1504             }
1505 8         21 undef($raw);
1506 8         33 return $trim;
1507             }
1508              
1509             =head3 extract_initiator_groups()
1510              
1511             =cut
1512              
1513             sub extract_initiator_groups {
1514 8 50   8 1 1836 my $raw = defined $_[0]->{asup} ? $_[0]->{asup} : $_[0];
1515 8         16 my $trim = '';
1516 8 100       7397 if ( $raw =~ /(===== INITIATOR GROUPS =====.*?)=====/s ) {
1517 1         4 $trim = $1;
1518 1         5 while ( $trim !~ /\n\n$/s ) { $trim .= "\n"; }
  0         0  
1519             }
1520 8         19 undef($raw);
1521 8         39 return $trim;
1522             }
1523              
1524             =head3 extract_interconnect_config()
1525              
1526             =cut
1527              
1528             sub extract_interconnect_config {
1529 8 50   8 1 1828 my $raw = defined $_[0]->{asup} ? $_[0]->{asup} : $_[0];
1530 8         20 my $trim = '';
1531 8 50       10575 if ( $raw =~ /(===== INTERCONNECT CONFIG =====.*?)=====/s ) {
1532 0         0 $trim = $1;
1533 0         0 while ( $trim !~ /\n\n$/s ) { $trim .= "\n"; }
  0         0  
1534             }
1535 8         23 undef($raw);
1536 8         55 return $trim;
1537             }
1538              
1539             =head3 extract_interconnect_stats()
1540              
1541             =cut
1542              
1543             sub extract_interconnect_stats {
1544 8 50   8 1 1826 my $raw = defined $_[0]->{asup} ? $_[0]->{asup} : $_[0];
1545 8         23 my $trim = '';
1546 8 100       9607 if ( $raw =~ /(===== INTERCONNECT STATS =====.*?)=====/s ) {
1547 4         17 $trim = $1;
1548 4         20 while ( $trim !~ /\n\n$/s ) { $trim .= "\n"; }
  4         24  
1549             }
1550 8         27 undef($raw);
1551 8         1081 return $trim;
1552             }
1553              
1554             =head3 extract_iscsi_alias()
1555              
1556             =cut
1557              
1558             sub extract_iscsi_alias {
1559 8 50   8 1 6550 my $raw = defined $_[0]->{asup} ? $_[0]->{asup} : $_[0];
1560 8         20 my $trim = '';
1561 8 50       42244 if ( $raw =~ /(===== ISCSI ALIAS =====.*?)=====/s ) {
1562 0         0 $trim = $1;
1563 0         0 while ( $trim !~ /\n\n$/s ) { $trim .= "\n"; }
  0         0  
1564             }
1565 8         32 undef($raw);
1566 8         48 return $trim;
1567             }
1568              
1569             =head3 extract_iscsi_connections()
1570              
1571             =cut
1572              
1573             sub extract_iscsi_connections {
1574 8 50   8 1 1853 my $raw = defined $_[0]->{asup} ? $_[0]->{asup} : $_[0];
1575 8         18 my $trim = '';
1576 8 50       9414 if ( $raw =~ /(===== ISCSI CONNECTIONS =====.*?)=====/s ) {
1577 0         0 $trim = $1;
1578 0         0 while ( $trim !~ /\n\n$/s ) { $trim .= "\n"; }
  0         0  
1579             }
1580 8         27 undef($raw);
1581 8         51 return $trim;
1582             }
1583              
1584             =head3 extract_iscsi_initiator_status()
1585              
1586             =cut
1587              
1588             sub extract_iscsi_initiator_status {
1589 8 50   8 1 2428 my $raw = defined $_[0]->{asup} ? $_[0]->{asup} : $_[0];
1590 8         19 my $trim = '';
1591 8 100       14325 if ( $raw =~ /(===== ISCSI INITIATOR STATUS =====.*?)=====/s ) {
1592 1         5 $trim = $1;
1593 1         8 while ( $trim !~ /\n\n$/s ) { $trim .= "\n"; }
  0         0  
1594             }
1595 8         21 undef($raw);
1596 8         38 return $trim;
1597             }
1598              
1599             =head3 extract_iscsi_interface()
1600              
1601             =cut
1602              
1603             sub extract_iscsi_interface {
1604 8 50   8 1 2200 my $raw = defined $_[0]->{asup} ? $_[0]->{asup} : $_[0];
1605 8         19 my $trim = '';
1606 8 50       14671 if ( $raw =~ /(===== ISCSI INTERFACE =====.*?)=====/s ) {
1607 0         0 $trim = $1;
1608 0         0 while ( $trim !~ /\n\n$/s ) { $trim .= "\n"; }
  0         0  
1609             }
1610 8         26 undef($raw);
1611 8         247 return $trim;
1612             }
1613              
1614             =head3 extract_iscsi_interface_accesslist()
1615              
1616             =cut
1617              
1618             sub extract_iscsi_interface_accesslist {
1619 8 50   8 1 1773 my $raw = defined $_[0]->{asup} ? $_[0]->{asup} : $_[0];
1620 8         15 my $trim = '';
1621 8 50       15671 if ( $raw =~ /(===== ISCSI INTERFACE ACCESSLIST =====.*?)=====/s ) {
1622 0         0 $trim = $1;
1623 0         0 while ( $trim !~ /\n\n$/s ) { $trim .= "\n"; }
  0         0  
1624             }
1625 8         26 undef($raw);
1626 8         41 return $trim;
1627             }
1628              
1629             =head3 extract_iscsi_isns()
1630              
1631             =cut
1632              
1633             sub extract_iscsi_isns {
1634 8 50   8 1 2573 my $raw = defined $_[0]->{asup} ? $_[0]->{asup} : $_[0];
1635 8         18 my $trim = '';
1636 8 50       14937 if ( $raw =~ /(===== ISCSI ISNS =====.*?)=====/s ) {
1637 0         0 $trim = $1;
1638 0         0 while ( $trim !~ /\n\n$/s ) { $trim .= "\n"; }
  0         0  
1639             }
1640 8         34 undef($raw);
1641 8         60 return $trim;
1642             }
1643              
1644             =head3 extract_iscsi_nodename()
1645              
1646             =cut
1647              
1648             sub extract_iscsi_nodename {
1649 8 50   8 1 2934 my $raw = defined $_[0]->{asup} ? $_[0]->{asup} : $_[0];
1650 8         23 my $trim = '';
1651 8 50       11570 if ( $raw =~ /(===== ISCSI NODENAME =====.*?)=====/s ) {
1652 0         0 $trim = $1;
1653 0         0 while ( $trim !~ /\n\n$/s ) { $trim .= "\n"; }
  0         0  
1654             }
1655 8         29 undef($raw);
1656 8         53 return $trim;
1657             }
1658              
1659             =head3 extract_iscsi_portals()
1660              
1661             =cut
1662              
1663             sub extract_iscsi_portals {
1664 8 50   8 1 1545 my $raw = defined $_[0]->{asup} ? $_[0]->{asup} : $_[0];
1665 8         11 my $trim = '';
1666 8 50       9211 if ( $raw =~ /(===== ISCSI PORTALS =====.*?)=====/s ) {
1667 0         0 $trim = $1;
1668 0         0 while ( $trim !~ /\n\n$/s ) { $trim .= "\n"; }
  0         0  
1669             }
1670 8         18 undef($raw);
1671 8         70 return $trim;
1672             }
1673              
1674             =head3 extract_iscsi_security()
1675              
1676             =cut
1677              
1678             sub extract_iscsi_security {
1679 8 50   8 1 2433 my $raw = defined $_[0]->{asup} ? $_[0]->{asup} : $_[0];
1680 8         15 my $trim = '';
1681 8 50       9987 if ( $raw =~ /(===== ISCSI SECURITY =====.*?)=====/s ) {
1682 0         0 $trim = $1;
1683 0         0 while ( $trim !~ /\n\n$/s ) { $trim .= "\n"; }
  0         0  
1684             }
1685 8         23 undef($raw);
1686 8         42 return $trim;
1687             }
1688              
1689             =head3 extract_iscsi_sessions()
1690              
1691             =cut
1692              
1693             sub extract_iscsi_sessions {
1694 8 50   8 1 1699 my $raw = defined $_[0]->{asup} ? $_[0]->{asup} : $_[0];
1695 8         19 my $trim = '';
1696 8 50       8822 if ( $raw =~ /(===== ISCSI SESSIONS =====.*?)=====/s ) {
1697 0         0 $trim = $1;
1698 0         0 while ( $trim !~ /\n\n$/s ) { $trim .= "\n"; }
  0         0  
1699             }
1700 8         27 undef($raw);
1701 8         48 return $trim;
1702             }
1703              
1704             =head3 extract_iscsi_statistics()
1705              
1706             =cut
1707              
1708             sub extract_iscsi_statistics {
1709 8 50   8 1 1571 my $raw = defined $_[0]->{asup} ? $_[0]->{asup} : $_[0];
1710 8         14 my $trim = '';
1711 8 100       7156 if ( $raw =~ /(===== ISCSI STATISTICS =====.*?)=====/s ) {
1712 1         7 $trim = $1;
1713 1         9 while ( $trim !~ /\n\n$/s ) { $trim .= "\n"; }
  0         0  
1714             }
1715 8         20 undef($raw);
1716 8         46 return $trim;
1717             }
1718              
1719             =head3 extract_iscsi_status()
1720              
1721             =cut
1722              
1723             sub extract_iscsi_status {
1724 8 50   8 1 3347 my $raw = defined $_[0]->{asup} ? $_[0]->{asup} : $_[0];
1725 8         15 my $trim = '';
1726 8 100       13952 if ( $raw =~ /(===== ISCSI STATUS =====.*?)=====/s ) {
1727 1         4 $trim = $1;
1728 1         8 while ( $trim !~ /\n\n$/s ) { $trim .= "\n"; }
  0         0  
1729             }
1730 8         23 undef($raw);
1731 8         45 return $trim;
1732             }
1733              
1734             =head3 extract_iscsi_target_portal_groups()
1735              
1736             =cut
1737              
1738             sub extract_iscsi_target_portal_groups {
1739 8 50   8 1 1064 my $raw = defined $_[0]->{asup} ? $_[0]->{asup} : $_[0];
1740 8         16 my $trim = '';
1741 8 50       18272 if ( $raw =~ /(===== ISCSI TARGET PORTAL GROUPS =====.*?)=====/s ) {
1742 0         0 $trim = $1;
1743 0         0 while ( $trim !~ /\n\n$/s ) { $trim .= "\n"; }
  0         0  
1744             }
1745 8         29 undef($raw);
1746 8         246 return $trim;
1747             }
1748              
1749             =head3 extract_lun_config_check()
1750              
1751             =cut
1752              
1753             sub extract_lun_config_check {
1754 8 50   8 1 461 my $raw = defined $_[0]->{asup} ? $_[0]->{asup} : $_[0];
1755 8         21 my $trim = '';
1756 8 100       8153 if ( $raw =~ /(===== LUN CONFIG CHECK =====.*?)=====/s ) {
1757 1         3 $trim = $1;
1758 1         6 while ( $trim !~ /\n\n$/s ) { $trim .= "\n"; }
  0         0  
1759             }
1760 8         20 undef($raw);
1761 8         45 return $trim;
1762             }
1763              
1764             =head3 extract_lun_configuration()
1765              
1766             =cut
1767              
1768             sub extract_lun_configuration {
1769 8 50   8 1 818 my $raw = defined $_[0]->{asup} ? $_[0]->{asup} : $_[0];
1770            
1771             # v7
1772            
1773 8 100       7066 if ( $raw =~ /(===== LUN CONFIGURATION =====.*?)=====/s ) {
1774 1         6 my $trim = $1;
1775 1         9 while ( $trim !~ /\n\n$/s ) { $trim .= "\n"; }
  0         0  
1776 1         5 return $trim;
1777             }
1778            
1779             #v8
1780            
1781 7         38 my @lines = Parse::NetApp::ASUP::_agnostic_line_split($raw);
1782 7         19033 my @trim;
1783            
1784 7         45 my $regex_lun_name = Parse::NetApp::ASUP::_regex_lun_name();
1785            
1786 7         39 while ( @lines ) {
1787 304430         1228617 while ( $lines[0] =~ /^(\s{7,8}|\t)($regex_lun_name) +(.*?) +\((\d+)\).*\((.+)\)$/ ) {
1788 5         14 push @trim, shift @lines;
1789 5 50       23 push @trim, shift @lines if $lines[0] =~ /^\w/; # handle word-wrap on summary line
1790 5         36 while ( $lines[0] =~ /^(\s{7,8}|\t)\s+.+: .+$/ ) {
1791 0         0 push @trim, shift @lines;
1792             }
1793             }
1794 304430         615933 shift @lines;
1795             }
1796            
1797 7 100       88 return join("\n",@trim) . "\n" if scalar(@trim);
1798              
1799             # give up
1800 4         57 return '';
1801             }
1802              
1803             =head3 extract_lun_hist()
1804              
1805             =cut
1806              
1807             sub extract_lun_hist {
1808 8 50   8 1 1622 my $raw = defined $_[0]->{asup} ? $_[0]->{asup} : $_[0];
1809 8         12 my $trim = '';
1810 8 50       8882 if ( $raw =~ /(===== LUN HIST =====.*?)=====/s ) {
1811 0         0 $trim = $1;
1812 0         0 while ( $trim !~ /\n\n$/s ) { $trim .= "\n"; }
  0         0  
1813             }
1814 8         24 undef($raw);
1815 8         43 return $trim;
1816             }
1817              
1818             =head3 extract_lun_statistics()
1819              
1820             =cut
1821              
1822             sub extract_lun_statistics {
1823 8 50   8 1 1471 my $raw = defined $_[0]->{asup} ? $_[0]->{asup} : $_[0];
1824 8         14 my $trim = '';
1825 8 100       7538 if ( $raw =~ /(===== LUN STATISTICS =====.*?)=====/s ) {
1826 1         6 $trim = $1;
1827 1         8 while ( $trim !~ /\n\n$/s ) { $trim .= "\n"; }
  0         0  
1828             }
1829 8         23 undef($raw);
1830 8         47 return $trim;
1831             }
1832              
1833             =head3 extract_messages()
1834              
1835             =cut
1836              
1837             sub extract_messages {
1838 8 50   8 1 398 my $raw = defined $_[0]->{asup} ? $_[0]->{asup} : $_[0];
1839 8         17 my $trim = '';
1840              
1841 8 100       278999 if ( $raw =~ /(===== MESSAGES =====.*?)(=====|\n\n)/s ) { # Often the last item
1842 7         5295 $trim = $1;
1843             }
1844            
1845 8 50 66     12007 if ( not $trim and $raw =~ /((^[MTWFS][ouehra][neduit] [JFMASOND]\w\w \d\d? \d\d:\d\d:\d\d [A-Z]{1,4}([\+\-]\d+)? (\[[^\]]+]: .+?|last message repeated \d+ times.+?)\n\n?)+)/ms ) { # v8 is unlabelled
1846 0         0 $trim = "===== MESSAGES =====\n" . $1;
1847             }
1848              
1849 8         61 while ( $trim !~ /\n\n$/s ) { $trim .= "\n"; }
  16         7068  
1850              
1851 8         24 undef($raw);
1852 8         66 return $trim;
1853             }
1854              
1855             =head3 extract_nbtstat_c()
1856              
1857             =cut
1858              
1859             sub extract_nbtstat_c {
1860 8 50   8 1 1929 my $raw = defined $_[0]->{asup} ? $_[0]->{asup} : $_[0];
1861 8         18 my $trim = '';
1862 8 100       13531 if ( $raw =~ /(===== NBTSTAT-C =====.*?)=====/s ) {
1863 7         45 $trim = $1;
1864 7         200 while ( $trim !~ /\n\n$/s ) { $trim .= "\n"; }
  0         0  
1865             }
1866 8         22 undef($raw);
1867 8         53 return $trim;
1868             }
1869              
1870             =head3 extract_netstat_s()
1871              
1872             =cut
1873              
1874             sub extract_netstat_s {
1875 8 50   8 1 1746 my $raw = defined $_[0]->{asup} ? $_[0]->{asup} : $_[0];
1876 8         16 my $trim = '';
1877 8 100       10939 if ( $raw =~ /(===== NETSTAT-S =====.*?)=====/s ) {
1878 7         82 $trim = $1;
1879 7         50 while ( $trim !~ /\n\n$/s ) { $trim .= "\n"; }
  0         0  
1880             }
1881 8         17 undef($raw);
1882 8         35 return $trim;
1883             }
1884              
1885             =head3 extract_nfsstat_cc()
1886              
1887             =cut
1888              
1889             sub extract_nfsstat_cc {
1890 8 50   8 1 1800 my $raw = defined $_[0]->{asup} ? $_[0]->{asup} : $_[0];
1891 8         19 my $trim = '';
1892 8 50       12543 if ( $raw =~ /(===== NFSSTAT-CC =====.*?)=====/s ) {
1893 0         0 $trim = $1;
1894 0         0 while ( $trim !~ /\n\n$/s ) { $trim .= "\n"; }
  0         0  
1895             }
1896 8         24 undef($raw);
1897 8         42 return $trim;
1898             }
1899              
1900             =head3 extract_nfsstat_d()
1901              
1902             =cut
1903              
1904             sub extract_nfsstat_d {
1905 8 50   8 1 1471 my $raw = defined $_[0]->{asup} ? $_[0]->{asup} : $_[0];
1906 8         16 my $trim = '';
1907 8 100       4858 if ( $raw =~ /(===== NFSSTAT-D =====.*?)=====/s ) {
1908 7         73 $trim = $1;
1909 7         49 while ( $trim !~ /\n\n$/s ) { $trim .= "\n"; }
  0         0  
1910             }
1911 8         41 undef($raw);
1912 8         33 return $trim;
1913             }
1914              
1915             =head3 extract_nis_info()
1916              
1917             =cut
1918              
1919             sub extract_nis_info {
1920 8 50   8 1 734 my $raw = defined $_[0]->{asup} ? $_[0]->{asup} : $_[0];
1921 8         17 my $trim = '';
1922 8 100       5175 if ( $raw =~ /(===== NIS info =====.*?)=====/s ) {
1923 7         35 $trim = $1;
1924 7         53 while ( $trim !~ /\n\n$/s ) { $trim .= "\n"; }
  0         0  
1925             }
1926 8         19 undef($raw);
1927 8         32 return $trim;
1928             }
1929              
1930             =head3 extract_nsswitch_conf()
1931              
1932             =cut
1933              
1934             sub extract_nsswitch_conf {
1935 8 50   8 1 413 my $raw = defined $_[0]->{asup} ? $_[0]->{asup} : $_[0];
1936 8         17 my $trim = '';
1937 8 100       9955 if ( $raw =~ /(===== NSSWITCH-CONF =====.*?)=====/s ) {
1938 4         15 $trim = $1;
1939 4         23 while ( $trim !~ /\n\n$/s ) { $trim .= "\n"; }
  4         29  
1940             }
1941 8         25 undef($raw);
1942 8         38 return $trim;
1943             }
1944              
1945             =head3 extract_options()
1946              
1947             =cut
1948              
1949             sub extract_options {
1950 8 50   8 1 1634 my $raw = defined $_[0]->{asup} ? $_[0]->{asup} : $_[0];
1951 8         18 my $trim = '';
1952 8 100       4788 if ( $raw =~ /(===== OPTIONS =====.*?)=====/s ) {
1953 7         129 $trim = $1;
1954 7         52 while ( $trim !~ /\n\n$/s ) { $trim .= "\n"; }
  0         0  
1955             }
1956 8         20 undef($raw);
1957 8         31 return $trim;
1958             }
1959              
1960             =head3 extract_portsets()
1961              
1962             =cut
1963              
1964             sub extract_portsets {
1965 8 50   8 1 2133 my $raw = defined $_[0]->{asup} ? $_[0]->{asup} : $_[0];
1966 8         20 my $trim = '';
1967 8 50       19357 if ( $raw =~ /(===== PORTSETS =====.*?)=====/s ) {
1968 0         0 $trim = $1;
1969 0         0 while ( $trim !~ /\n\n$/s ) { $trim .= "\n"; }
  0         0  
1970             }
1971 8         30 undef($raw);
1972 8         63 return $trim;
1973             }
1974              
1975             =head3 extract_priority_show()
1976              
1977             =cut
1978              
1979             sub extract_priority_show {
1980 8 50   8 1 1423 my $raw = defined $_[0]->{asup} ? $_[0]->{asup} : $_[0];
1981 8         15 my $trim = '';
1982 8 100       5957 if ( $raw =~ /(===== PRIORITY_SHOW =====.*?)=====/s ) {
1983 3         14 $trim = $1;
1984 3         18 while ( $trim !~ /\n\n$/s ) { $trim .= "\n"; }
  0         0  
1985             }
1986 8         16 undef($raw);
1987 8         35 return $trim;
1988             }
1989              
1990             =head3 extract_qtree_status()
1991              
1992             =cut
1993              
1994             sub extract_qtree_status {
1995 8 50   8 1 1527 my $raw = defined $_[0]->{asup} ? $_[0]->{asup} : $_[0];
1996              
1997             # v7
1998              
1999 8 100       5719 if ( $raw =~ /(===== QTREE-STATUS =====.*?)=====/s ) {
2000 7         45 my $trim = $1;
2001 7         49 while ( $trim !~ /\n\n$/s ) { $trim .= "\n"; }
  0         0  
2002 7         26 return $trim;
2003             }
2004              
2005             # v8
2006              
2007 1         9 my @lines = Parse::NetApp::ASUP::_agnostic_line_split($raw);
2008 1         2807 my @trim;
2009            
2010 1         17 my $word = Parse::NetApp::ASUP::_regex_path();
2011            
2012 1         11 while ( @lines ) {
2013 61762         85835 my $line = shift @lines;
2014 61762 50       179858 if ( $line =~ /^Volume\s+Tree\s+Style\s+Oplocks\s+Status\s+ID/ ) {
2015 0         0 @trim = ( $line, shift @lines ); # grab the "---" line too
2016 0         0 while ( $lines[0] =~ /^(${word}\s+){4,6}\d/ ) {
2017 0         0 push @trim, shift @lines;
2018             }
2019             }
2020             }
2021            
2022 1 50       12 return join("\n",@trim) . "\n" if scalar(@trim);
2023              
2024             # give up
2025 1         18 return '';
2026             }
2027              
2028             =head3 extract_quotas()
2029              
2030             =cut
2031              
2032             sub extract_quotas {
2033 8 50   8 1 2054 my $raw = defined $_[0]->{asup} ? $_[0]->{asup} : $_[0];
2034 8         15 my $trim = '';
2035 8 50       10296 if ( $raw =~ /(===== QUOTAS =====.*?)=====/s ) {
2036 0         0 $trim = $1;
2037 0         0 while ( $trim !~ /\n\n$/s ) { $trim .= "\n"; }
  0         0  
2038             }
2039 8         27 undef($raw);
2040 8         42 return $trim;
2041             }
2042              
2043             =head3 extract_rc()
2044              
2045             =cut
2046              
2047             sub extract_rc {
2048 8 50   8 1 1714 my $raw = defined $_[0]->{asup} ? $_[0]->{asup} : $_[0];
2049 8         15 my $trim = '';
2050 8 100       8844 if ( $raw =~ /(===== RC =====.*?)=====/s ) {
2051 4         23 $trim = $1;
2052 4         20 while ( $trim !~ /\n\n$/s ) { $trim .= "\n"; }
  4         30  
2053             }
2054 8         22 undef($raw);
2055 8         213 return $trim;
2056             }
2057              
2058             =head3 extract_resolv_conf()
2059              
2060             =cut
2061              
2062             sub extract_resolv_conf {
2063 8 50   8 1 1609 my $raw = defined $_[0]->{asup} ? $_[0]->{asup} : $_[0];
2064 8         14 my $trim = '';
2065 8 100       6774 if ( $raw =~ /(===== RESOLV-CONF =====.*?)=====/s ) {
2066 4         15 $trim = $1;
2067 4         18 while ( $trim !~ /\n\n$/s ) { $trim .= "\n"; }
  4         25  
2068             }
2069 8         20 undef($raw);
2070 8         97 return $trim;
2071             }
2072              
2073             =head3 extract_route_gsn()
2074              
2075             =cut
2076              
2077             sub extract_route_gsn {
2078 8 50   8 1 1723 my $raw = defined $_[0]->{asup} ? $_[0]->{asup} : $_[0];
2079 8         19 my $trim = '';
2080 8 50       8997 if ( $raw =~ /(===== ROUTE-GSN=====.*?)=====/s ) {
2081 0         0 $trim = $1;
2082 0         0 while ( $trim !~ /\n\n$/s ) { $trim .= "\n"; }
  0         0  
2083             }
2084 8         23 undef($raw);
2085 8         39 return $trim;
2086             }
2087              
2088             =head3 extract_sas_adapter_state()
2089              
2090             =cut
2091              
2092             sub extract_sas_adapter_state {
2093 8 50   8 1 1838 my $raw = defined $_[0]->{asup} ? $_[0]->{asup} : $_[0];
2094 8         22 my $trim = '';
2095 8 100       13126 if ( $raw =~ /(===== SAS ADAPTER STATE =====.*?)=====/s ) {
2096 3         17 $trim = $1;
2097 3         22 while ( $trim !~ /\n\n$/s ) { $trim .= "\n"; }
  0         0  
2098             }
2099 8         22 undef($raw);
2100 8         37 return $trim;
2101             }
2102              
2103             =head3 extract_sas_dev_stats()
2104              
2105             =cut
2106              
2107             sub extract_sas_dev_stats {
2108 8 50   8 1 1942 my $raw = defined $_[0]->{asup} ? $_[0]->{asup} : $_[0];
2109 8         18 my $trim = '';
2110 8 100       12011 if ( $raw =~ /(===== SAS DEV STATS =====.*?)=====/s ) {
2111 3         14 $trim = $1;
2112 3         447 while ( $trim !~ /\n\n$/s ) { $trim .= "\n"; }
  0         0  
2113             }
2114 8         29 undef($raw);
2115 8         43 return $trim;
2116             }
2117              
2118             =head3 extract_sas_expander_map()
2119              
2120             =cut
2121              
2122             sub extract_sas_expander_map {
2123 8 50   8 1 1542 my $raw = defined $_[0]->{asup} ? $_[0]->{asup} : $_[0];
2124 8         17 my $trim = '';
2125 8 100       6311 if ( $raw =~ /(===== SAS EXPANDER MAP =====.*?)=====/s ) {
2126 3         11 $trim = $1;
2127 3         20 while ( $trim !~ /\n\n$/s ) { $trim .= "\n"; }
  0         0  
2128             }
2129 8         19 undef($raw);
2130 8         33 return $trim;
2131             }
2132              
2133             =head3 extract_sas_expander_phy_state()
2134              
2135             =cut
2136              
2137             sub extract_sas_expander_phy_state {
2138 8 50   8 1 400 my $raw = defined $_[0]->{asup} ? $_[0]->{asup} : $_[0];
2139 8         17 my $trim = '';
2140 8 100       7364 if ( $raw =~ /(===== SAS EXPANDER PHY STATE =====.*?)=====/s ) {
2141 3         9 $trim = $1;
2142 3         18 while ( $trim !~ /\n\n$/s ) { $trim .= "\n"; }
  0         0  
2143             }
2144 8         17 undef($raw);
2145 8         32 return $trim;
2146             }
2147              
2148             =head3 extract_sas_shelf()
2149              
2150             =cut
2151              
2152             sub extract_sas_shelf {
2153 8 50   8 1 1854 my $raw = defined $_[0]->{asup} ? $_[0]->{asup} : $_[0];
2154 8         17 my $trim = '';
2155 8 100       9185 if ( $raw =~ /(===== SAS SHELF =====.*?)=====/s ) {
2156 3         10 $trim = $1;
2157 3         18 while ( $trim !~ /\n\n$/s ) { $trim .= "\n"; }
  0         0  
2158             }
2159 8         27 undef($raw);
2160 8         41 return $trim;
2161             }
2162              
2163             =head3 extract_service_usage()
2164              
2165             =cut
2166              
2167             sub extract_service_usage {
2168 8 50   8 1 391 my $raw = defined $_[0]->{asup} ? $_[0]->{asup} : $_[0];
2169 8         15 my $trim = '';
2170 8 100       4805 if ( $raw =~ /(===== SERVICE USAGE =====.*?)=====/s ) {
2171 7         34 $trim = $1;
2172 7         49 while ( $trim !~ /\n\n$/s ) { $trim .= "\n"; }
  0         0  
2173             }
2174 8         20 undef($raw);
2175 8         66 return $trim;
2176             }
2177              
2178             =head3 extract_shelf_log_esh()
2179              
2180             =cut
2181              
2182             sub extract_shelf_log_esh {
2183 8 50   8 1 7063 my $raw = defined $_[0]->{asup} ? $_[0]->{asup} : $_[0];
2184 8         15 my $trim = '';
2185 8 50       9193 if ( $raw =~ /(===== SHELF-LOG-ESH =====.*?)=====/s ) {
2186 0         0 $trim = $1;
2187 0         0 while ( $trim !~ /\n\n$/s ) { $trim .= "\n"; }
  0         0  
2188             }
2189 8         27 undef($raw);
2190 8         45 return $trim;
2191             }
2192              
2193             =head3 extract_shelf_log_iom()
2194              
2195             =cut
2196              
2197             sub extract_shelf_log_iom {
2198 8 50   8 1 492 my $raw = defined $_[0]->{asup} ? $_[0]->{asup} : $_[0];
2199 8         13 my $trim = '';
2200 8 50       8737 if ( $raw =~ /(===== SHELF-LOG-IOM =====.*?)=====/s ) {
2201 0         0 $trim = $1;
2202 0         0 while ( $trim !~ /\n\n$/s ) { $trim .= "\n"; }
  0         0  
2203             }
2204 8         17 undef($raw);
2205 8         32 return $trim;
2206             }
2207              
2208             =head3 extract_sis_stat()
2209              
2210             =cut
2211              
2212             sub extract_sis_stat {
2213 8 50   8 1 1809 my $raw = defined $_[0]->{asup} ? $_[0]->{asup} : $_[0];
2214 8         22 my $trim = '';
2215 8 50       10139 if ( $raw =~ /(===== SIS STAT =====.*?)=====/s ) {
2216 0         0 $trim = $1;
2217 0         0 while ( $trim !~ /\n\n$/s ) { $trim .= "\n"; }
  0         0  
2218             }
2219 8         28 undef($raw);
2220 8         52 return $trim;
2221             }
2222              
2223             =head3 extract_sis_stat_l()
2224              
2225             =cut
2226              
2227             sub extract_sis_stat_l {
2228 8 50   8 1 2028 my $raw = defined $_[0]->{asup} ? $_[0]->{asup} : $_[0];
2229 8         18 my $trim = '';
2230 8 50       10797 if ( $raw =~ /(===== SIS STAT L =====.*?)=====/s ) {
2231 0         0 $trim = $1;
2232 0         0 while ( $trim !~ /\n\n$/s ) { $trim .= "\n"; }
  0         0  
2233             }
2234 8         29 undef($raw);
2235 8         161 return $trim;
2236             }
2237              
2238             =head3 extract_sis_status()
2239              
2240             =cut
2241              
2242             sub extract_sis_status {
2243 8 50   8 1 1676 my $raw = defined $_[0]->{asup} ? $_[0]->{asup} : $_[0];
2244 8         18 my $trim = '';
2245 8 50       10345 if ( $raw =~ /(===== SIS STATUS =====.*?)=====/s ) {
2246 0         0 $trim = $1;
2247 0         0 while ( $trim !~ /\n\n$/s ) { $trim .= "\n"; }
  0         0  
2248             }
2249 8         24 undef($raw);
2250 8         46 return $trim;
2251             }
2252              
2253             =head3 extract_sis_status_l()
2254              
2255             =cut
2256              
2257             sub extract_sis_status_l {
2258 8 50   8 1 1674 my $raw = defined $_[0]->{asup} ? $_[0]->{asup} : $_[0];
2259 8         17 my $trim = '';
2260 8 50       9290 if ( $raw =~ /(===== SIS STATUS L =====.*?)=====/s ) {
2261 0         0 $trim = $1;
2262 0         0 while ( $trim !~ /\n\n$/s ) { $trim .= "\n"; }
  0         0  
2263             }
2264 8         24 undef($raw);
2265 8         177 return $trim;
2266             }
2267              
2268             =head3 extract_sm_allow()
2269              
2270             =cut
2271              
2272             sub extract_sm_allow {
2273 8 50   8 1 1889 my $raw = defined $_[0]->{asup} ? $_[0]->{asup} : $_[0];
2274 8         18 my $trim = '';
2275 8 50       21632 if ( $raw =~ /(===== SM-ALLOW =====.*?)=====/s ) {
2276 0         0 $trim = $1;
2277 0         0 while ( $trim !~ /\n\n$/s ) { $trim .= "\n"; }
  0         0  
2278             }
2279 8         28 undef($raw);
2280 8         50 return $trim;
2281             }
2282              
2283             =head3 extract_sm_conf()
2284              
2285             =cut
2286              
2287             sub extract_sm_conf {
2288 8 50   8 1 1645 my $raw = defined $_[0]->{asup} ? $_[0]->{asup} : $_[0];
2289 8         17 my $trim = '';
2290 8 100       8034 if ( $raw =~ /(===== SM-CONF =====.*?)=====/s ) {
2291 1         5 $trim = $1;
2292 1         7 while ( $trim !~ /\n\n$/s ) { $trim .= "\n"; }
  1         6  
2293             }
2294 8         23 undef($raw);
2295 8         60 return $trim;
2296             }
2297              
2298             =head3 extract_snap_list_n()
2299              
2300             =cut
2301              
2302             sub extract_snap_list_n {
2303 8 50   8 1 1854 my $raw = defined $_[0]->{asup} ? $_[0]->{asup} : $_[0];
2304 8         17 my $trim = '';
2305 8 100       7066 if ( $raw =~ /(===== SNAP-LIST-N =====.*?)=====/s ) {
2306 7         53 $trim = $1;
2307 7         51 while ( $trim !~ /\n\n$/s ) { $trim .= "\n"; }
  0         0  
2308             }
2309 8         18 undef($raw);
2310 8         36 return $trim;
2311             }
2312              
2313             =head3 extract_snap_list_n_a()
2314              
2315             =cut
2316              
2317             sub extract_snap_list_n_a {
2318 8 50   8 1 1392 my $raw = defined $_[0]->{asup} ? $_[0]->{asup} : $_[0];
2319 8         20 my $trim = '';
2320 8 100       5001 if ( $raw =~ /(===== SNAP-LIST-N-A =====.*?)=====/s ) {
2321 7         23 $trim = $1;
2322 7         43 while ( $trim !~ /\n\n$/s ) { $trim .= "\n"; }
  0         0  
2323             }
2324 8         17 undef($raw);
2325 8         27 return $trim;
2326             }
2327              
2328             =head3 extract_snap_reserve()
2329              
2330             =cut
2331              
2332             sub extract_snap_reserve {
2333 8 50   8 1 1739 my $raw = defined $_[0]->{asup} ? $_[0]->{asup} : $_[0];
2334 8         23 my $trim = '';
2335 8 100       6254 if ( $raw =~ /(===== SNAP-RESERVE =====.*?)=====/s ) {
2336 7         44 $trim = $1;
2337 7         52 while ( $trim !~ /\n\n$/s ) { $trim .= "\n"; }
  0         0  
2338             }
2339 8         18 undef($raw);
2340 8         36 return $trim;
2341             }
2342              
2343             =head3 extract_snap_reserve_a()
2344              
2345             =cut
2346              
2347             sub extract_snap_reserve_a {
2348 8 50   8 1 1670 my $raw = defined $_[0]->{asup} ? $_[0]->{asup} : $_[0];
2349 8         17 my $trim = '';
2350 8 100       4969 if ( $raw =~ /(===== SNAP-RESERVE-A =====.*?)=====/s ) {
2351 7         30 $trim = $1;
2352 7         49 while ( $trim !~ /\n\n$/s ) { $trim .= "\n"; }
  0         0  
2353             }
2354 8         17 undef($raw);
2355 8         31 return $trim;
2356             }
2357              
2358             =head3 extract_snap_sched()
2359              
2360             =cut
2361              
2362             sub extract_snap_sched {
2363 8 50   8 1 1580 my $raw = defined $_[0]->{asup} ? $_[0]->{asup} : $_[0];
2364 8         20 my $trim = '';
2365 8 100       4323 if ( $raw =~ /(===== SNAP-SCHED =====.*?)=====/s ) {
2366 7         33 $trim = $1;
2367 7         48 while ( $trim !~ /\n\n$/s ) { $trim .= "\n"; }
  0         0  
2368             }
2369 8         20 undef($raw);
2370 8         35 return $trim;
2371             }
2372              
2373             =head3 extract_snap_sched_a()
2374              
2375             =cut
2376              
2377             sub extract_snap_sched_a {
2378 8 50   8 1 1576 my $raw = defined $_[0]->{asup} ? $_[0]->{asup} : $_[0];
2379 8         15 my $trim = '';
2380 8 100       4907 if ( $raw =~ /(===== SNAP-SCHED-A =====.*?)=====/s ) {
2381 7         24 $trim = $1;
2382 7         39 while ( $trim !~ /\n\n$/s ) { $trim .= "\n"; }
  0         0  
2383             }
2384 8         13 undef($raw);
2385 8         27 return $trim;
2386             }
2387              
2388             =head3 extract_snap_status()
2389              
2390             =cut
2391              
2392             sub extract_snap_status {
2393 8 50   8 1 2008 my $raw = defined $_[0]->{asup} ? $_[0]->{asup} : $_[0];
2394 8         15 my $trim = '';
2395 8 100       6882 if ( $raw =~ /(===== SNAP-STATUS =====.*?)=====/s ) {
2396 3         20 $trim = $1;
2397 3         24 while ( $trim !~ /\n\n$/s ) { $trim .= "\n"; }
  0         0  
2398             }
2399 8         20 undef($raw);
2400 8         40 return $trim;
2401             }
2402              
2403             =head3 extract_snap_status_a()
2404              
2405             =cut
2406              
2407             sub extract_snap_status_a {
2408 8 50   8 1 1343 my $raw = defined $_[0]->{asup} ? $_[0]->{asup} : $_[0];
2409 8         19 my $trim = '';
2410 8 100       6343 if ( $raw =~ /(===== SNAP-STATUS-A =====.*?)=====/s ) {
2411 3         19 $trim = $1;
2412 3         24 while ( $trim !~ /\n\n$/s ) { $trim .= "\n"; }
  0         0  
2413             }
2414 8         21 undef($raw);
2415 8         38 return $trim;
2416             }
2417              
2418             =head3 extract_snapmirror_destinations()
2419              
2420             =cut
2421              
2422             sub extract_snapmirror_destinations {
2423 8 50   8 1 1623 my $raw = defined $_[0]->{asup} ? $_[0]->{asup} : $_[0];
2424 8         16 my $trim = '';
2425 8 100       7858 if ( $raw =~ /(===== SNAPMIRROR DESTINATIONS =====.*?)=====/s ) {
2426 4         9 $trim = $1;
2427 4         22 while ( $trim !~ /\n\n$/s ) { $trim .= "\n"; }
  0         0  
2428             }
2429 8         21 undef($raw);
2430 8         39 return $trim;
2431             }
2432              
2433             =head3 extract_snapmirror_status()
2434              
2435             =cut
2436              
2437             sub extract_snapmirror_status {
2438 8 50   8 1 1755 my $raw = defined $_[0]->{asup} ? $_[0]->{asup} : $_[0];
2439 8         14 my $trim = '';
2440 8 100       7313 if ( $raw =~ /(===== SNAPMIRROR STATUS =====.*?)=====/s ) {
2441 4         14 $trim = $1;
2442 4         24 while ( $trim !~ /\n\n$/s ) { $trim .= "\n"; }
  0         0  
2443             }
2444 8         21 undef($raw);
2445 8         35 return $trim;
2446             }
2447              
2448             =head3 extract_snapvault_destinations()
2449              
2450             =cut
2451              
2452             sub extract_snapvault_destinations {
2453 8 50   8 1 1733 my $raw = defined $_[0]->{asup} ? $_[0]->{asup} : $_[0];
2454 8         19 my $trim = '';
2455 8 50       11785 if ( $raw =~ /(===== SNAPVAULT DESTINATIONS =====.*?)=====/s ) {
2456 0         0 $trim = $1;
2457 0         0 while ( $trim !~ /\n\n$/s ) { $trim .= "\n"; }
  0         0  
2458             }
2459 8         46 undef($raw);
2460 8         58 return $trim;
2461             }
2462              
2463             =head3 extract_snapvault_snap_sched()
2464              
2465             =cut
2466              
2467             sub extract_snapvault_snap_sched {
2468 8 50   8 1 3915 my $raw = defined $_[0]->{asup} ? $_[0]->{asup} : $_[0];
2469 8         16 my $trim = '';
2470 8 50       14220 if ( $raw =~ /(===== SNAPVAULT SNAP SCHED =====.*?)=====/s ) {
2471 0         0 $trim = $1;
2472 0         0 while ( $trim !~ /\n\n$/s ) { $trim .= "\n"; }
  0         0  
2473             }
2474 8         179 undef($raw);
2475 8         184 return $trim;
2476             }
2477              
2478             =head3 extract_snapvault_status_l()
2479              
2480             =cut
2481              
2482             sub extract_snapvault_status_l {
2483 8 50   8 1 1575 my $raw = defined $_[0]->{asup} ? $_[0]->{asup} : $_[0];
2484 8         20 my $trim = '';
2485 8 50       8681 if ( $raw =~ /(===== SNAPVAULT STATUS L =====.*?)=====/s ) {
2486 0         0 $trim = $1;
2487 0         0 while ( $trim !~ /\n\n$/s ) { $trim .= "\n"; }
  0         0  
2488             }
2489 8         23 undef($raw);
2490 8         32 return $trim;
2491             }
2492              
2493             =head3 extract_snaplock()
2494              
2495             =cut
2496              
2497             sub extract_snaplock {
2498 8 50   8 1 1519 my $raw = defined $_[0]->{asup} ? $_[0]->{asup} : $_[0];
2499 8         16 my $trim = '';
2500 8 50       9323 if ( $raw =~ /(===== SNAPLOCK =====.*?)=====/s ) {
2501 0         0 $trim = $1;
2502 0         0 while ( $trim !~ /\n\n$/s ) { $trim .= "\n"; }
  0         0  
2503             }
2504 8         23 undef($raw);
2505 8         38 return $trim;
2506             }
2507              
2508             =head3 extract_snaplock_clock()
2509              
2510             =cut
2511              
2512             sub extract_snaplock_clock {
2513 8 50   8 1 1467 my $raw = defined $_[0]->{asup} ? $_[0]->{asup} : $_[0];
2514 8         16 my $trim = '';
2515 8 50       8362 if ( $raw =~ /(===== SNAPLOCK-CLOCK =====.*?)=====/s ) {
2516 0         0 $trim = $1;
2517 0         0 while ( $trim !~ /\n\n$/s ) { $trim .= "\n"; }
  0         0  
2518             }
2519 8         20 undef($raw);
2520 8         39 return $trim;
2521             }
2522              
2523             =head3 extract_software_licenses()
2524              
2525             =cut
2526              
2527             sub extract_software_licenses {
2528 8 50   8 1 1662 my $raw = defined $_[0]->{asup} ? $_[0]->{asup} : $_[0];
2529 8         21 my $trim = '';
2530 8 100       4275 if ( $raw =~ /(===== SOFTWARE LICENSES =====.*?)=====/s ) {
2531 7         41 $trim = $1;
2532 7         44 while ( $trim !~ /\n\n$/s ) { $trim .= "\n"; }
  0         0  
2533             }
2534 8         17 undef($raw);
2535 8         34 return $trim;
2536             }
2537              
2538             =head3 extract_ssh()
2539              
2540             =cut
2541              
2542             sub extract_ssh {
2543 8 50   8 1 384 my $raw = defined $_[0]->{asup} ? $_[0]->{asup} : $_[0];
2544 8         18 my $trim = '';
2545 8 100       6837 if ( $raw =~ /(===== SSH =====.*?)=====/s ) {
2546 3         14 $trim = $1;
2547 3         18 while ( $trim !~ /\n\n$/s ) { $trim .= "\n"; }
  0         0  
2548             }
2549 8         19 undef($raw);
2550 8         40 return $trim;
2551             }
2552              
2553             =head3 extract_storage()
2554              
2555             =cut
2556              
2557             sub extract_storage {
2558 8 50   8 1 1456 my $raw = defined $_[0]->{asup} ? $_[0]->{asup} : $_[0];
2559 8         14 my $trim = '';
2560 8 100       6354 if ( $raw =~ /(===== STORAGE =====.*?)=====/s ) {
2561 7         390 $trim = $1;
2562 7         45 while ( $trim !~ /\n\n$/s ) { $trim .= "\n"; }
  0         0  
2563             }
2564 8         17 undef($raw);
2565 8         30 return $trim;
2566             }
2567              
2568             =head3 extract_sysconfig_a()
2569              
2570             =cut
2571              
2572             sub extract_sysconfig_a {
2573 8 50   8 1 1541 my $raw = defined $_[0]->{asup} ? $_[0]->{asup} : $_[0];
2574 8         16 my $trim = '';
2575 8 100       5151 if ( $raw =~ /(===== SYSCONFIG-A =====.*?)=====/s ) {
2576 7         96 $trim = $1;
2577 7         59 while ( $trim !~ /\n\n$/s ) { $trim .= "\n"; }
  0         0  
2578             }
2579 8         20 undef($raw);
2580 8         35 return $trim;
2581             }
2582              
2583             =head3 extract_sysconfig_ac()
2584              
2585             =cut
2586              
2587             sub extract_sysconfig_ac {
2588 8 50   8 1 1719 my $raw = defined $_[0]->{asup} ? $_[0]->{asup} : $_[0];
2589 8         25 my $trim = '';
2590 8 50       9077 if ( $raw =~ /(===== SYSCONFIG-AC =====.*?)=====/s ) {
2591 0         0 $trim = $1;
2592 0         0 while ( $trim !~ /\n\n$/s ) { $trim .= "\n"; }
  0         0  
2593             }
2594 8         25 undef($raw);
2595 8         47 return $trim;
2596             }
2597              
2598             =head3 extract_sysconfig_c()
2599              
2600             =cut
2601              
2602             sub extract_sysconfig_c {
2603 8 50   8 1 1666 my $raw = defined $_[0]->{asup} ? $_[0]->{asup} : $_[0];
2604 8         16 my $trim = '';
2605 8 100       4356 if ( $raw =~ /(===== SYSCONFIG-C =====.*?)=====/s ) {
2606 7         23 $trim = $1;
2607 7         45 while ( $trim !~ /\n\n$/s ) { $trim .= "\n"; }
  0         0  
2608             }
2609 8         18 undef($raw);
2610 8         31 return $trim;
2611             }
2612              
2613             =head3 extract_sysconfig_d()
2614              
2615             =cut
2616              
2617             sub extract_sysconfig_d {
2618 8 50   8 1 1682 my $raw = defined $_[0]->{asup} ? $_[0]->{asup} : $_[0];
2619 8         12 my $trim = '';
2620 8 100       3955 if ( $raw =~ /(===== SYSCONFIG-D =====.*?)=====/s ) {
2621 7         46 $trim = $1;
2622 7         46 while ( $trim !~ /\n\n$/s ) { $trim .= "\n"; }
  0         0  
2623             }
2624 8         16 undef($raw);
2625 8         25 return $trim;
2626             }
2627              
2628             =head3 extract_sysconfig_hardware_ids()
2629              
2630             =cut
2631              
2632             sub extract_sysconfig_hardware_ids {
2633 8 50   8 1 1911 my $raw = defined $_[0]->{asup} ? $_[0]->{asup} : $_[0];
2634 8         18 my $trim = '';
2635 8 100       5845 if ( $raw =~ /(===== SYSCONFIG HARDWARE IDS =====.*?)=====/s ) {
2636 7         27 $trim = $1;
2637 7         42 while ( $trim !~ /\n\n$/s ) { $trim .= "\n"; }
  0         0  
2638             }
2639 8         16 undef($raw);
2640 8         27 return $trim;
2641             }
2642              
2643             =head3 extract_sysconfig_m()
2644              
2645             =cut
2646              
2647             sub extract_sysconfig_m {
2648 8 50   8 1 356 my $raw = defined $_[0]->{asup} ? $_[0]->{asup} : $_[0];
2649 8         12 my $trim = '';
2650 8 100       6236 if ( $raw =~ /(===== SYSCONFIG-M =====.*?)=====/s ) {
2651 3         32 $trim = $1;
2652 3         21 while ( $trim !~ /\n\n$/s ) { $trim .= "\n"; }
  0         0  
2653             }
2654 8         20 undef($raw);
2655 8         41 return $trim;
2656             }
2657              
2658             =head3 extract_sysconfig_r()
2659              
2660             =cut
2661              
2662             sub extract_sysconfig_r {
2663 8 50   8 1 1585 my $raw = defined $_[0]->{asup} ? $_[0]->{asup} : $_[0];
2664 8         16 my $trim = '';
2665 8 100       4392 if ( $raw =~ /(===== SYSCONFIG-R =====.*?)=====/s ) {
2666 7         60 $trim = $1;
2667 7         39 while ( $trim !~ /\n\n$/s ) { $trim .= "\n"; }
  0         0  
2668             }
2669 8         16 undef($raw);
2670 8         29 return $trim;
2671             }
2672              
2673             =head3 extract_system_serial_number()
2674              
2675             =cut
2676              
2677             sub extract_system_serial_number {
2678 8 50   8 1 1660 my $raw = defined $_[0]->{asup} ? $_[0]->{asup} : $_[0];
2679 8         15 my $trim = '';
2680 8 100       4382 if ( $raw =~ /(===== SYSTEM SERIAL NUMBER =====.*?)=====/s ) {
2681 7         22 $trim = $1;
2682 7         48 while ( $trim !~ /\n\n$/s ) { $trim .= "\n"; }
  0         0  
2683             }
2684 8         42 undef($raw);
2685 8         32 return $trim;
2686             }
2687              
2688             =head3 extract_unowned_disks()
2689              
2690             =cut
2691              
2692             sub extract_unowned_disks {
2693 8 50   8 1 1778 my $raw = defined $_[0]->{asup} ? $_[0]->{asup} : $_[0];
2694 8         14 my $trim = '';
2695 8 50       8795 if ( $raw =~ /(===== UNOWNED-DISKS =====.*?)=====/s ) {
2696 0         0 $trim = $1;
2697 0         0 while ( $trim !~ /\n\n$/s ) { $trim .= "\n"; }
  0         0  
2698             }
2699 8         23 undef($raw);
2700 8         47 return $trim;
2701             }
2702              
2703             =head3 extract_usage()
2704              
2705             =cut
2706              
2707             sub extract_usage {
2708 8 50   8 1 1736 my $raw = defined $_[0]->{asup} ? $_[0]->{asup} : $_[0];
2709 8         19 my $trim = '';
2710 8 100       5203 if ( $raw =~ /(===== USAGE =====.*?)=====/s ) {
2711 7         49 $trim = $1;
2712 7         48 while ( $trim !~ /\n\n$/s ) { $trim .= "\n"; }
  0         0  
2713             }
2714 8         20 undef($raw);
2715 8         25 return $trim;
2716             }
2717              
2718             =head3 extract_usermap_cfg()
2719              
2720             =cut
2721              
2722             sub extract_usermap_cfg {
2723 8 50   8 1 1697 my $raw = defined $_[0]->{asup} ? $_[0]->{asup} : $_[0];
2724 8         16 my $trim = '';
2725 8 50       8757 if ( $raw =~ /(===== USERMAP-CFG =====.*?)=====/s ) {
2726 0         0 $trim = $1;
2727 0         0 while ( $trim !~ /\n\n$/s ) { $trim .= "\n"; }
  0         0  
2728             }
2729 8         22 undef($raw);
2730 8         51 return $trim;
2731             }
2732              
2733             =head3 extract_vfiler_startup_times()
2734              
2735             =cut
2736              
2737             sub extract_vfiler_startup_times {
2738 8 50   8 1 1751 my $raw = defined $_[0]->{asup} ? $_[0]->{asup} : $_[0];
2739 8         14 my $trim = '';
2740 8 50       15691 if ( $raw =~ /(===== VFILER STARTUP TIMES =====.*?)=====/s ) {
2741 0         0 $trim = $1;
2742 0         0 while ( $trim !~ /\n\n$/s ) { $trim .= "\n"; }
  0         0  
2743             }
2744 8         27 undef($raw);
2745 8         58 return $trim;
2746             }
2747              
2748             =head3 extract_vfilers()
2749              
2750             =cut
2751              
2752             sub extract_vfilers {
2753 8 50   8 1 2056 my $raw = defined $_[0]->{asup} ? $_[0]->{asup} : $_[0];
2754 8         16 my $trim = '';
2755 8 50       23082 if ( $raw =~ /(===== VFILERS =====.*?)=====/s ) {
2756 0         0 $trim = $1;
2757 0         0 while ( $trim !~ /\n\n$/s ) { $trim .= "\n"; }
  0         0  
2758             }
2759 8         30 undef($raw);
2760 8         52 return $trim;
2761             }
2762              
2763             =head3 extract_vif_status()
2764              
2765             =cut
2766              
2767             sub extract_vif_status {
2768 8 50   8 1 1669 my $raw = defined $_[0]->{asup} ? $_[0]->{asup} : $_[0];
2769 8         14 my $trim = '';
2770 8 100       4607 if ( $raw =~ /(===== VIF-STATUS =====.*?)=====/s ) {
2771 7         43 $trim = $1;
2772 7         46 while ( $trim !~ /\n\n$/s ) { $trim .= "\n"; }
  0         0  
2773             }
2774 8         52 undef($raw);
2775 8         27 return $trim;
2776             }
2777              
2778             =head3 extract_vlan_stat()
2779              
2780             =cut
2781              
2782             sub extract_vlan_stat {
2783 8 50   8 1 2512 my $raw = defined $_[0]->{asup} ? $_[0]->{asup} : $_[0];
2784 8         16 my $trim = '';
2785 8 100       8822 if ( $raw =~ /(===== VLAN STAT =====.*?)=====/s ) {
2786 7         31 $trim = $1;
2787 7         54 while ( $trim !~ /\n\n$/s ) { $trim .= "\n"; }
  0         0  
2788             }
2789 8         19 undef($raw);
2790 8         40 return $trim;
2791             }
2792              
2793             =head3 extract_vol_language()
2794              
2795             =cut
2796              
2797             sub extract_vol_language {
2798 8 50   8 1 1716 my $raw = defined $_[0]->{asup} ? $_[0]->{asup} : $_[0];
2799 8         18 my $trim = '';
2800 8 100       4622 if ( $raw =~ /(===== VOL-LANGUAGE =====.*?)=====/s ) {
2801 7         33 $trim = $1;
2802 7         43 while ( $trim !~ /\n\n$/s ) { $trim .= "\n"; }
  0         0  
2803             }
2804 8         20 undef($raw);
2805 8         28 return $trim;
2806             }
2807              
2808             =head3 extract_vol_status()
2809              
2810             =cut
2811              
2812             sub extract_vol_status {
2813 8 50   8 1 1416 my $raw = defined $_[0]->{asup} ? $_[0]->{asup} : $_[0];
2814 8         19 my $trim = '';
2815 8 100       5086 if ( $raw =~ /(===== VOL-STATUS =====.*?)=====/s ) {
2816 7         123 $trim = $1;
2817 7         51 while ( $trim !~ /\n\n$/s ) { $trim .= "\n"; }
  0         0  
2818             }
2819 8         18 undef($raw);
2820 8         34 return $trim;
2821             }
2822              
2823             =head3 extract_vscan()
2824              
2825             =cut
2826              
2827             sub extract_vscan {
2828 8 50   8 1 300 my $raw = defined $_[0]->{asup} ? $_[0]->{asup} : $_[0];
2829 8         16 my $trim = '';
2830 8 100       5383 if ( $raw =~ /(===== VSCAN =====.*?)=====/s ) {
2831 7         22 $trim = $1;
2832 7         42 while ( $trim !~ /\n\n$/s ) { $trim .= "\n"; }
  0         0  
2833             }
2834 8         15 undef($raw);
2835 8         27 return $trim;
2836             }
2837              
2838             =head3 extract_vscan_options()
2839              
2840             =cut
2841              
2842             sub extract_vscan_options {
2843 8 50   8 1 593 my $raw = defined $_[0]->{asup} ? $_[0]->{asup} : $_[0];
2844 8         251 my $trim = '';
2845 8 100       11339 if ( $raw =~ /(===== VSCAN OPTIONS =====.*?)=====/s ) {
2846 7         32 $trim = $1;
2847 7         58 while ( $trim !~ /\n\n$/s ) { $trim .= "\n"; }
  0         0  
2848             }
2849 8         19 undef($raw);
2850 8         33 return $trim;
2851             }
2852              
2853             =head3 extract_vscan_scanners()
2854              
2855             =cut
2856              
2857             sub extract_vscan_scanners {
2858 8 50   8 1 1551 my $raw = defined $_[0]->{asup} ? $_[0]->{asup} : $_[0];
2859 8         15 my $trim = '';
2860 8 100       5185 if ( $raw =~ /(===== VSCAN SCANNERS =====.*?)=====/s ) {
2861 7         24 $trim = $1;
2862 7         40 while ( $trim !~ /\n\n$/s ) { $trim .= "\n"; }
  0         0  
2863             }
2864 8         19 undef($raw);
2865 8         26 return $trim;
2866             }
2867              
2868             =head3 extract_xheader()
2869              
2870             =cut
2871              
2872             sub extract_xheader {
2873 8 50   8 1 3604 my $raw = defined $_[0]->{asup} ? $_[0]->{asup} : $_[0];
2874            
2875             # v7
2876 8 100       7343 if ( $raw =~ /(===== X-HEADER DATA =====.*?)(=====|\n\n)/s ) {
2877 7         41 my $trim = $1;
2878 7         116 while ( $trim !~ /\n\n$/s ) { $trim .= "\n"; }
  14         77  
2879 7         103 return $trim;
2880             }
2881              
2882             # v8
2883              
2884 1         6 my @lines = Parse::NetApp::ASUP::_agnostic_line_split($raw);
2885 1         6067 my @trim;
2886            
2887 1   33     40 while ( @lines and $lines[0] !~ /^GENERATED_ON/ ) {
2888 0         0 shift @lines; # Skip the mail header, to avoid confusion
2889             }
2890 1         5 while ( @lines ) {
2891 61762         84696 my $line = shift @lines;
2892 61762 50       167406 push @trim, $line if $line =~ /^X-Netapp-asup-/;
2893             }
2894            
2895 1 50       6 return join("\n",@trim) . "\n" if scalar(@trim);
2896              
2897             # give up
2898 1         9 return '';
2899             }
2900              
2901             1;
2902              
2903             =head1 BUGS AND SOURCE
2904              
2905             Bug tracking for this module: https://rt.cpan.org/Dist/Display.html?Name=Parse-NetApp-ASUP
2906              
2907             Source hosting: http://www.github.com/bennie/perl-Parse-NetApp-ASUP
2908              
2909             =head1 VERSION
2910              
2911             Parse::NetApp::ASUP v1.17 (2014/04/28)
2912              
2913             =head1 COPYRIGHT
2914              
2915             (c) 2012-2014, Phillip Pollard
2916              
2917             =head1 LICENSE
2918              
2919             This source code is released under the "Perl Artistic License 2.0," the text of
2920             which is included in the LICENSE file of this distribution. It may also be
2921             reviewed here: http://opensource.org/licenses/artistic-license-2.0