pandorafms/pandora_server/bin/pandora_export

64 lines
2.1 KiB
Perl
Executable File

#!/usr/bin/perl
##########################################################################
# Pandora FMS Export Server
##########################################################################
# Copyright (c) 2008 Sancho Lerena, slerena@gmail.com
# (c) 2008 Artica Soluciones Tecnologicas S.L
# 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; version 2 (only).
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
##########################################################################
# Includes list
use strict;
use warnings;
use Date::Manip; # Needed to manipulate DateTime formats of
# input, output and compare
use Time::Local; # DateTime basic manipulation
use XML::Simple; # Useful XML functions
use Time::Local; # DateTime basic manipulation
use DBI;
# Pandora Modules
use PandoraFMS::Config;
use PandoraFMS::Tools;
use PandoraFMS::DB;
# FLUSH in each IO (only for debug, very slooow)
# ENABLED in DEBUGMODE
# DISABLE FOR PRODUCTION
$| = 0;
my %pa_config;
$SIG{'TERM'} = 'pandora_shutdown';
$SIG{'INT'} = 'pandora_shutdown';
# Inicio del bucle principal de programa
pandora_init(\%pa_config, "Pandora FMS Export Server");
# Read config file for Global variables
pandora_loadconfig (\%pa_config, 7);
# Audit server starting
pandora_audit (\%pa_config, "Pandora FMS Export server starting", "SYSTEM", "System");
# Daemonize and put in background
if ( $pa_config{"daemon"} eq "1" ){
if ($pa_config{"quiet"} eq "0"){
print " [*] Backgrounding Pandora FMS Export Server process.\n\n";
}
&pandora_daemonize ( \%pa_config);
}
die ("There is no more program yet! :-)");