-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest_ssm.pl
56 lines (52 loc) · 1.19 KB
/
test_ssm.pl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#!/usr/local/bin/perl
use strict;
use warnings;
use Carp;
sub POE::Kernel::ASSERT_DEFAULT () { 1 }
#sub POE::Kernel::ASSERT_DATA () { 1 }
sub POE::Kernel::ASSERT_EVENTS () { 1 }
#sub POE::Kernel::ASSERT_FILES () { 1 }
#sub POE::Kernel::ASSERT_RETVALS () { 1 }
#sub POE::Kernel::ASSERT_USAGE () { 1 }
#sub POE::Kernel::TRACE_DEFAULT() { 1 }
#sub POE::Kernel::TRACE_EVENTS() { 1 }
#sub POE::Kernel::TRACE_PROFILE() { 1 }
#sub POE::Kernel::TRACE_SESSIONS() { 1 }
#sub POE::Kernel::TRACE_REFCNT() { 1 }
sub Mole::MSG_DEBUG { 3 }
$Data::Dumper::Maxdepth = Mole::MSG_DEBUG;
use YAML;
use POE;
use Mole;
use Mole::Message;
use Mole::Client;
use Mole::RDBMS;
my $debug = 0;
my $i;
my @ro_ports=(
["password1", 164]
["password2", 161]
);
Mole::RDBMS->spawn("dbi:Oracle:ESM_DEV", "macmon", "password");;
Mole::Client->spawn;
Mole->spawn(\@ro_ports);
##
## Build message to send to Mole
##
my $msg;
my @array;
$msg = Mole::Message->new;
##
## Pack all IPs into a single message
##
while (my $ip = <>) {
chomp $ip;
push(@array, $ip);
}
$msg->dstargs( {ips => \@array} );
##
## Tell the Mole to process message
##
$poe_kernel->post('Mole', 'process', $msg);
$poe_kernel->run();
exit 0;