mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-28 16:24:54 +02:00
2009-08-27 Ramon Novoa <rnovoa@artica.es>
* util/tentacle_serverd: Remote config .conf and .md5 files are now stored in different subdirectories. * bin/tentacle_server: Updated to latest version. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1887 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
parent
e192c5eb18
commit
8aa96f1874
@ -1,3 +1,10 @@
|
|||||||
|
2009-08-27 Ramon Novoa <rnovoa@artica.es>
|
||||||
|
|
||||||
|
* util/tentacle_serverd: Remote config .conf and
|
||||||
|
.md5 files are now stored in different subdirectories.
|
||||||
|
|
||||||
|
* bin/tentacle_server: Updated to latest version.
|
||||||
|
|
||||||
2009-08-25 Ramon Novoa <rnovoa@artica.es>
|
2009-08-25 Ramon Novoa <rnovoa@artica.es>
|
||||||
|
|
||||||
* lib/PandoraFMS/Core.pm: Fixed compound alerts.
|
* lib/PandoraFMS/Core.pm: Fixed compound alerts.
|
||||||
|
@ -29,7 +29,7 @@ use Thread::Semaphore;
|
|||||||
use POSIX ":sys_wait_h";
|
use POSIX ":sys_wait_h";
|
||||||
|
|
||||||
# Program version
|
# Program version
|
||||||
our $VERSION = '0.2.0';
|
our $VERSION = '0.2.1';
|
||||||
|
|
||||||
# Address to listen on
|
# Address to listen on
|
||||||
my $t_address = '0.0.0.0';
|
my $t_address = '0.0.0.0';
|
||||||
@ -46,6 +46,9 @@ my $t_daemon = 0;
|
|||||||
# Storage directory
|
# Storage directory
|
||||||
my $t_directory = '';
|
my $t_directory = '';
|
||||||
|
|
||||||
|
# Filters
|
||||||
|
my %t_filters;
|
||||||
|
|
||||||
# String containing quoted invalid file name characters
|
# String containing quoted invalid file name characters
|
||||||
my $t_invalid_chars = '\?\[\]\/\\\=\+\<\>\:\;\'\,\*\~';
|
my $t_invalid_chars = '\?\[\]\/\\\=\+\<\>\:\;\'\,\*\~';
|
||||||
|
|
||||||
@ -115,6 +118,7 @@ sub print_help {
|
|||||||
print ("\t-e cert\t\tOpenSSL certificate file. Enables SSL.\n");
|
print ("\t-e cert\t\tOpenSSL certificate file. Enables SSL.\n");
|
||||||
print ("\t-f ca_cert\tVerify that the peer certificate is signed by a ca.\n");
|
print ("\t-f ca_cert\tVerify that the peer certificate is signed by a ca.\n");
|
||||||
print ("\t-h\t\tShow help.\n");
|
print ("\t-h\t\tShow help.\n");
|
||||||
|
print ("\t-i\t\tFilters.\n");
|
||||||
print ("\t-k key\t\tOpenSSL private key file.\n");
|
print ("\t-k key\t\tOpenSSL private key file.\n");
|
||||||
print ("\t-m size\t\tMaximum file size in bytes (default ${t_max_size}b).\n");
|
print ("\t-m size\t\tMaximum file size in bytes (default ${t_max_size}b).\n");
|
||||||
print ("\t-o\t\tEnable file overwrite.\n");
|
print ("\t-o\t\tEnable file overwrite.\n");
|
||||||
@ -190,7 +194,7 @@ sub parse_options {
|
|||||||
my $tmp;
|
my $tmp;
|
||||||
|
|
||||||
# Get options
|
# Get options
|
||||||
if (getopts ('a:c:de:f:hk:m:op:qr:s:t:vwx:', \%opts) == 0 || defined ($opts{'h'})) {
|
if (getopts ('a:c:de:f:hi:k:m:op:qr:s:t:vwx:', \%opts) == 0 || defined ($opts{'h'})) {
|
||||||
print_help ();
|
print_help ();
|
||||||
exit 1;
|
exit 1;
|
||||||
}
|
}
|
||||||
@ -243,6 +247,21 @@ sub parse_options {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Filters (regexp:dir;regexp:dir...)
|
||||||
|
if (defined ($opts{'i'})) {
|
||||||
|
my @filters = split (';', $opts{'i'});
|
||||||
|
foreach my $filter (@filters) {
|
||||||
|
my ($regexp, $dir) = split (':', $filter);
|
||||||
|
next unless defined ($regexp) && defined ($dir);
|
||||||
|
|
||||||
|
# Remove any trailing /
|
||||||
|
my $char = chop ($dir);
|
||||||
|
$dir .= $char if ($char) ne '/';
|
||||||
|
|
||||||
|
$t_filters{$regexp} = $dir;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
# SSL private key file
|
# SSL private key file
|
||||||
if (defined ($opts{'k'})) {
|
if (defined ($opts{'k'})) {
|
||||||
$t_ssl_key = $opts{'k'};
|
$t_ssl_key = $opts{'k'};
|
||||||
@ -571,7 +590,8 @@ sub recv_file {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
$file = "$t_directory/$base_name";
|
# Apply filters
|
||||||
|
$file = "$t_directory/" . apply_filters ($base_name) . $base_name;
|
||||||
|
|
||||||
# Check if file exists
|
# Check if file exists
|
||||||
if (-f $file && $t_overwrite == 0) {
|
if (-f $file && $t_overwrite == 0) {
|
||||||
@ -613,7 +633,8 @@ sub send_file {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
$file = "$t_directory/$base_name";
|
# Apply filters
|
||||||
|
$file = "$t_directory/" . apply_filters ($base_name) . $base_name;
|
||||||
|
|
||||||
# Check if file exists
|
# Check if file exists
|
||||||
if (! -f $file) {
|
if (! -f $file) {
|
||||||
@ -856,6 +877,23 @@ sub ask_passwd {
|
|||||||
return $pwd1;
|
return $pwd1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
################################################################################
|
||||||
|
## SUB apply_filters
|
||||||
|
## Applies filters to the given file.
|
||||||
|
################################################################################
|
||||||
|
sub apply_filters ($) {
|
||||||
|
my ($file_name) = @_;
|
||||||
|
|
||||||
|
while (my ($regexp, $dir) = each (%t_filters)) {
|
||||||
|
if ($file_name =~ /$regexp/) {
|
||||||
|
print_log ("File '$file_name' matches filter '$regexp' (changing to directory '$dir')");
|
||||||
|
return $dir . '/';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
|
||||||
################################################################################
|
################################################################################
|
||||||
# Main
|
# Main
|
||||||
################################################################################
|
################################################################################
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
# Tentacle server simple startup script
|
# Tentacle server simple startup script
|
||||||
# Copyright (c) 2007 Artica Soluciones Tecnologicas S.L.
|
# Copyright (c) 2007 Artica Soluciones Tecnologicas S.L.
|
||||||
# Linux Version (generic)
|
# Linux Version (generic)
|
||||||
# v0.1 Build 210508
|
# v0.1 Build 090827
|
||||||
|
|
||||||
### BEGIN INIT INTO
|
### BEGIN INIT INTO
|
||||||
# Provides: tentacle_server
|
# Provides: tentacle_server
|
||||||
@ -24,7 +24,7 @@ TENTACLE_USER="pandora"
|
|||||||
|
|
||||||
TENTACLE_ADDR="0.0.0.0"
|
TENTACLE_ADDR="0.0.0.0"
|
||||||
TENTACLE_PORT="41121"
|
TENTACLE_PORT="41121"
|
||||||
TENTACLE_EXT_OPTS=""
|
TENTACLE_EXT_OPTS="-i.*\.conf:conf;.*\.md5:md5"
|
||||||
|
|
||||||
# Set umask to 0002, because group MUST have access to write files to
|
# Set umask to 0002, because group MUST have access to write files to
|
||||||
# use remote file management on Pandora FMS Enterprise.
|
# use remote file management on Pandora FMS Enterprise.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user