Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
W
Warden
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Pavel Valach
Warden
Commits
f7331fd4
Commit
f7331fd4
authored
13 years ago
by
Tomáš Plesník
Browse files
Options
Downloads
Patches
Plain Diff
zmena prochazeni vracenych SOAP objektu serverem
parent
493aeec6
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/warden-server/lib/WardenStatus.pm
+17
-25
17 additions, 25 deletions
src/warden-server/lib/WardenStatus.pm
with
17 additions
and
25 deletions
src/warden-server/lib/WardenStatus.pm
+
17
−
25
View file @
f7331fd4
...
@@ -38,7 +38,7 @@ use SOAP::Lite;
...
@@ -38,7 +38,7 @@ use SOAP::Lite;
use
IO::Socket::
SSL
qw(debug1)
;
use
IO::Socket::
SSL
qw(debug1)
;
use
SOAP::Transport::
TCP
use
SOAP::Transport::
TCP
our
$VERSION
=
"
0.
1
";
our
$VERSION
=
"
0.
2
";
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
# errMsg - print error message and die
# errMsg - print error message and die
...
@@ -109,18 +109,16 @@ sub getClients
...
@@ -109,18 +109,16 @@ sub getClients
my
$conf_file
=
$etcdir
.
"
warden-client.conf
";
my
$conf_file
=
$etcdir
.
"
warden-client.conf
";
my
(
$uri
,
$ssl_key_file
,
$ssl_cert_file
,
$ssl_ca_file
)
=
WardenConf::
loadConf
(
$conf_file
);
my
(
$uri
,
$ssl_key_file
,
$ssl_cert_file
,
$ssl_ca_file
)
=
WardenConf::
loadConf
(
$conf_file
);
# call server method getClients
my
$response
=
c2s
(
$uri
,
$ssl_key_file
,
$ssl_cert_file
,
$ssl_ca_file
,
"
getClients
");
my
$response
=
c2s
(
$uri
,
$ssl_key_file
,
$ssl_cert_file
,
$ssl_ca_file
,
"
getClients
");
# match getClients functions response
$response
->
match
('
/Envelope/Body/getClientsResponse/
');
my
$i
=
1
;
my
(
$client_id
,
$hostname
,
$registered
,
$requestor
,
$service
,
$client_type
,
$type
,
$receive_own_events
,
$description_tags
,
$ip_net_client
);
my
(
$client_id
,
$hostname
,
$registered
,
$requestor
,
$service
,
$client_type
,
$type
,
$receive_own_events
,
$description_tags
,
$ip_net_client
);
my
@clients
;
my
@clients
;
my
$response_data
=
$response
->
valueof
("
[
$i
]
");
# parse returned data object
# parse returned SOAP data object
while
(
defined
$response_data
)
{
my
@response_list
=
$response
->
valueof
('
/Envelope/Body/getClientsResponse/
');
# inicialization of temporal client array
while
(
scalar
@response_list
)
{
my
$response_data
=
shift
(
@response_list
);
my
@client
;
my
@client
;
# parse items of one client
# parse items of one client
...
@@ -138,10 +136,6 @@ sub getClients
...
@@ -138,10 +136,6 @@ sub getClients
# push received clients from warden server into @clients which is returned
# push received clients from warden server into @clients which is returned
@client
=
("
$client_id
",
"
$hostname
",
"
$registered
",
"
$requestor
",
"
$service
",
"
$client_type
",
"
$type
",
"
$receive_own_events
",
"
$description_tags
",
"
$ip_net_client
");
@client
=
("
$client_id
",
"
$hostname
",
"
$registered
",
"
$requestor
",
"
$service
",
"
$client_type
",
"
$type
",
"
$receive_own_events
",
"
$description_tags
",
"
$ip_net_client
");
push
(
@clients
,
\
@client
);
push
(
@clients
,
\
@client
);
# go to the next received client
$i
++
;
$response_data
=
$response
->
valueof
("
[
$i
]
");
}
}
return
@clients
;
return
@clients
;
}
# End of getClients
}
# End of getClients
...
@@ -162,15 +156,13 @@ sub getStatus
...
@@ -162,15 +156,13 @@ sub getStatus
my
$conf_file
=
$etcdir
.
"
warden-client.conf
";
my
$conf_file
=
$etcdir
.
"
warden-client.conf
";
my
(
$uri
,
$ssl_key_file
,
$ssl_cert_file
,
$ssl_ca_file
)
=
WardenConf::
loadConf
(
$conf_file
);
my
(
$uri
,
$ssl_key_file
,
$ssl_cert_file
,
$ssl_ca_file
)
=
WardenConf::
loadConf
(
$conf_file
);
# call server method getStatus
my
$response
=
c2s
(
$uri
,
$ssl_key_file
,
$ssl_cert_file
,
$ssl_ca_file
,
"
getStatus
");
my
$response
=
c2s
(
$uri
,
$ssl_key_file
,
$ssl_cert_file
,
$ssl_ca_file
,
"
getStatus
");
# match getStatus functions response
# parse returned SOAP data object
$response
->
match
('
/Envelope/Body/getStatusResponse/
');
my
@response_list
=
$response
->
valueof
('
/Envelope/Body/getStatusResponse/
');
my
@status
;
my
$response_data
=
shift
(
@response_list
);
my
$i
=
1
;
# get first value from SOAP data object
my
$response_data
=
$response
->
valueof
("
[
$i
]
");
# parse items of server status
# parse items of server status
my
$version
=
$response_data
->
{'
VERSION
'};
my
$version
=
$response_data
->
{'
VERSION
'};
my
$address
=
$response_data
->
{'
ADDRESS
'};
my
$address
=
$response_data
->
{'
ADDRESS
'};
...
@@ -189,23 +181,23 @@ sub getStatus
...
@@ -189,23 +181,23 @@ sub getStatus
my
$events_last_timestamp
=
$response_data
->
{'
EVENTS_LAST_TIMESTAMP
'};
my
$events_last_timestamp
=
$response_data
->
{'
EVENTS_LAST_TIMESTAMP
'};
my
$clients_sum
=
$response_data
->
{'
CLIENTS_SUM
'};
my
$clients_sum
=
$response_data
->
{'
CLIENTS_SUM
'};
my
@status
;
my
@server_status
=
("
$version
",
"
$address
",
"
$port
",
"
$logdir
",
"
$piddir
",
"
$vardir
",
"
$ssl_key_file_server
",
"
$ssl_cert_file_server
",
"
$ssl_ca_file_server
",
"
$facility
",
"
$db_size
",
"
$events_sum
",
"
$events_last_id
",
"
$events_first_timestamp
",
"
$events_last_timestamp
",
"
$clients_sum
");
my
@server_status
=
("
$version
",
"
$address
",
"
$port
",
"
$logdir
",
"
$piddir
",
"
$vardir
",
"
$ssl_key_file_server
",
"
$ssl_cert_file_server
",
"
$ssl_ca_file_server
",
"
$facility
",
"
$db_size
",
"
$events_sum
",
"
$events_last_id
",
"
$events_first_timestamp
",
"
$events_last_timestamp
",
"
$clients_sum
");
push
(
@status
,
\
@server_status
);
push
(
@status
,
\
@server_status
);
$i
++
;
while
(
scalar
@response_list
)
{
$response_data
=
$response
->
valueof
("
[
$i
]
");
my
$response_data
=
shift
(
@response_list
);
while
(
defined
$response_data
)
{
my
@client_status
;
my
@client_status
;
# parse SOAP data object
# parse item of client status
my
$client_id
=
$response_data
->
{'
CLIENT_ID
'};
my
$client_id
=
$response_data
->
{'
CLIENT_ID
'};
my
$hostname
=
$response_data
->
{'
HOSTNAME
'};
my
$hostname
=
$response_data
->
{'
HOSTNAME
'};
my
$service
=
$response_data
->
{'
SERVICE
'};
my
$service
=
$response_data
->
{'
SERVICE
'};
my
$count
=
$response_data
->
{'
COUNT
'};
my
$count
=
$response_data
->
{'
COUNT
'};
my
$timestamp
=
$response_data
->
{'
TIMESTAMP
'};
my
$timestamp
=
$response_data
->
{'
TIMESTAMP
'};
@client_status
=
("
$client_id
",
"
$hostname
",
"
$service
",
"
$count
",
"
$timestamp
");
@client_status
=
("
$client_id
",
"
$hostname
",
"
$service
",
"
$count
",
"
$timestamp
");
push
(
@status
,
\
@client_status
);
push
(
@status
,
\
@client_status
);
$i
++
;
$response_data
=
$response
->
valueof
("
[
$i
]
");
}
}
return
@status
;
return
@status
;
}
# End of getStatus
}
# End of getStatus
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment