-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlinksysmon-test
executable file
·89 lines (68 loc) · 3.19 KB
/
linksysmon-test
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
#!/usr/bin/perl
# ============================================================================
# Copyright (C) 2002 Michael J. Wohlgemuth. All rights reserved;
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
#
# THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
# INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
# AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
# OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
# ============================================================================
use linksysmon;
my $k;
my $configfile;
if (@ARGV) {
$configfile = shift (@ARGV);
}
else {
$configfile = '/etc/linksysmon.conf';
}
my $linksysmon = new linksysmon($configfile);
print "TrapdPath: ".$linksysmon->TrapdPath()."\n";
print "Logfile: ".$linksysmon->LogFile()."\n";
print "AlternateLogfile: ".$linksysmon->AlternateLogFile()."\n";
print "Delimiter: ".$linksysmon->Delimiter()."\n";
print "ProcessIPChanges: ".$linksysmon->ProcessIPChanges()."\n";
print "IPChangeProgram: ".$linksysmon->IPChangeProgram()."\n";
my $a = $linksysmon->MailTo();
print "MailTo: ".join(', ', @$a)."\n";
print "MailPath: ".$linksysmon->MailPath()."\n";
print "EZPath: ".$linksysmon->EZPath()."\n";
my $h = $linksysmon->EZHost();
my %hash = %$h;
foreach $k (keys(%$h)) {
print "EZHost: $k\n";
print " DNSName: ".$hash{$k}{'DNSName'}."\n";
print " DNSService: ".$hash{$k}{'DNSService'}."\n";
print " Username: ".$hash{$k}{'UserName'}."\n";
print " Password: ".$hash{$k}{'Password'}."\n";
}
print "ReportIgnoreOutbound: ".$linksysmon->ReportIgnoreOutbound()."\n";
print "ReportIgnoreSystem: ".$linksysmon->ReportIgnoreSystem()."\n";
$a = $linksysmon->ReportIgnorePorts();
print "ReportIgnorePorts: ".join(', ', @$a)."\n";
$a = $linksysmon->ReportIgnoreHosts();
print "ReportIgnoreHosts: ".join(', ', @$a)."\n";
print "ReportCountRepeats: ".$linksysmon->ReportCountRepeats()."\n";
$a = $linksysmon->WatchPorts();
print "WatchPorts: ".join(', ', @$a)."\n";
$a = $linksysmon->WatchHosts();
print "WatchHosts: ".join(', ', @$a)."\n";
$a = $linksysmon->WatchIgnorePorts();
print "WatchIgnorePorts: ".join(', ', @$a)."\n";
$a = $linksysmon->WatchIgnoreHosts();
print "WatchIgnoreHosts: ".join(', ', @$a)."\n";
print "WatchProgram: ".$linksysmon->WatchProgram()."\n";
$a = $linksysmon->WatchMailTo();
print "WatchMailTo: ".join(', ', @$a)."\n";
print "WatchTimeOut: ".$linksysmon->WatchTimeOut()."\n";