diff --git a/index.pot b/index.pot index f4a20c7dda..8f8ca875e0 100644 --- a/index.pot +++ b/index.pot @@ -127094,7 +127094,7 @@ msgstr "" #: ../../Documentos/Pandoras/pandorafms_develop/pandora_console/godmode/setup/setup_ehorus.php:87 #: ../../Documentos/COPIA SEG/godmode/setup/setup_ehorus.php:87 #: ../../code/pandorafms/pandora_console/godmode/setup/setup_ehorus.php:87 -msgid "e.g., switch.ehorus.com" +msgid "e.g., portal.ehorus.com" msgstr "" #: ../../Documentos/Pandoras/pandorafms_develop/pandora_console/godmode/setup/setup_ehorus.php:92 diff --git a/pandora_agents/pc/AIX/pandora_agent.conf b/pandora_agents/pc/AIX/pandora_agent.conf index aef55f8e67..0e4014f5e6 100644 --- a/pandora_agents/pc/AIX/pandora_agent.conf +++ b/pandora_agents/pc/AIX/pandora_agent.conf @@ -1,5 +1,5 @@ # Base config file for Pandora FMS agents -# Version 7.0NG.705, AIX version +# Version 7.0NG.707, AIX version # Licensed under GPL license v2, # Copyright (c) 2003-2010 Artica Soluciones Tecnologicas # http://www.pandorafms.com diff --git a/pandora_agents/pc/FreeBSD/pandora_agent.conf b/pandora_agents/pc/FreeBSD/pandora_agent.conf index af531588eb..207efac3a2 100644 --- a/pandora_agents/pc/FreeBSD/pandora_agent.conf +++ b/pandora_agents/pc/FreeBSD/pandora_agent.conf @@ -1,5 +1,5 @@ # Base config file for Pandora FMS agents -# Version 7.0NG.705, FreeBSD Version +# Version 7.0NG.707, FreeBSD Version # Licensed under GPL license v2, # Copyright (c) 2003-2010 Artica Soluciones Tecnologicas # http://www.pandorafms.com diff --git a/pandora_agents/pc/HP-UX/pandora_agent.conf b/pandora_agents/pc/HP-UX/pandora_agent.conf index 67846d2798..f0aeb191e4 100644 --- a/pandora_agents/pc/HP-UX/pandora_agent.conf +++ b/pandora_agents/pc/HP-UX/pandora_agent.conf @@ -1,5 +1,5 @@ # Base config file for Pandora FMS agents -# Version 7.0NG.705, HP-UX Version +# Version 7.0NG.707, HP-UX Version # Licensed under GPL license v2, # Copyright (c) 2003-2009 Artica Soluciones Tecnologicas # http://www.pandorafms.com diff --git a/pandora_agents/pc/Linux/pandora_agent.conf b/pandora_agents/pc/Linux/pandora_agent.conf index b1fc942ef7..d9dec84092 100644 --- a/pandora_agents/pc/Linux/pandora_agent.conf +++ b/pandora_agents/pc/Linux/pandora_agent.conf @@ -1,5 +1,5 @@ # Base config file for Pandora FMS agents -# Version 7.0NG.705, GNU/Linux +# Version 7.0NG.707, GNU/Linux # Licensed under GPL license v2, # Copyright (c) 2003-2009 Artica Soluciones Tecnologicas # http://www.pandorafms.com diff --git a/pandora_agents/pc/NT4/pandora_agent.conf b/pandora_agents/pc/NT4/pandora_agent.conf index d1490e3902..29781cd47c 100644 --- a/pandora_agents/pc/NT4/pandora_agent.conf +++ b/pandora_agents/pc/NT4/pandora_agent.conf @@ -1,5 +1,5 @@ # Base config file for Pandora FMS agents -# Version 7.0NG.705, GNU/Linux +# Version 7.0NG.707, GNU/Linux # Licensed under GPL license v2, # Copyright (c) 2003-2009 Artica Soluciones Tecnologicas # http://www.pandorafms.com diff --git a/pandora_agents/pc/SunOS/pandora_agent.conf b/pandora_agents/pc/SunOS/pandora_agent.conf index 8db5b78a5a..4a0110cbe4 100644 --- a/pandora_agents/pc/SunOS/pandora_agent.conf +++ b/pandora_agents/pc/SunOS/pandora_agent.conf @@ -1,5 +1,5 @@ # Base config file for Pandora FMS agents -# Version 7.0NG.705, Solaris Version +# Version 7.0NG.707, Solaris Version # Licensed under GPL license v2, # Copyright (c) 2003-2009 Artica Soluciones Tecnologicas # http://www.pandorafms.com diff --git a/pandora_agents/pc/Win32/pandora_agent.conf b/pandora_agents/pc/Win32/pandora_agent.conf index 31f05a2abd..515e60a1af 100644 --- a/pandora_agents/pc/Win32/pandora_agent.conf +++ b/pandora_agents/pc/Win32/pandora_agent.conf @@ -1,6 +1,6 @@ # Base config file for Pandora FMS Windows Agent # (c) 2006-2010 Artica Soluciones Tecnologicas -# Version 7.0NG.705 +# Version 7.0NG.707 # This program is Free Software, you can redistribute it and/or modify it # under the terms of the GNU General Public Licence as published by the Free Software diff --git a/pandora_agents/shellscript/aix/pandora_agent.conf b/pandora_agents/shellscript/aix/pandora_agent.conf index 942a2f4274..1d2be693ad 100644 --- a/pandora_agents/shellscript/aix/pandora_agent.conf +++ b/pandora_agents/shellscript/aix/pandora_agent.conf @@ -1,6 +1,6 @@ # Fichero de configuracion base de agentes de Pandora # Base config file for Pandora agents -# Version 7.0NG.705, AIX version +# Version 7.0NG.707, AIX version # General Parameters # ================== diff --git a/pandora_agents/shellscript/bsd-ipso/pandora_agent.conf b/pandora_agents/shellscript/bsd-ipso/pandora_agent.conf index 8677ad5d67..54dca07566 100644 --- a/pandora_agents/shellscript/bsd-ipso/pandora_agent.conf +++ b/pandora_agents/shellscript/bsd-ipso/pandora_agent.conf @@ -1,6 +1,6 @@ # Fichero de configuracion base de agentes de Pandora # Base config file for Pandora agents -# Version 7.0NG.705 +# Version 7.0NG.707 # FreeBSD/IPSO version # Licenced under GPL licence, 2003-2007 Sancho Lerena diff --git a/pandora_agents/shellscript/hp-ux/pandora_agent.conf b/pandora_agents/shellscript/hp-ux/pandora_agent.conf index df0cf2d32c..94f5627291 100644 --- a/pandora_agents/shellscript/hp-ux/pandora_agent.conf +++ b/pandora_agents/shellscript/hp-ux/pandora_agent.conf @@ -1,6 +1,6 @@ # Fichero de configuracion base de agentes de Pandora # Base config file for Pandora agents -# Version 7.0NG.705, HPUX Version +# Version 7.0NG.707, HPUX Version # General Parameters # ================== diff --git a/pandora_agents/shellscript/linux/pandora_agent.conf b/pandora_agents/shellscript/linux/pandora_agent.conf index 51d2bb1af8..23524d4db2 100644 --- a/pandora_agents/shellscript/linux/pandora_agent.conf +++ b/pandora_agents/shellscript/linux/pandora_agent.conf @@ -1,5 +1,5 @@ # Base config file for Pandora FMS agents -# Version 7.0NG.705 +# Version 7.0NG.707 # Licensed under GPL license v2, # (c) 2003-2010 Artica Soluciones Tecnologicas # please visit http://pandora.sourceforge.net diff --git a/pandora_agents/shellscript/mac_osx/pandora_agent.conf b/pandora_agents/shellscript/mac_osx/pandora_agent.conf index f3370b0916..53edc0a423 100644 --- a/pandora_agents/shellscript/mac_osx/pandora_agent.conf +++ b/pandora_agents/shellscript/mac_osx/pandora_agent.conf @@ -1,5 +1,5 @@ # Base config file for Pandora FMS agents -# Version 7.0NG.705 +# Version 7.0NG.707 # Licensed under GPL license v2, # (c) 2003-2009 Artica Soluciones Tecnologicas # please visit http://pandora.sourceforge.net diff --git a/pandora_agents/shellscript/openWRT/pandora_agent.conf b/pandora_agents/shellscript/openWRT/pandora_agent.conf index bf44df9b35..811e4181df 100644 --- a/pandora_agents/shellscript/openWRT/pandora_agent.conf +++ b/pandora_agents/shellscript/openWRT/pandora_agent.conf @@ -1,5 +1,5 @@ # Base config file for Pandora FMS agents -# Version 7.0NG.705 +# Version 7.0NG.707 # Licensed under GPL license v2, # please visit http://pandora.sourceforge.net diff --git a/pandora_agents/shellscript/solaris/pandora_agent.conf b/pandora_agents/shellscript/solaris/pandora_agent.conf index 04933fbf78..f66fa06679 100644 --- a/pandora_agents/shellscript/solaris/pandora_agent.conf +++ b/pandora_agents/shellscript/solaris/pandora_agent.conf @@ -1,6 +1,6 @@ # Fichero de configuracion base de agentes de Pandora # Base config file for Pandora agents -# Version 7.0NG.705, Solaris version +# Version 7.0NG.707, Solaris version # General Parameters # ================== diff --git a/pandora_agents/unix/AIX/pandora_agent.conf b/pandora_agents/unix/AIX/pandora_agent.conf index f566855881..9b5905996f 100644 --- a/pandora_agents/unix/AIX/pandora_agent.conf +++ b/pandora_agents/unix/AIX/pandora_agent.conf @@ -1,5 +1,5 @@ # Base config file for Pandora FMS agents -# Version 7.0NG.705, AIX version +# Version 7.0NG.707, AIX version # Licensed under GPL license v2, # Copyright (c) 2003-2010 Artica Soluciones Tecnologicas # http://www.pandorafms.com diff --git a/pandora_agents/unix/DEBIAN/control b/pandora_agents/unix/DEBIAN/control index da70efb623..5a5e40940b 100644 --- a/pandora_agents/unix/DEBIAN/control +++ b/pandora_agents/unix/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-agent-unix -Version: 7.0NG.705-170621 +Version: 7.0NG.707-170712 Architecture: all Priority: optional Section: admin diff --git a/pandora_agents/unix/DEBIAN/make_deb_package.sh b/pandora_agents/unix/DEBIAN/make_deb_package.sh index 9a7d4db0c9..f709c33a53 100644 --- a/pandora_agents/unix/DEBIAN/make_deb_package.sh +++ b/pandora_agents/unix/DEBIAN/make_deb_package.sh @@ -14,7 +14,7 @@ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -pandora_version="7.0NG.705-170621" +pandora_version="7.0NG.707-170712" echo "Test if you has the tools for to make the packages." whereis dpkg-deb | cut -d":" -f2 | grep dpkg-deb > /dev/null diff --git a/pandora_agents/unix/Darwin/pandora_agent.conf b/pandora_agents/unix/Darwin/pandora_agent.conf index 05d24eb45e..35fbd8c7f8 100644 --- a/pandora_agents/unix/Darwin/pandora_agent.conf +++ b/pandora_agents/unix/Darwin/pandora_agent.conf @@ -1,5 +1,5 @@ # Base config file for Pandora FMS agents -# Version 7.0NG.705, GNU/Linux +# Version 7.0NG.707, GNU/Linux # Licensed under GPL license v2, # Copyright (c) 2003-2012 Artica Soluciones Tecnologicas # http://www.pandorafms.com diff --git a/pandora_agents/unix/FreeBSD/pandora_agent.conf b/pandora_agents/unix/FreeBSD/pandora_agent.conf index 68c96e4ba5..4c1e20f0ff 100644 --- a/pandora_agents/unix/FreeBSD/pandora_agent.conf +++ b/pandora_agents/unix/FreeBSD/pandora_agent.conf @@ -1,5 +1,5 @@ # Base config file for Pandora FMS agents -# Version 7.0NG.705, FreeBSD Version +# Version 7.0NG.707, FreeBSD Version # Licensed under GPL license v2, # Copyright (c) 2003-2016 Artica Soluciones Tecnologicas # http://www.pandorafms.com diff --git a/pandora_agents/unix/HP-UX/pandora_agent.conf b/pandora_agents/unix/HP-UX/pandora_agent.conf index 3ad599e216..522ef2f345 100644 --- a/pandora_agents/unix/HP-UX/pandora_agent.conf +++ b/pandora_agents/unix/HP-UX/pandora_agent.conf @@ -1,5 +1,5 @@ # Base config file for Pandora FMS agents -# Version 7.0NG.705, HP-UX Version +# Version 7.0NG.707, HP-UX Version # Licensed under GPL license v2, # Copyright (c) 2003-2009 Artica Soluciones Tecnologicas # http://www.pandorafms.com diff --git a/pandora_agents/unix/Linux/pandora_agent.conf b/pandora_agents/unix/Linux/pandora_agent.conf index 02baa0729f..86a2f501b2 100644 --- a/pandora_agents/unix/Linux/pandora_agent.conf +++ b/pandora_agents/unix/Linux/pandora_agent.conf @@ -1,5 +1,5 @@ # Base config file for Pandora FMS agents -# Version 7.0NG.705, GNU/Linux +# Version 7.0NG.707, GNU/Linux # Licensed under GPL license v2, # Copyright (c) 2003-2014 Artica Soluciones Tecnologicas # http://www.pandorafms.com diff --git a/pandora_agents/unix/NT4/pandora_agent.conf b/pandora_agents/unix/NT4/pandora_agent.conf index 5872b70e91..d2feeff65c 100644 --- a/pandora_agents/unix/NT4/pandora_agent.conf +++ b/pandora_agents/unix/NT4/pandora_agent.conf @@ -1,5 +1,5 @@ # Base config file for Pandora FMS agents -# Version 7.0NG.705, GNU/Linux +# Version 7.0NG.707, GNU/Linux # Licensed under GPL license v2, # Copyright (c) 2003-2009 Artica Soluciones Tecnologicas # http://www.pandorafms.com diff --git a/pandora_agents/unix/NetBSD/pandora_agent.conf b/pandora_agents/unix/NetBSD/pandora_agent.conf index 26d63448ce..ef6a51d6d2 100644 --- a/pandora_agents/unix/NetBSD/pandora_agent.conf +++ b/pandora_agents/unix/NetBSD/pandora_agent.conf @@ -1,5 +1,5 @@ # Base config file for Pandora FMS agents -# Version 7.0NG.705, NetBSD Version +# Version 7.0NG.707, NetBSD Version # Licensed under GPL license v2, # Copyright (c) 2003-2010 Artica Soluciones Tecnologicas # http://www.pandorafms.com diff --git a/pandora_agents/unix/SunOS/pandora_agent.conf b/pandora_agents/unix/SunOS/pandora_agent.conf index 11911ed676..d642c6d314 100644 --- a/pandora_agents/unix/SunOS/pandora_agent.conf +++ b/pandora_agents/unix/SunOS/pandora_agent.conf @@ -1,5 +1,5 @@ # Base config file for Pandora FMS agents -# Version 7.0NG.705, Solaris Version +# Version 7.0NG.707, Solaris Version # Licensed under GPL license v2, # Copyright (c) 2003-2009 Artica Soluciones Tecnologicas # http://www.pandorafms.com diff --git a/pandora_agents/unix/pandora_agent b/pandora_agents/unix/pandora_agent index 812a6c09cf..b3d9589d86 100755 --- a/pandora_agents/unix/pandora_agent +++ b/pandora_agents/unix/pandora_agent @@ -40,8 +40,8 @@ my $Sem = undef; # Semaphore used to control the number of threads my $ThreadSem = undef; -use constant AGENT_VERSION => '7.0NG.705'; -use constant AGENT_BUILD => '170621'; +use constant AGENT_VERSION => '7.0NG.707'; +use constant AGENT_BUILD => '170712'; # Agent log default file size maximum and instances use constant DEFAULT_MAX_LOG_SIZE => 600000; diff --git a/pandora_agents/unix/pandora_agent.redhat.spec b/pandora_agents/unix/pandora_agent.redhat.spec index e4830bb0b5..5f1424b747 100644 --- a/pandora_agents/unix/pandora_agent.redhat.spec +++ b/pandora_agents/unix/pandora_agent.redhat.spec @@ -2,8 +2,8 @@ #Pandora FMS Linux Agent # %define name pandorafms_agent_unix -%define version 7.0NG.705 -%define release 170621 +%define version 7.0NG.707 +%define release 170712 Summary: Pandora FMS Linux agent, PERL version Name: %{name} diff --git a/pandora_agents/unix/pandora_agent.spec b/pandora_agents/unix/pandora_agent.spec index 8176f010c7..2faa837177 100644 --- a/pandora_agents/unix/pandora_agent.spec +++ b/pandora_agents/unix/pandora_agent.spec @@ -2,8 +2,8 @@ #Pandora FMS Linux Agent # %define name pandorafms_agent_unix -%define version 7.0NG.705 -%define release 170621 +%define version 7.0NG.707 +%define release 170712 Summary: Pandora FMS Linux agent, PERL version Name: %{name} diff --git a/pandora_agents/unix/pandora_agent_installer b/pandora_agents/unix/pandora_agent_installer index 0a49363d92..a553144ea0 100755 --- a/pandora_agents/unix/pandora_agent_installer +++ b/pandora_agents/unix/pandora_agent_installer @@ -9,8 +9,8 @@ # Please see http://www.pandorafms.org. This code is licensed under GPL 2.0 license. # ********************************************************************** -PI_VERSION="7.0NG.705" -PI_BUILD="170621" +PI_VERSION="7.0NG.707" +PI_BUILD="170712" OS_NAME=`uname -s` FORCE=0 diff --git a/pandora_agents/unix/pandora_revent b/pandora_agents/unix/pandora_revent index 29e032d9cf..3af581decb 100755 --- a/pandora_agents/unix/pandora_revent +++ b/pandora_agents/unix/pandora_revent @@ -1,17 +1,20 @@ #!/usr/bin/perl -############################################################################### +######################################################################## # Pandora FMS - Remote Event Tool (via WEB API) -############################################################################### +######################################################################## # Copyright (c) 2013 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 version 2 -############################################################################### +######################################################################## # Includes list use strict; use LWP::Simple; +use MIME::Base64; +use lib '/usr/lib/perl5'; +use PandoraFMS::Tools; # Init tool_api_init(); @@ -19,72 +22,76 @@ tool_api_init(); # Main tool_api_main(); -############################################################################## +######################################################################## # Print a help screen and exit. -############################################################################## +######################################################################## sub help_screen{ print "Options to create event: -\t$0 -p -create event +\t$0 -p -u -create_event Where options:\n - -u - -create_event - -name : Free text - -group : Group ID (use 0 for 'all') - -type : unknown, alert_fired, alert_recovered, alert_ceased - alert_manual_validation, system, error, new_agent - configuration_change, going_unknown, going_down_critical, - going_down_warning, going_up_normal + -u : API credentials separated by comma: ,, + -name : Free text + -group : Group ID (use 0 for 'all') + -agent : Agent ID Optional parameters: - [-agent ] : Agent ID - [-user ] : User comment (use in combination with -comment option) - [-status ] : 0 New, 1 Validated, 2 In process - [-am ] : ID Agent Module linked to event - [-alert ] : ID Alert Module linked to event - [-criticity ] : 0 Maintance, 1 Informative, 2 Normal, - 3 Warning, 4 Crit, 5 Minor, 6 Major + [-status ] : 0 New, 1 Validated, 2 In process + [-user ] : User comment (use in combination with -comment option) + [-type ] : unknown, alert_fired, alert_recovered, alert_ceased + alert_manual_validation, system, error, new_agent + configuration_change, going_unknown, going_down_critical, + going_down_warning, going_up_normal + [-severity ] : 0 Maintance, + 1 Informative, + 2 Normal, + 3 Warning, + 4 Crit, + 5 Minor, + 6 Major + [-am ] : ID Agent Module linked to event + [-alert ] : ID Alert Module linked to event + [-c_instructions ] + [-w_instructions ] + [-u_instructions ] + [-user_comment ] + [-owner_user ] : Use the login name, not the descriptive + [-source ] : (By default 'Pandora') + [-tag ] : Tag (must exist in the system to be imported) + [-custom_data ]: Custom data has to be in JSON format. Example: -custom_data \'{\"test1\" : \"t1\", \"test2\": \"2\"}\' + [-id_extra ] : Id extra + [-agent_name ] : Agent name, Not to be confused with the alias. + [-force_create_agent<0 o 1>]: Force the creation of agent through an event this will create when it is 1. + [-server_id ] : The pandora node server_id\n\n"; - [-comment ] : Free text for comment - [-tag ] : Tag (must exist in the system to be imported) - [-source ] : (By default 'Pandora') - [-c_instructions ] - [-w_instructions ] - [-u_instructions ] - [-owner ] : Use the login name, not the descriptive \n\n"; - - print "Credential/API syntax: \n\n\t"; - print ": API credentials separated by comma: ,,\n\n"; - print "Example of event generation:\n\n"; - - print "\t$0 -p http://192.168.70.160/pandora_console/include/api.php -u pot12,admin,pandora \ -\t-create_event -name \"Sample event executed from commandline\" -group 2 -type \"system\" -agent 2 \ -\t-user \"admin\" -status 0 -am 0 -alert 9 -criticity 3 -comment \"User comments\" -tag \"tags\" \ -\t-source \"Commandline\" -c_instructions \"Critical instructions\" \ -\t-w_instructions \"Warning instructions\" -u_instructions \"Unknown instructions\" -owner \"other\" "; - - print "\n\nOptions to validate event: \n\n\t"; - print "$0 -p -u -validate_event -id \n\n"; - print "Sample of event validation: \n\n\t"; - - print "$0 -p http://localhost/pandora/include/api.php -u pot12,admin,pandora -validate_event -id 234"; - print "\n\n\n"; - exit; + + print "\t./pandora_revent.pl -p http://localhost/pandora_console/include/api.php -u 1234,admin,pandora \ + \t-create_event -name \"SampleEvent\" -group 2 -agent 189 -status 0 -user \"admin\" -type \"system\" \ + \t-severity 3 -am 0 -alert 9 -c_instructions \"Critical instructions\" -w_instructions \"Warning instructions\" \ + \t-u_instructions \"Unknown instructions\" -id_extra \"id extra\" -agent_name \"agent name\" -source \"Commandline\" -tag \"Tags\""; + + print "\n\n\nOptions to validate event: \n\n\t"; + print "$0 -p -u -validate_event -id \n\n"; + print "Sample of event validation: \n\n\t"; + + print "$0 -p http://localhost/pandora/include/api.php -u pot12,admin,pandora -validate_event -id 234"; + print "\n\n\n"; + exit; } ############################################################################## # Init screen ############################################################################## sub tool_api_init () { - - print "\nPandora FMS Remote Event Tool Copyright (c) 2015 Artica ST\n"; + + print "\nPandora FMS Remote Event Tool Copyright (c) 2013-2015 Artica ST\n"; print "This program is Free Software, licensed under the terms of GPL License v2\n"; print "You can download latest versions and documentation at http://www.pandorafms.org\n\n"; - + if ($#ARGV < 0) { help_screen(); } @@ -92,14 +99,14 @@ sub tool_api_init () { if (($ARGV[0] eq '-h') || ($ARGV[0] eq '-help')) { help_screen(); } - + } -############################################################################### -############################################################################### +######################################################################## +######################################################################## # MAIN -############################################################################### -############################################################################### +######################################################################## +######################################################################## sub tool_api_main () { @@ -114,33 +121,37 @@ sub tool_api_main () { my $db_pass; my @db_info; my $id_agent; - my $agent_name; my $id_user = ''; my $status = ''; my $id_agent_module = ''; - my $module_name = ''; my $id_alert_am = ''; - my $criticity = ''; + my $severity = ''; my $user_comment = ''; my $tags = ''; my $source = ''; - my $id_extra = ''; my $critical_instructions = ''; my $warning_instructions = ''; my $unknown_instructions = ''; + my $id_extra = ''; + my $agent_name = ''; + my $force_create_agent = 0; my $owner_user = ''; my $id_event; my $option = $ARGV[4]; my $call_api; - + my $custom_data = ""; + my $server_id = 0; + #~ help or api path (required) if ($ARGV[0] eq '-h') { print "HELP!\n"; help_screen(); - } elsif ($ARGV[0] ne '-p') { + } + elsif ($ARGV[0] ne '-p') { print "[ERROR] Missing API path! Read help info:\n\n"; help_screen (); - } else { + } + else { $api_path = $ARGV[1]; } @@ -152,105 +163,149 @@ sub tool_api_main () { if ($#db_info < 2) { print "[ERROR] Invalid database credentials! Read help info:\n\n"; help_screen(); - } else { + } + else { $api_pass = $db_info[0]; $db_user = $db_info[1]; $db_pass = $db_info[2]; } - } else { + } + else { print "[ERROR] Missing database credentials! Read help info:\n\n"; help_screen (); } if ($ARGV[4] eq '-create_event') { - #~ event name (required) - if ($ARGV[5] ne '-name') { - print "[ERROR] Missing event name! Read help info:\n\n"; - help_screen (); - } else { - $event_name = $ARGV[6]; - } - - #~ id group (required) - if ($ARGV[7] ne '-group') { - print "[ERROR] Missing event group! Read help info:\n\n"; - help_screen (); - } else { - $id_group = $ARGV[8]; - } - - #~ id group (required) - if ($ARGV[9] ne '-type') { - print "[ERROR] Missing event type! Read help info:\n\n"; - help_screen (); - } else { - $event_type = $ARGV[10]; - } - - # -agent_name, -module_name and -extra are not supported by api. Maybe in the future my $i = 0; foreach (@ARGV) { my $line = $_; + + #-----------DEBUG---------------------------- + #print("i " . $i . " line " . $line . "\n"); + if ($line eq '-agent') { - $id_agent = $ARGV[$i+1]; + $id_agent = $ARGV[$i + 1]; } - if ($line eq '-agent_name') { - $agent_name = $ARGV[$i+1]; + if ($line eq '-group') { + $id_group = $ARGV[$i + 1]; + } + if ($line eq '-name') { + $event_name = $ARGV[$i + 1]; + } + if ($line eq '-type') { + $event_type = $ARGV[$i + 1]; } if ($line eq '-user') { - $id_user = $ARGV[$i+1]; + $id_user = $ARGV[$i + 1]; } if ($line eq '-status') { - $status = $ARGV[$i+1]; + $status = $ARGV[$i + 1]; } if ($line eq '-am') { - $id_agent_module = $ARGV[$i+1]; - } - if ($line eq '-module_name') { - $module_name = $ARGV[$i+1]; + $id_agent_module = $ARGV[$i + 1]; } if ($line eq '-alert') { - $id_alert_am = $ARGV[$i+1]; + $id_alert_am = $ARGV[$i + 1]; } - if ($line eq '-criticity') { - $criticity = $ARGV[$i+1]; - } - if ($line eq '-comment') { - $user_comment = $ARGV[$i+1]; + if ($line eq '-severity') { + $severity = $ARGV[$i + 1]; } if ($line eq '-tag') { - $tags = $ARGV[$i+1]; + $tags = $ARGV[$i + 1]; } if ($line eq '-source') { - $source = $ARGV[$i+1]; - } - if ($line eq '-extra') { - $id_extra = $ARGV[$i+1]; + $source = $ARGV[$i + 1]; } if ($line eq '-c_instructions') { - $critical_instructions = $ARGV[$i+1]; + $critical_instructions = $ARGV[$i + 1]; + $critical_instructions = uri_encode($critical_instructions); } if ($line eq '-w_instructions') { - $warning_instructions = $ARGV[$i+1]; + $warning_instructions = $ARGV[$i + 1]; + $warning_instructions = uri_encode($warning_instructions); } if ($line eq '-u_instructions') { - $unknown_instructions = $ARGV[$i+1]; + $unknown_instructions = $ARGV[$i + 1]; + $unknown_instructions = uri_encode($unknown_instructions); } - if ($line eq '-owner') { - $owner_user = $ARGV[$i+1]; + if ($line eq '-id_extra') { + $id_extra = $ARGV[$i + 1]; } + if ($line eq '-agent_name') { + $agent_name = $ARGV[$i + 1]; + } + if ($line eq '-force_create_agent') { + $force_create_agent = $ARGV[$i + 1]; + } + if ($line eq '-user_comment') { + $user_comment = $ARGV[$i + 1]; + } + if ($line eq '-owner_user') { + $owner_user = $ARGV[$i + 1]; + } + if ($line eq '-custom_data') { + $custom_data = $ARGV[$i + 1]; + $custom_data = encode_base64($custom_data, ''); + } + if ($line eq '-server_id') { + $server_id = $ARGV[$i + 1]; + } + $i++; } - $data_event .= $event_name.",".$id_group.",".$id_agent.",".$status.",".$id_user.",".$event_type.",".$criticity.",".$id_agent_module.",".$id_alert_am.",".$critical_instructions.",".$warning_instructions.",".$unknown_instructions.",".$user_comment.",".$owner_user.",".$source.",".$tags.","; - $call_api = $api_path.'?op=set&op2=create_event&id='.$event_name.'&other='.$data_event.'&other_mode=url_encode_separator_,&apipass='.$api_pass.'&user='.$db_user.'&pass='.$db_pass; + if ($event_name eq "") { + print "[ERROR] Missing id agent! Read help info:\n\n"; + help_screen (); + } + if ($id_group eq "") { + print "[ERROR] Missing event group! Read help info:\n\n"; + help_screen (); + } + if ($id_agent eq "" && $agent_name eq "") { + print "[ERROR] Missing id agent! and agent_name Read help info:\n\n"; + help_screen (); + } + + $data_event = $event_name . + "|" . $id_group . + "|" . $id_agent . + "|" . $status . + "|" . $id_user . + "|" . $event_type . + "|" . $severity . + "|" . $id_agent_module . + "|" . $id_alert_am . + "|" . $critical_instructions . + "|" . $warning_instructions . + "|" . $unknown_instructions . + "|" . $user_comment . + "|" . $owner_user . + "|" . $source . + "|" . $tags . + "|" . $custom_data . + "|" . $server_id . + "|" . $id_extra . + "|" . $agent_name . + "|" . $force_create_agent; - } elsif ($ARGV[4] eq '-validate_event') { - #~ id event(required) + $call_api = $api_path . '?' . + 'op=set&' . + 'op2=create_event&' . + 'other=' . $data_event .'&' . + 'other_mode=url_encode_separator_|&' . + 'apipass=' . $api_pass . '&' . + 'user=' . $db_user . '&' . + 'pass=' . $db_pass; + + } + elsif ($ARGV[4] eq '-validate_event') { + #~ id event(required) if ($ARGV[5] ne '-id') { print "[ERROR] Missing id event! Read help info:\n\n"; help_screen (); - } else { + } + else { $id_event = $ARGV[6]; } @@ -258,8 +313,8 @@ sub tool_api_main () { } my @args = @ARGV; - my $ltotal=$#args; - + my $ltotal=$#args; + if ($ltotal < 0) { print "[ERROR] No valid arguments. Read help info:\n\n"; help_screen (); @@ -272,15 +327,17 @@ sub tool_api_main () { if ($content eq undef) { print "[ERROR] Not respond or bad syntax. Read help info:\n\n"; help_screen(); - } else { + } + else { print "Event ID: $content"; } - } elsif ($option eq '-validate_event') { + } + elsif ($option eq '-validate_event') { print "[RESULT] $content"; } } - - print "\nExiting!\n\n"; - - exit; + + print "\nExiting!\n\n"; + + exit; } diff --git a/pandora_agents/win32/bin/pandora_agent.conf b/pandora_agents/win32/bin/pandora_agent.conf index 93ba47c6cf..1ecdcbad3f 100644 --- a/pandora_agents/win32/bin/pandora_agent.conf +++ b/pandora_agents/win32/bin/pandora_agent.conf @@ -1,6 +1,6 @@ # Base config file for Pandora FMS Windows Agent # (c) 2006-2014 Artica Soluciones Tecnologicas -# Version 7.0NG.705 +# Version 7.0NG.707 # This program is Free Software, you can redistribute it and/or modify it # under the terms of the GNU General Public Licence as published by the Free Software diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi index f5b19befab..f31d5a42ad 100644 --- a/pandora_agents/win32/installer/pandora.mpi +++ b/pandora_agents/win32/installer/pandora.mpi @@ -3,7 +3,7 @@ AllowLanguageSelection {Yes} AppName -{Pandora FMS Windows Agent v7.0NG.705} +{Pandora FMS Windows Agent v7.0NG.707} ApplicationID {17E3D2CF-CA02-406B-8A80-9D31C17BD08F} @@ -186,7 +186,7 @@ UpgradeApplicationID {} Version -{170621} +{170712} ViewReadme {Yes} diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc index b41421b081..216e27cd4c 100644 --- a/pandora_agents/win32/pandora.cc +++ b/pandora_agents/win32/pandora.cc @@ -30,7 +30,7 @@ using namespace Pandora; using namespace Pandora_Strutils; #define PATH_SIZE _MAX_PATH+1 -#define PANDORA_VERSION ("7.0NG.705(Build 170621)") +#define PANDORA_VERSION ("7.0NG.707(Build 170712)") string pandora_path; string pandora_dir; diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc index 9ea42f37fe..64a9e83fb9 100644 --- a/pandora_agents/win32/versioninfo.rc +++ b/pandora_agents/win32/versioninfo.rc @@ -11,7 +11,7 @@ BEGIN VALUE "LegalCopyright", "Artica ST" VALUE "OriginalFilename", "PandoraAgent.exe" VALUE "ProductName", "Pandora FMS Windows Agent" - VALUE "ProductVersion", "(7.0NG.705(Build 170621))" + VALUE "ProductVersion", "(7.0NG.707(Build 170712))" VALUE "FileVersion", "1.0.0.0" END END diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control index 711307efa5..8ca248b60e 100644 --- a/pandora_console/DEBIAN/control +++ b/pandora_console/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-console -Version: 7.0NG.705-170621 +Version: 7.0NG.707-170712 Architecture: all Priority: optional Section: admin diff --git a/pandora_console/DEBIAN/make_deb_package.sh b/pandora_console/DEBIAN/make_deb_package.sh index 4b35ed7792..ad4ace1067 100644 --- a/pandora_console/DEBIAN/make_deb_package.sh +++ b/pandora_console/DEBIAN/make_deb_package.sh @@ -14,7 +14,7 @@ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -pandora_version="7.0NG.705-170621" +pandora_version="7.0NG.707-170712" package_pear=0 package_pandora=1 diff --git a/pandora_console/extensions/agents_alerts.php b/pandora_console/extensions/agents_alerts.php index 91dc8a630c..97f1bc7589 100755 --- a/pandora_console/extensions/agents_alerts.php +++ b/pandora_console/extensions/agents_alerts.php @@ -93,7 +93,7 @@ function mainAgentsAlerts() { $groups = users_get_groups (); $filter_groups .= ''.__('Group').''; - $filter_groups .= html_print_select_groups(false, "AR", true, 'group_id', $group_id, false, '', '', true, false, true, '', false , 'width: 100px; margin-right: 10px;; margin-top: 5px;'); + $filter_groups .= html_print_select_groups(false, "AR", true, 'group_id', $group_id, false, '', '', true, false, true, '', false , 'margin-right: 10px; margin-top: 5px;'); $check = ''.__('Show modules without alerts').''; $check .= html_print_checkbox('slides_ids[]', $d['id'], $show_modules, true, false, '', true); diff --git a/pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql b/pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql index 588a68da48..6f146f7ca8 100644 --- a/pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql +++ b/pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql @@ -710,6 +710,7 @@ CREATE TABLE IF NOT EXISTS `treport_content_template` ( `module_names` TEXT, `module_free_text` TEXT, `each_agent` tinyint(1) default 1, + `historical_db` tinyint(1) UNSIGNED NOT NULL default 0, PRIMARY KEY(`id_rc`) ) ENGINE = InnoDB DEFAULT CHARSET=utf8; diff --git a/pandora_console/general/login_page.php b/pandora_console/general/login_page.php index b6098dda01..5e9278a854 100755 --- a/pandora_console/general/login_page.php +++ b/pandora_console/general/login_page.php @@ -72,7 +72,7 @@ echo '
'; echo '
'; echo '
'; - if (PANDORA_ENTERPRISE) { + if (file_exists (ENTERPRISE_DIR . "/load_enterprise.php")) { if(isset ($config['custom_logo'])){ echo 'pandora_console'; } @@ -88,7 +88,7 @@ echo '
'; echo '
    '; echo '
  • docs pandora
  • '; echo '
  • ' . __('Docs') . '
  • '; - if (defined ('PANDORA_ENTERPRISE')) { + if (file_exists (ENTERPRISE_DIR . "/load_enterprise.php")) { echo '
  • support pandora
  • '; } else { echo '
  • support pandora
  • '; @@ -136,7 +136,7 @@ echo '