Skip to content
Snippets Groups Projects
Commit 66435477 authored by Tomáš Plesník's avatar Tomáš Plesník
Browse files

zmena volani funkce getNewEvents; pridan modul warnings; uprava data

parent f3647413
No related branches found
No related tags found
No related merge requests found
#!/usr/bin/perl -w #!/usr/bin/perl
# #
# Copyright (C) 2011-2013 Cesnet z.s.p.o # Copyright (C) 2011-2015 Cesnet z.s.p.o
# #
# Use of this source is governed by a BSD-style license, see LICENSE file. # Use of this source is governed by a BSD-style license, see LICENSE file.
use strict; use strict;
use warnings;
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# Warden 2.2 Client, Receiver, Example # Warden 2.2 Client, Receiver, Example
...@@ -21,7 +22,7 @@ use strict; ...@@ -21,7 +22,7 @@ use strict;
my $warden_path = '/opt/warden-client/'; my $warden_path = '/opt/warden-client/';
# Inclusion of warden-client receiving functionality # Inclusion of warden-client receiving functionality
require $warden_path . '/lib/WardenClientReceive.pm'; require $warden_path . '/lib/WardenClient.pm';
# Definition of requested event type. This attributes is also set on server # Definition of requested event type. This attributes is also set on server
# and must not change. # and must not change.
...@@ -35,7 +36,7 @@ print "| id | hostname | service | detected | type | source_type | source | targ ...@@ -35,7 +36,7 @@ print "| id | hostname | service | detected | type | source_type | source | targ
print "+------------------------------------------------------------------------------------------------------------------------------------------+\n"; print "+------------------------------------------------------------------------------------------------------------------------------------------+\n";
# Download of new evetns from Warden server # Download of new evetns from Warden server
while (my @new_events = WardenClientReceive::getNewEvents($warden_path, $requested_type)) { while (my @new_events = WardenClient::getNewEvents($requested_type)) {
foreach my $event_ref (@new_events) { foreach my $event_ref (@new_events) {
my @event = @$event_ref; my @event = @$event_ref;
print "| " . join(' | ', map { $_ || '' } @event) . " |" . "\n"; print "| " . join(' | ', map { $_ || '' } @event) . " |" . "\n";
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment