line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Net::SecurityCenter::API::System; |
2
|
|
|
|
|
|
|
|
3
|
2
|
|
|
2
|
|
890
|
use warnings; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
68
|
|
4
|
2
|
|
|
2
|
|
12
|
use strict; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
43
|
|
5
|
|
|
|
|
|
|
|
6
|
2
|
|
|
2
|
|
12
|
use parent 'Net::SecurityCenter::Base'; |
|
2
|
|
|
|
|
14
|
|
|
2
|
|
|
|
|
13
|
|
7
|
|
|
|
|
|
|
|
8
|
2
|
|
|
2
|
|
137
|
use Net::SecurityCenter::Utils qw(:all); |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
1855
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
our $VERSION = '0.300'; |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
#------------------------------------------------------------------------------- |
13
|
|
|
|
|
|
|
# METHODS |
14
|
|
|
|
|
|
|
#------------------------------------------------------------------------------- |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
sub get_status { |
17
|
|
|
|
|
|
|
|
18
|
0
|
|
|
0
|
1
|
0
|
my ( $self, %args ) = @_; |
19
|
|
|
|
|
|
|
|
20
|
0
|
|
|
|
|
0
|
deprecated |
21
|
|
|
|
|
|
|
'"Net::SecurityCenter::API::System->get_status" is DEPRECATED use "Net::SecurityCenter::API::Status->status" instead'; |
22
|
|
|
|
|
|
|
|
23
|
0
|
|
|
|
|
0
|
return; |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
} |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
#------------------------------------------------------------------------------- |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
sub get_info { |
30
|
|
|
|
|
|
|
|
31
|
0
|
|
|
0
|
1
|
0
|
my ( $self, %args ) = @_; |
32
|
|
|
|
|
|
|
|
33
|
0
|
|
|
|
|
0
|
deprecated |
34
|
|
|
|
|
|
|
'"Net::SecurityCenter::API::Status->get_info" is DEPRECATED use "Net::SecurityCenter::API::Status->info"'; |
35
|
|
|
|
|
|
|
|
36
|
0
|
|
|
|
|
0
|
return $self->info( \%args ); |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
} |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
#------------------------------------------------------------------------------- |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
sub info { |
43
|
|
|
|
|
|
|
|
44
|
1
|
|
|
1
|
1
|
4
|
my ( $self, %args ) = @_; |
45
|
|
|
|
|
|
|
|
46
|
1
|
|
|
|
|
4
|
my $tmpl = { raw => {}, }; |
47
|
|
|
|
|
|
|
|
48
|
1
|
|
|
|
|
6
|
my $params = sc_check_params( $tmpl, \%args ); |
49
|
1
|
|
|
|
|
3
|
my $raw = delete( $params->{'raw'} ); |
50
|
1
|
|
|
|
|
13
|
my $info = $self->client->get('/system'); |
51
|
|
|
|
|
|
|
|
52
|
1
|
50
|
|
|
|
6
|
return if ( !$info ); |
53
|
1
|
50
|
|
|
|
5
|
return $info if ($raw); |
54
|
|
|
|
|
|
|
|
55
|
1
|
|
|
|
|
6
|
return sc_normalize_hash($info); |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
} |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
#------------------------------------------------------------------------------- |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
sub debug { |
62
|
|
|
|
|
|
|
|
63
|
3
|
|
|
3
|
1
|
10
|
my ( $self, %args ) = @_; |
64
|
|
|
|
|
|
|
|
65
|
3
|
|
|
|
|
14
|
my $tmpl = { name => {}, id => {}, category => {} }; |
66
|
|
|
|
|
|
|
|
67
|
3
|
|
|
|
|
13
|
my $params = sc_check_params( $tmpl, \%args ); |
68
|
3
|
|
|
|
|
8
|
my $id = delete( $params->{'id'} ); |
69
|
3
|
|
|
|
|
5
|
my $name = delete( $params->{'name'} ); |
70
|
3
|
|
|
|
|
6
|
my $category = delete( $params->{'category'} ); |
71
|
3
|
|
|
|
|
14
|
my $debug = $self->client->get('/system/debug'); |
72
|
|
|
|
|
|
|
|
73
|
3
|
50
|
|
|
|
18
|
return if ( !$debug ); |
74
|
|
|
|
|
|
|
|
75
|
3
|
|
|
|
|
7
|
my $id_results = {}; |
76
|
3
|
|
|
|
|
8
|
my $name_results = {}; |
77
|
3
|
|
|
|
|
5
|
my $category_results = {}; |
78
|
|
|
|
|
|
|
|
79
|
3
|
|
|
|
|
6
|
foreach my $item ( @{$debug} ) { |
|
3
|
|
|
|
|
10
|
|
80
|
|
|
|
|
|
|
|
81
|
216
|
|
|
|
|
435
|
$id_results->{ $item->{id} } = $item; |
82
|
216
|
|
|
|
|
475
|
$name_results->{ $item->{name} } = $item; |
83
|
|
|
|
|
|
|
|
84
|
216
|
100
|
|
|
|
408
|
if ( !defined( $category_results->{ $item->{category} } ) ) { |
85
|
9
|
|
|
|
|
27
|
$category_results->{ $item->{category} } = (); |
86
|
|
|
|
|
|
|
} |
87
|
|
|
|
|
|
|
|
88
|
216
|
|
|
|
|
283
|
push @{ $category_results->{ $item->{category} } }, $item; |
|
216
|
|
|
|
|
415
|
|
89
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
} |
91
|
|
|
|
|
|
|
|
92
|
3
|
50
|
|
|
|
12
|
if ($name) { |
93
|
0
|
|
|
|
|
0
|
return $name_results->{$name}; |
94
|
|
|
|
|
|
|
} |
95
|
|
|
|
|
|
|
|
96
|
3
|
100
|
|
|
|
8
|
if ($id) { |
97
|
1
|
|
|
|
|
49
|
return $id_results->{$id}; |
98
|
|
|
|
|
|
|
} |
99
|
|
|
|
|
|
|
|
100
|
2
|
100
|
|
|
|
7
|
if ($category) { |
101
|
1
|
|
|
|
|
42
|
return $category_results->{$category}; |
102
|
|
|
|
|
|
|
} |
103
|
|
|
|
|
|
|
|
104
|
1
|
|
|
|
|
24
|
return $debug; |
105
|
|
|
|
|
|
|
|
106
|
|
|
|
|
|
|
} |
107
|
|
|
|
|
|
|
|
108
|
|
|
|
|
|
|
#------------------------------------------------------------------------------- |
109
|
|
|
|
|
|
|
|
110
|
|
|
|
|
|
|
sub get_diagnostics_info { |
111
|
|
|
|
|
|
|
|
112
|
1
|
|
|
1
|
1
|
5
|
my ( $self, %args ) = @_; |
113
|
|
|
|
|
|
|
|
114
|
1
|
|
|
|
|
4
|
my $tmpl = { raw => {}, }; |
115
|
|
|
|
|
|
|
|
116
|
1
|
|
|
|
|
6
|
my $params = sc_check_params( $tmpl, \%args ); |
117
|
1
|
|
|
|
|
3
|
my $raw = delete( $params->{'raw'} ); |
118
|
1
|
|
|
|
|
6
|
my $info = $self->client->get('/system/diagnostics'); |
119
|
|
|
|
|
|
|
|
120
|
1
|
50
|
|
|
|
6
|
if ( !$info ) { |
121
|
0
|
|
|
|
|
0
|
return; |
122
|
|
|
|
|
|
|
} |
123
|
|
|
|
|
|
|
|
124
|
1
|
50
|
|
|
|
6
|
if ($raw) { |
125
|
0
|
|
|
|
|
0
|
return $info; |
126
|
|
|
|
|
|
|
} |
127
|
|
|
|
|
|
|
|
128
|
1
|
|
|
|
|
7
|
return sc_normalize_hash($info); |
129
|
|
|
|
|
|
|
|
130
|
|
|
|
|
|
|
} |
131
|
|
|
|
|
|
|
|
132
|
|
|
|
|
|
|
#------------------------------------------------------------------------------- |
133
|
|
|
|
|
|
|
|
134
|
|
|
|
|
|
|
sub generate_diagnostics_app_status { |
135
|
|
|
|
|
|
|
|
136
|
0
|
|
|
0
|
1
|
|
my ($self) = @_; |
137
|
0
|
|
|
|
|
|
$self->client->post( '/system/diagnostics/generate', { 'task' => 'appStatus' } ); |
138
|
0
|
|
|
|
|
|
return 1; |
139
|
|
|
|
|
|
|
|
140
|
|
|
|
|
|
|
} |
141
|
|
|
|
|
|
|
|
142
|
|
|
|
|
|
|
#------------------------------------------------------------------------------- |
143
|
|
|
|
|
|
|
|
144
|
|
|
|
|
|
|
sub generate_diagnostics_file { |
145
|
|
|
|
|
|
|
|
146
|
0
|
|
|
0
|
1
|
|
my ( $self, %args ) = @_; |
147
|
|
|
|
|
|
|
|
148
|
0
|
|
|
|
|
|
my $tmpl = { |
149
|
|
|
|
|
|
|
type => { |
150
|
|
|
|
|
|
|
default => ['all'], |
151
|
|
|
|
|
|
|
allow => [ |
152
|
|
|
|
|
|
|
'all', 'apacheLog', 'configuration', 'dependencies', 'dirlist', 'environment', |
153
|
|
|
|
|
|
|
'installLog', 'logs', 'sanitize', 'scans', 'serverConf', 'setup', |
154
|
|
|
|
|
|
|
'sysinfo', 'upgradeLog' |
155
|
|
|
|
|
|
|
] |
156
|
|
|
|
|
|
|
}, |
157
|
|
|
|
|
|
|
}; |
158
|
|
|
|
|
|
|
|
159
|
0
|
|
|
|
|
|
my $params = sc_check_params( $tmpl, \%args ); |
160
|
0
|
|
|
|
|
|
my $options = delete( $params->{'type'} ); |
161
|
|
|
|
|
|
|
|
162
|
|
|
|
|
|
|
return $self->client->post( '/system/diagnostics/generate', |
163
|
0
|
|
|
|
|
|
{ 'task' => 'diagnosticsFile', 'options' => \@{$options} } ); |
|
0
|
|
|
|
|
|
|
164
|
|
|
|
|
|
|
|
165
|
|
|
|
|
|
|
} |
166
|
|
|
|
|
|
|
|
167
|
|
|
|
|
|
|
#------------------------------------------------------------------------------- |
168
|
|
|
|
|
|
|
|
169
|
|
|
|
|
|
|
sub download_diagnostics { |
170
|
|
|
|
|
|
|
|
171
|
0
|
|
|
0
|
1
|
|
my ($self) = @_; |
172
|
0
|
|
|
|
|
|
return $self->client->post('/system/diagnostics/download'); |
173
|
|
|
|
|
|
|
|
174
|
|
|
|
|
|
|
} |
175
|
|
|
|
|
|
|
|
176
|
|
|
|
|
|
|
#------------------------------------------------------------------------------- |
177
|
|
|
|
|
|
|
|
178
|
|
|
|
|
|
|
1; |
179
|
|
|
|
|
|
|
|
180
|
|
|
|
|
|
|
__END__ |