mirror of
https://github.com/webmin/webmin.git
synced 2025-07-21 23:40:34 +00:00
Participate in install check and logs export
This commit is contained in:
@ -1,6 +1,5 @@
|
||||
# Functions for configuring the fail2ban log analyser
|
||||
#
|
||||
# XXX other .pl files
|
||||
# XXX include in makedist.pl
|
||||
# XXX main help page
|
||||
# XXX help page for filters with description of <HOST> / etc
|
||||
|
18
fail2ban/install_check.pl
Executable file
18
fail2ban/install_check.pl
Executable file
@ -0,0 +1,18 @@
|
||||
# install_check.pl
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
our (%text, %in, %access, %config);
|
||||
do 'fail2ban-lib.pl';
|
||||
|
||||
# is_installed(mode)
|
||||
# For mode 1, returns 2 if the server is installed and configured for use by
|
||||
# Webmin, 1 if installed but not configured, or 0 otherwise.
|
||||
# For mode 0, returns 1 if installed, 0 if not
|
||||
sub is_installed
|
||||
{
|
||||
my ($mode) = @_;
|
||||
my $err = &check_fail2ban();
|
||||
return $err ? 0 : $mode ? 2 : 1;
|
||||
}
|
||||
|
@ -142,3 +142,8 @@ config_logtarget=Write logs to
|
||||
config_syslog=Syslog service
|
||||
config_file=Log file
|
||||
config_default=Default destination
|
||||
|
||||
syslog_logtarget=Fail2Ban action log
|
||||
|
||||
__norefs=1
|
||||
|
||||
|
@ -6,3 +6,4 @@ desc_de=Fail2Ban Intrusionsdetektor
|
||||
longdesc_de=Fail2ban schützt Ihr System vor Brute-Force-Angriffen, indem Quell-IPs blockiert werden.
|
||||
desc_ms_MY=Fail2Ban Pengesan Pencerobohan
|
||||
longdesc_ms_MY=Fail2ban melindungi sistem anda dari serangan kekerasan dengan mengesan mereka dan menyekat IP sumber mereka.
|
||||
syslog=1
|
||||
|
25
fail2ban/syslog_logs.pl
Executable file
25
fail2ban/syslog_logs.pl
Executable file
@ -0,0 +1,25 @@
|
||||
# Contains a function to supply the syslog module with extra logs
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
our (%text, %in, %access, %config);
|
||||
do 'fail2ban-lib.pl';
|
||||
|
||||
# syslog_getlogs()
|
||||
# Returns the Fail2Ban log
|
||||
sub syslog_getlogs
|
||||
{
|
||||
my @rv;
|
||||
my $conf = &get_config();
|
||||
my ($def) = grep { $_->{'name'} eq 'Definition' } @$conf;
|
||||
if ($def) {
|
||||
my $logtarget = &find_value("logtarget", $def);
|
||||
if ($logtarget =~ /^\//) {
|
||||
push(@rv, { 'file' => $logtarget,
|
||||
'desc' => $text{'syslog_logtarget'},
|
||||
'active' => 1 });
|
||||
}
|
||||
}
|
||||
return @rv;
|
||||
}
|
||||
|
Reference in New Issue
Block a user