Merge branch 'develop' into 1489-4737-agente-windows-difiere-en-instalacion-normal-y-silenciosa

Conflicts:
	pandora_agents/win32/bin/pandora_agent.conf
This commit is contained in:
fermin831 2017-11-29 15:49:56 +01:00
commit 11fb91b5c0
310 changed files with 6770 additions and 1670 deletions

View File

@ -1,8 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="EntryPointsManager">
<entry_points version="2.0" />
</component>
<component name="NullableNotNullManager">
<option name="myDefaultNullable" value="android.support.annotation.Nullable" />
<option name="myDefaultNotNull" value="android.support.annotation.NonNull" />
@ -27,17 +24,7 @@
</value>
</option>
</component>
<component name="ProjectLevelVcsManager" settingsEditedManually="false">
<OptionsSetting value="true" id="Add" />
<OptionsSetting value="true" id="Remove" />
<OptionsSetting value="true" id="Checkout" />
<OptionsSetting value="true" id="Update" />
<OptionsSetting value="true" id="Status" />
<OptionsSetting value="true" id="Edit" />
<ConfirmationsSetting value="0" id="Add" />
<ConfirmationsSetting value="0" id="Remove" />
</component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_6" default="true" assert-keyword="true" jdk-15="true" project-jdk-name="JDK" project-jdk-type="JavaSDK">
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_6" default="true" project-jdk-name="JDK" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/build/classes" />
</component>
<component name="ProjectType">

View File

@ -2,7 +2,7 @@ apply plugin: 'com.android.application'
android {
compileSdkVersion 8
buildToolsVersion "25.0.2"
buildToolsVersion "26.0.2"
defaultConfig {
applicationId "pandroid_event_viewer.pandorafms"

View File

@ -159,8 +159,14 @@ public class EventList extends ListActivity {
}
});
ImageButton btnSettings = (ImageButton) findViewById(R.id.settings_icon_button_list);
// Open the settings
btnSettings.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
startActivity(new Intent(v.getContext(), Options.class));
}
});
registerReceiver(onBroadcast, new IntentFilter("eventlist.java"));
this.toggleLoadingLayout();

View File

@ -96,10 +96,29 @@ public class Main extends Activity {
Activity.MODE_PRIVATE);
setContentView(R.layout.main);
final ImageButton btnSettings = (ImageButton) findViewById(R.id.settings_icon_button_main);
final ImageButton btnFilter = (ImageButton) findViewById(R.id.filter_icon_button_main);
final Button buttonSetAsFilterWatcher = (Button) findViewById(R.id.button_set_as_filter_watcher);
final ImageButton buttonSearch = (ImageButton) findViewById(R.id.refresh_icon_button_main);
final ImageButton buttonDeleteProfile = (ImageButton) findViewById(R.id.button_delete_profile);
final ImageButton buttonSaveProfile = (ImageButton) findViewById(R.id.button_save_profile);
// Open the settings
btnSettings.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
startActivity(new Intent(v.getContext(), Options.class));
}
});
// Go to the events list
btnFilter.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
Activity a = (Activity) v.getContext();
TabActivity ta = (TabActivity) a.getParent();
ta.getTabHost().setCurrentTab(1);
}
});
// Check if the user preferences it is set.
if (object.user.length() == 0 || object.password.length() == 0
|| object.url.length() == 0) {

View File

@ -63,8 +63,22 @@
android:layout_weight="0"
android:padding="0dp"
android:src="@drawable/filter_icon_button"
android:background="@null" />
<LinearLayout
android:layout_width="2px"
android:layout_height="fill_parent"
android:background="#6D9624" />
<ImageButton
android:id="@+id/settings_icon_button_list"
android:layout_width="58dp"
android:layout_height="match_parent"
android:layout_weight="0"
android:background="@null"
/>
android:tint="@android:color/white"
android:src="@android:drawable/ic_menu_preferences" />
</LinearLayout>
<LinearLayout

View File

@ -64,6 +64,21 @@
android:background="@null"
android:padding="0dp"
android:src="@drawable/icon_filter_pressed" />
<LinearLayout
android:layout_width="2px"
android:layout_height="fill_parent"
android:background="#6D9624" />
<ImageButton
android:id="@+id/settings_icon_button_main"
android:layout_width="58dp"
android:layout_height="match_parent"
android:layout_weight="0"
android:background="@null"
android:tint="@android:color/white"
android:src="@android:drawable/ic_menu_preferences" />
</LinearLayout>
<LinearLayout

View File

@ -4,7 +4,7 @@ buildscript {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.1'
classpath 'com.android.tools.build:gradle:3.0.0'
}
}

View File

@ -1,6 +1,6 @@
#Tue Apr 18 16:40:24 CEST 2017
#Thu Nov 02 13:39:33 CET 2017
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-3.3-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-all.zip

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents
# Version 7.0NG.714, AIX version
# Version 7.0NG.716, AIX version
# Licensed under GPL license v2,
# Copyright (c) 2003-2010 Artica Soluciones Tecnologicas
# http://www.pandorafms.com

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents
# Version 7.0NG.714, FreeBSD Version
# Version 7.0NG.716, FreeBSD Version
# Licensed under GPL license v2,
# Copyright (c) 2003-2010 Artica Soluciones Tecnologicas
# http://www.pandorafms.com

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents
# Version 7.0NG.714, HP-UX Version
# Version 7.0NG.716, HP-UX Version
# Licensed under GPL license v2,
# Copyright (c) 2003-2009 Artica Soluciones Tecnologicas
# http://www.pandorafms.com

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents
# Version 7.0NG.714, GNU/Linux
# Version 7.0NG.716, GNU/Linux
# Licensed under GPL license v2,
# Copyright (c) 2003-2009 Artica Soluciones Tecnologicas
# http://www.pandorafms.com

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents
# Version 7.0NG.714, GNU/Linux
# Version 7.0NG.716, GNU/Linux
# Licensed under GPL license v2,
# Copyright (c) 2003-2009 Artica Soluciones Tecnologicas
# http://www.pandorafms.com

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents
# Version 7.0NG.714, Solaris Version
# Version 7.0NG.716, Solaris Version
# Licensed under GPL license v2,
# Copyright (c) 2003-2009 Artica Soluciones Tecnologicas
# http://www.pandorafms.com

View File

@ -1,6 +1,6 @@
# Base config file for Pandora FMS Windows Agent
# (c) 2006-2010 Artica Soluciones Tecnologicas
# Version 7.0NG.714
# Version 7.0NG.716
# 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

View File

@ -1,6 +1,6 @@
# Fichero de configuracion base de agentes de Pandora
# Base config file for Pandora agents
# Version 7.0NG.714, AIX version
# Version 7.0NG.716, AIX version
# General Parameters
# ==================

View File

@ -1,6 +1,6 @@
# Fichero de configuracion base de agentes de Pandora
# Base config file for Pandora agents
# Version 7.0NG.714
# Version 7.0NG.716
# FreeBSD/IPSO version
# Licenced under GPL licence, 2003-2007 Sancho Lerena

View File

@ -1,6 +1,6 @@
# Fichero de configuracion base de agentes de Pandora
# Base config file for Pandora agents
# Version 7.0NG.714, HPUX Version
# Version 7.0NG.716, HPUX Version
# General Parameters
# ==================

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents
# Version 7.0NG.714
# Version 7.0NG.716
# Licensed under GPL license v2,
# (c) 2003-2010 Artica Soluciones Tecnologicas
# please visit http://pandora.sourceforge.net

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents
# Version 7.0NG.714
# Version 7.0NG.716
# Licensed under GPL license v2,
# (c) 2003-2009 Artica Soluciones Tecnologicas
# please visit http://pandora.sourceforge.net

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents
# Version 7.0NG.714
# Version 7.0NG.716
# Licensed under GPL license v2,
# please visit http://pandora.sourceforge.net

View File

@ -1,6 +1,6 @@
# Fichero de configuracion base de agentes de Pandora
# Base config file for Pandora agents
# Version 7.0NG.714, Solaris version
# Version 7.0NG.716, Solaris version
# General Parameters
# ==================

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents
# Version 7.0NG.714, AIX version
# Version 7.0NG.716, AIX version
# Licensed under GPL license v2,
# Copyright (c) 2003-2010 Artica Soluciones Tecnologicas
# http://www.pandorafms.com

View File

@ -1,5 +1,5 @@
package: pandorafms-agent-unix
Version: 7.0NG.714-171026
Version: 7.0NG.716-171129
Architecture: all
Priority: optional
Section: admin

View File

@ -14,7 +14,7 @@
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
pandora_version="7.0NG.714-171026"
pandora_version="7.0NG.716-171129"
echo "Test if you has the tools for to make the packages."
whereis dpkg-deb | cut -d":" -f2 | grep dpkg-deb > /dev/null

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents
# Version 7.0NG.714, GNU/Linux
# Version 7.0NG.716, GNU/Linux
# Licensed under GPL license v2,
# Copyright (c) 2003-2012 Artica Soluciones Tecnologicas
# http://www.pandorafms.com

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents
# Version 7.0NG.714, FreeBSD Version
# Version 7.0NG.716, FreeBSD Version
# Licensed under GPL license v2,
# Copyright (c) 2003-2016 Artica Soluciones Tecnologicas
# http://www.pandorafms.com

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents
# Version 7.0NG.714, HP-UX Version
# Version 7.0NG.716, HP-UX Version
# Licensed under GPL license v2,
# Copyright (c) 2003-2009 Artica Soluciones Tecnologicas
# http://www.pandorafms.com

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents
# Version 7.0NG.714, GNU/Linux
# Version 7.0NG.716, GNU/Linux
# Licensed under GPL license v2,
# Copyright (c) 2003-2014 Artica Soluciones Tecnologicas
# http://www.pandorafms.com

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents
# Version 7.0NG.714, GNU/Linux
# Version 7.0NG.716, GNU/Linux
# Licensed under GPL license v2,
# Copyright (c) 2003-2009 Artica Soluciones Tecnologicas
# http://www.pandorafms.com

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents
# Version 7.0NG.714, NetBSD Version
# Version 7.0NG.716, NetBSD Version
# Licensed under GPL license v2,
# Copyright (c) 2003-2010 Artica Soluciones Tecnologicas
# http://www.pandorafms.com

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents
# Version 7.0NG.714, Solaris Version
# Version 7.0NG.716, Solaris Version
# Licensed under GPL license v2,
# Copyright (c) 2003-2009 Artica Soluciones Tecnologicas
# http://www.pandorafms.com

View File

@ -40,8 +40,8 @@ my $Sem = undef;
# Semaphore used to control the number of threads
my $ThreadSem = undef;
use constant AGENT_VERSION => '7.0NG.714';
use constant AGENT_BUILD => '171026';
use constant AGENT_VERSION => '7.0NG.716';
use constant AGENT_BUILD => '171129';
# Agent log default file size maximum and instances
use constant DEFAULT_MAX_LOG_SIZE => 600000;
@ -1244,7 +1244,11 @@ sub check_collections () {
# Delete old collections if there are no broker agents
if ($BrokerEnabled == 0) {
opendir (DIR, "$ConfDir/collections") || return;
if(!opendir (DIR, "$ConfDir/collections")){
log_message ('Collection', "Could not open dir $ConfDir/collections");
return;
}
while (defined (my $file_name = readdir(DIR))) {
next if ($file_name eq '.' || $file_name eq '..');
@ -1252,8 +1256,14 @@ sub check_collections () {
$file_name =~ s/\.md5$//;
if (! defined ($Collections{$file_name})) {
rmrf ("$ConfDir/collections/$file_name");
unlink ("$ConfDir/collections/$file_name.md5");
if(opendir (DIR_check, "$ConfDir/collections/$file_name")){
closedir (DIR_check);
rmrf ("$ConfDir/collections/$file_name");
unlink ("$ConfDir/collections/$file_name.md5");
}
else {
log_message ('Collection', "Could not open dir $ConfDir/collections/$file_name");
}
}
}
closedir (DIR);
@ -1272,7 +1282,11 @@ sub check_collections () {
# Get remote md5
error ("File '$Conf{'temporal'}/$collection_md5_file' already exists as a symlink and could not be removed: $!.") if (-l "$Conf{'temporal'}/$collection_md5_file" && !unlink("$Conf{'temporal'}/$collection_md5_file"));
next unless (recv_file ($collection_md5_file, $Conf{'server_path_md5'}) == 0);
if(recv_file ($collection_md5_file, $Conf{'server_path_md5'}) != 0){
log_message ('Collection', "Could not write $collection_md5_file on " . $Conf{'server_path_md5'});
next;
}
open (MD5_FILE, "< $Conf{'temporal'}/$collection_md5_file") || error ("Could not open file '$Conf{'temporal'}/$collection_md5_file' for reading: $!.");
my $remote_collection_md5 = <MD5_FILE>;
close (MD5_FILE);
@ -1284,13 +1298,20 @@ sub check_collections () {
$local_collection_md5 = <MD5_FILE>;
close MD5_FILE;
}
else{
log_message ('Collection', "Could not open dir $ConfDir/collections/$collection_md5_file");
next;
}
# Check for changes
$local_collection_md5 = $remote_collection_md5 unless defined ($local_collection_md5);
next if ($local_collection_md5 eq $remote_collection_md5);
# Download and unzip
next unless (recv_file ($collection_file, $Conf{'server_path_zip'}) == 0);
if(recv_file ($collection_md5_file, $Conf{'server_path_md5'}) != 0){
log_message ('Collection', "Could not write $collection_file on " . $Conf{'server_path_zip'});
next;
}
rmrf ("$ConfDir/collections/$collection");
`unzip -d "$ConfDir/collections/$collection" "$Conf{'temporal'}/$collection_file" 2>$DevNull`;
unlink ("$Conf{'temporal'}/$collection_file");

View File

@ -2,8 +2,8 @@
#Pandora FMS Linux Agent
#
%define name pandorafms_agent_unix
%define version 7.0NG.714
%define release 171026
%define version 7.0NG.716
%define release 171129
Summary: Pandora FMS Linux agent, PERL version
Name: %{name}

View File

@ -2,8 +2,8 @@
#Pandora FMS Linux Agent
#
%define name pandorafms_agent_unix
%define version 7.0NG.714
%define release 171026
%define version 7.0NG.716
%define release 171129
Summary: Pandora FMS Linux agent, PERL version
Name: %{name}

View File

@ -9,8 +9,8 @@
# Please see http://www.pandorafms.org. This code is licensed under GPL 2.0 license.
# **********************************************************************
PI_VERSION="7.0NG.714"
PI_BUILD="171026"
PI_VERSION="7.0NG.716"
PI_BUILD="171129"
OS_NAME=`uname -s`
FORCE=0

View File

@ -0,0 +1,780 @@
#!/usr/bin/perl
#
# Dynamic route parser
# Combines MTR and Ping features
#
#
use strict;
use warnings;
use POSIX qw(strftime);
use Scalar::Util qw(looks_like_number);
use Socket;
my $HELP=<<EO_HELP;
Pandora FMS plugin for route parse
Usage: $0 -t target [options]
OPTIONS
-c n number of tests (n)
--no-ping 1 disable ping mode
--no-mtr 1 disable mtr mode
-s 1 symmetric routing (1) *default
asymmetric routing (0)
*Warning* in ping mode, the maximum number of steps detected is 9
EO_HELP
################################################################################
# Imported methods
################################################################################
################################################################################
# Mix hashses
################################################################################
sub merge_hashes {
my $_h1 = shift;
my $_h2 = shift;
my %ret = (%{$_h1}, %{$_h2});
return \%ret;
}
################################################################################
# Check if a value is in an array
################################################################################
sub in_array($$){
my ($array, $value) = @_;
if (empty($value)) {
return 0;
}
my %params = map { $_ => 1 } @{$array};
if (exists($params{$value})) {
return 1;
}
return 0;
}
################################################################################
# Check if a given variable contents a number
################################################################################
sub to_number($) {
my $n = shift;
if(empty($n)) {
return undef;
}
if ($n =~ /[\d+,]*\d+\.\d+/) {
# American notation
$n =~ s/,//g;
}
elsif ($n =~ /[\d+\.]*\d+,\d+/) {
# Spanish notation
$n =~ s/\.//g;
$n =~ s/,/./g;
}
if(looks_like_number($n)) {
return $n;
}
return undef;
}
################################################################################
# Erase blank spaces before and after the string
################################################################################
sub trim($){
my $string = shift;
if (empty ($string)){
return "";
}
$string =~ s/\r//g;
chomp ($string);
$string =~ s/^\s+//g;
$string =~ s/\s+$//g;
return $string;
}
################################################################################
# Empty
################################################################################
sub empty($){
my $str = shift;
if (! (defined ($str)) ){
return 1;
}
if(looks_like_number($str)){
return 0;
}
if (ref ($str) eq "ARRAY") {
return (($#{$str}<0)?1:0);
}
if (ref ($str) eq "HASH") {
my @tmp = keys %{$str};
return (($#tmp<0)?1:0);
}
if ($str =~ /^\ *[\n\r]{0,2}\ *$/) {
return 1;
}
return 0;
}
################################################################################
# is Enabled
################################################################################
sub is_enabled($){
my $value = shift;
if ((defined ($value)) && ($value > 0)){
# return true
return 1;
}
#return false
return 0;
}
################################################################################
# print_module
################################################################################
sub print_module ($$;$){
my $config = shift;
my $data = shift;
my $not_print_flag = shift;
if ((ref($data) ne "HASH") || (!defined $data->{name})) {
return undef;
}
my $xml_module = "";
# If not a string type, remove all blank spaces!
if ($data->{type} !~ m/string/){
$data->{value} = trim($data->{value});
}
$data->{tags} = $data->{tags}?$data->{tags}:($config->{MODULE_TAG_LIST}?$config->{MODULE_TAG_LIST}:undef);
$data->{interval} = $data->{interval}?$data->{interval}:($config->{MODULE_INTERVAL}?$config->{MODULE_INTERVAL}:undef);
$data->{module_group} = $data->{module_group}?$data->{module_group}:($config->{MODULE_GROUP}?$config->{MODULE_GROUP}:undef);
# Global instructions (if defined)
$data->{unknown_instructions} = $config->{unknown_instructions} unless (defined($data->{unknown_instructions}) || (!defined($config->{unknown_instructions})));
$data->{warning_instructions} = $config->{warning_instructions} unless (defined($data->{warning_instructions}) || (!defined($config->{warning_instructions})));
$data->{critical_instructions} = $config->{critical_instructions} unless (defined($data->{critical_instructions}) || (!defined($config->{critical_instructions})));
$xml_module .= "<module>\n";
$xml_module .= "\t<name><![CDATA[" . $data->{name} . "]]></name>\n";
$xml_module .= "\t<type>" . $data->{type} . "</type>\n";
if (ref ($data->{value}) eq "ARRAY") {
$xml_module .= "\t<datalist>\n";
foreach (@{$data->{value}}) {
$xml_module .= "\t<data><![CDATA[" . $data->{value} . "]]></data>\n";
}
$xml_module .= "\t</datalist>\n";
}
else {
$xml_module .= "\t<data><![CDATA[" . $data->{value} . "]]></data>\n";
}
if ( !(empty($data->{desc}))) {
$xml_module .= "\t<description><![CDATA[" . $data->{desc} . "]]></description>\n";
}
if ( !(empty ($data->{unit})) ) {
$xml_module .= "\t<unit><![CDATA[" . $data->{unit} . "]]></unit>\n";
}
if (! (empty($data->{interval})) ) {
$xml_module .= "\t<module_interval><![CDATA[" . $data->{interval} . "]]></module_interval>\n";
}
if (! (empty($data->{tags})) ) {
$xml_module .= "\t<tags>" . $data->{tags} . "</tags>\n";
}
if (! (empty($data->{module_group})) ) {
$xml_module .= "\t<module_group>" . $data->{module_group} . "</module_group>\n";
}
if (! (empty($data->{module_parent})) ) {
$xml_module .= "\t<module_parent>" . $data->{module_parent} . "</module_parent>\n";
}
if (! (empty($data->{wmin})) ) {
$xml_module .= "\t<min_warning><![CDATA[" . $data->{wmin} . "]]></min_warning>\n";
}
if (! (empty($data->{wmax})) ) {
$xml_module .= "\t<max_warning><![CDATA[" . $data->{wmax} . "]]></max_warning>\n";
}
if (! (empty ($data->{cmin})) ) {
$xml_module .= "\t<min_critical><![CDATA[" . $data->{cmin} . "]]></min_critical>\n";
}
if (! (empty ($data->{cmax})) ){
$xml_module .= "\t<max_critical><![CDATA[" . $data->{cmax} . "]]></max_critical>\n";
}
if (! (empty ($data->{wstr}))) {
$xml_module .= "\t<str_warning><![CDATA[" . $data->{wstr} . "]]></str_warning>\n";
}
if (! (empty ($data->{cstr}))) {
$xml_module .= "\t<str_critical><![CDATA[" . $data->{cstr} . "]]></str_critical>\n";
}
if (! (empty ($data->{cinv}))) {
$xml_module .= "\t<critical_inverse><![CDATA[" . $data->{cinv} . "]]></critical_inverse>\n";
}
if (! (empty ($data->{winv}))) {
$xml_module .= "\t<warning_inverse><![CDATA[" . $data->{winv} . "]]></warning_inverse>\n";
}
if (! (empty ($data->{max}))) {
$xml_module .= "\t<max><![CDATA[" . $data->{max} . "]]></max>\n";
}
if (! (empty ($data->{min}))) {
$xml_module .= "\t<min><![CDATA[" . $data->{min} . "]]></min>\n";
}
if (! (empty ($data->{post_process}))) {
$xml_module .= "\t<post_process><![CDATA[" . $data->{post_process} . "]]></post_process>\n";
}
if (! (empty ($data->{disabled}))) {
$xml_module .= "\t<disabled><![CDATA[" . $data->{disabled} . "]]></disabled>\n";
}
if (! (empty ($data->{min_ff_event}))) {
$xml_module .= "\t<min_ff_event><![CDATA[" . $data->{min_ff_event} . "]]></min_ff_event>\n";
}
if (! (empty ($data->{status}))) {
$xml_module .= "\t<status><![CDATA[" . $data->{status} . "]]></status>\n";
}
if (! (empty ($data->{timestamp}))) {
$xml_module .= "\t<timestamp><![CDATA[" . $data->{timestamp} . "]]></timestamp>\n";
}
if (! (empty ($data->{custom_id}))) {
$xml_module .= "\t<custom_id><![CDATA[" . $data->{custom_id} . "]]></custom_id>\n";
}
if (! (empty ($data->{critical_instructions}))) {
$xml_module .= "\t<critical_instructions><![CDATA[" . $data->{critical_instructions} . "]]></critical_instructions>\n";
}
if (! (empty ($data->{warning_instructions}))) {
$xml_module .= "\t<warning_instructions><![CDATA[" . $data->{warning_instructions} . "]]></warning_instructions>\n";
}
if (! (empty ($data->{unknown_instructions}))) {
$xml_module .= "\t<unknown_instructions><![CDATA[" . $data->{unknown_instructions} . "]]></unknown_instructions>\n";
}
if (! (empty ($data->{quiet}))) {
$xml_module .= "\t<quiet><![CDATA[" . $data->{quiet} . "]]></quiet>\n";
}
if (! (empty ($data->{module_ff_interval}))) {
$xml_module .= "\t<module_ff_interval><![CDATA[" . $data->{module_ff_interval} . "]]></module_ff_interval>\n";
}
if (! (empty ($data->{crontab}))) {
$xml_module .= "\t<crontab><![CDATA[" . $data->{crontab} . "]]></crontab>\n";
}
if (! (empty ($data->{min_ff_event_normal}))) {
$xml_module .= "\t<min_ff_event_normal><![CDATA[" . $data->{min_ff_event_normal} . "]]></min_ff_event_normal>\n";
}
if (! (empty ($data->{min_ff_event_warning}))) {
$xml_module .= "\t<min_ff_event_warning><![CDATA[" . $data->{min_ff_event_warning} . "]]></min_ff_event_warning>\n";
}
if (! (empty ($data->{min_ff_event_critical}))) {
$xml_module .= "\t<min_ff_event_critical><![CDATA[" . $data->{min_ff_event_critical} . "]]></min_ff_event_critical>\n";
}
if (! (empty ($data->{ff_timeout}))) {
$xml_module .= "\t<ff_timeout><![CDATA[" . $data->{ff_timeout} . "]]></ff_timeout>\n";
}
if (! (empty ($data->{each_ff}))) {
$xml_module .= "\t<each_ff><![CDATA[" . $data->{each_ff} . "]]></each_ff>\n";
}
if (! (empty ($data->{parent_unlink}))) {
$xml_module .= "\t<module_parent_unlink><![CDATA[" . $data->{parent_unlink} . "]]></module_parent_unlink>\n";
}
if (! (empty ($data->{alerts}))) {
foreach my $alert (@{$data->{alerts}}){
$xml_module .= "\t<alert_template><![CDATA[" . $alert . "]]></alert_template>\n";
}
}
if (defined ($config->{global_alerts})){
foreach my $alert (@{$config->{global_alerts}}){
$xml_module .= "\t<alert_template><![CDATA[" . $alert . "]]></alert_template>\n";
}
}
$xml_module .= "</module>\n";
if (empty ($not_print_flag)) {
print $xml_module;
}
return $xml_module;
}
################################################################################
# General arguments parser
################################################################################
sub parse_arguments($) {
my $raw = shift;
my @args;
if (defined($raw)){
@args = @{$raw};
}
else {
return {};
}
my %data;
for (my $i = 0; $i < $#args; $i+=2) {
my $key = trim($args[$i]);
$key =~ s/^-//;
$data{$key} = trim($args[$i+1]);
}
return \%data;
}
################################################################################
# General configuration file parser
#
# log=/PATH/TO/LOG/FILE
#
################################################################################
sub parse_configuration($;$$){
my $conf_file = shift;
my $separator;
$separator = shift or $separator = "=";
my $custom_eval = shift;
my $_CFILE;
my $_config;
if (empty($conf_file)) {
return {
error => "Configuration file not specified"
};
}
if( !open ($_CFILE,"<", "$conf_file")) {
return {
error => "Cannot open configuration file"
};
}
while (my $line = <$_CFILE>){
if (($line =~ /^ *\r*\n*$/)
|| ($line =~ /^#/ )){
# skip blank lines and comments
next;
}
my @parsed = split /$separator/, $line, 2;
if ($line =~ /^\s*global_alerts/){
push (@{$_config->{global_alerts}}, trim($parsed[1]));
next;
}
if (ref ($custom_eval) eq "ARRAY") {
my $f = 0;
foreach my $item (@{$custom_eval}) {
if ($line =~ /$item->{exp}/) {
$f = 1;
my $aux;
eval {
$aux = $item->{target}->($item->{exp},$line);
};
if (empty($_config)) {
$_config = $aux;
}
elsif (!empty($aux) && (ref ($aux) eq "HASH")) {
$_config = merge_hashes($_config, $aux);
}
}
}
if (is_enabled($f)){
next;
}
}
$_config->{trim($parsed[0])} = trim($parsed[1]);
}
close ($_CFILE);
return $_config;
}
################################################################################
# End of import
################################################################################
##########################################################################
# Show a message to STDERR
##########################################################################
sub msg {
my $msg = shift;
print STDERR strftime ("%Y-%m-%d %H:%M:%S", localtime()) . ": $msg\n";
}
sub get_next {
my ($route, $step) = @_;
return $route->{'next'}->{$step};
}
##########################################################################
# Extract route steps & timming from mtr output
##########################################################################
sub get_steps {
my ($conf) = @_;
my $target = $conf->{'t'};
return [] if empty($target);
my $mtr_r = "";
my $ping_r = "";
my @route_raw;
my @ping_raw;
if ($^O =~ /win/i){
$ping_r = trim(`ping -r 9 $target -n 1 | tr "Routea:->-" " " | gawk "/^[0-9\. ]*\$/ {if (\$1 != \\"\\"){ print \$1\";\"0}}"`) unless is_enabled($conf->{'-no-ping'});
@ping_raw = split /\n/, $ping_r;
if ($#ping_raw < 0) {
$mtr_r = trim(`mtr -n -o A -c $conf->{'c'} -r $target 2>/NUL | gawk "{print \$2";"\$3}"`) unless is_enabled($conf->{'-no-mtr'});
}
}
else {
$ping_r = trim(`for x in \$(ping -n -c 1 -R $target 2>/dev/null | tr -s "R:" " " | awk '/^[0-9\. \t]*\$/ {if (\$1 != ""){print \$1}}'); do echo -n \$x";"; ping -c $conf->{'c'} \$x 2>/dev/null | grep rtt |awk '{print \$4}'| cut -f2 -d"/"; done`) unless is_enabled($conf->{'-no-ping'});
@ping_raw = split /\n/, $ping_r;
if ($#ping_raw < 0) {
$mtr_r = trim(`mtr -n -c $conf->{'c'} -r $target -o A 2>/dev/null | awk '/^[0-9\\|\\-\\. \\t]*\$/ {print \$2\";\"\$3}'`) unless is_enabled($conf->{'-no-mtr'});
}
}
@route_raw = split /\n/, $mtr_r;
my @modules;
my @steps;
my $route;
if ($#ping_raw >= 0) {
# PING mode
my $rng = scalar @ping_raw;
my $checked;
my $j;
if (is_enabled($conf->{'s'})) {
# Symmetric routing
if ($^O =~ /win/i){
$j = 1;
}
else {
$j = 0;
}
for (my $i=0; $i< ($rng/2); $i++) {
my ($step,$time) = split /;/, $ping_raw[$i];
my $_r;
if (defined($checked->{$step})) {
$j-=2;
next;
}
$checked->{$step} = 1;
$_r->{'step'} = $step;
if ($^O =~ /win/i) {
$_r->{'time'} = trim(`ping -n $conf->{'c'} $_r->{'step'} | grep -e "Av" -e "Me" | gawk "{print \$NF}" | tr -d "ms"`) unless ((!defined($_r->{'step'}) || ($_r->{'step'} eq "")));
}
else {
$_r->{'time'} = $time;
}
if ((!defined($_r->{'step'}) || ($_r->{'step'} eq ""))) {
$_r->{'step'} = "???";
}
$steps[$j] = $_r;
$j+=2;
}
if ($^O =~ /win/i){
$j = 0;
}
else {
$j = 1;
}
for (my $i=$rng-1; $i>= ($rng/2); $i--) {
my ($step,$time) = split /;/, $ping_raw[$i];
my $_r;
if (defined($checked->{$step})) {
$j-=2 if $j>2;
next;
}
$_r->{'step'} = $step;
if ($^O =~ /win/i) {
$_r->{'time'} = trim(`ping -n $conf->{'c'} $_r->{'step'} | grep -e "Av" -e "Me" | gawk "{print \$NF}" | tr -d "ms"`) unless ((!defined($_r->{'step'}) || ($_r->{'step'} eq "")));
}
else {
$_r->{'time'} = $time;
}
if ((!defined($_r->{'step'}) || ($_r->{'step'} eq ""))) {
$_r->{'step'} = "???";
}
$steps[$j] = $_r;
$j+=2;
}
}
else {
# Asymmetric routing
for (my $i=0; $i< $rng; $i++) {
my ($step,$time) = split /;/, $ping_raw[$i];
my $_r;
if (defined($checked->{$step})) {
# target reached
last;
}
$checked->{$step} = 1;
$_r->{'step'} = $step;
if ($^O =~ /win/i) {
$_r->{'time'} = trim(`ping -n $conf->{'c'} $_r->{'step'} | grep -e "Av" -e "Me" | gawk "{print \$NF}" | tr -d "ms"`) unless ((!defined($_r->{'step'}) || ($_r->{'step'} eq "")));
}
else {
$_r->{'time'} = $time;
}
if ((!defined($_r->{'step'}) || ($_r->{'step'} eq ""))) {
$_r->{'step'} = "???";
}
$steps[$i] = $_r;
}
}
my $__origin;
if ($^O !~ /win/i){
$__origin = shift @steps;
}
my $gw;
if ($^O =~ /win/i) {
($gw->{'step'},$__origin->{'step'}) = split /;/, trim(`route print -4 | gawk "BEGIN {min=10000} /^\\ *0.0.0.0/ {met=\$NF;if(met<min){min=met; gw=\$3\\\";\\\"\$4}} END {print gw}"`);
$gw->{'time'} = trim(`ping -n $conf->{'c'} $gw->{'step'} 2>/NUL | grep ms | grep -v TTL | gawk "{print \$NF}" | tr -d "ms"`);
$__origin->{'time'} = 0;
}
else {
$gw->{'step'} = trim(`route -n | awk 'BEGIN {min=100000} /^0/ {met=\$5; if(min>met){gw=\$2;min=met} } END { print gw}'`);
$gw->{'time'} = trim(`ping -c $conf->{'c'} $gw->{'step'} 2>/dev/null | grep rtt |awk '{print \$4}'| cut -f2 -d"/"`);
}
unshift (@steps,($__origin,$gw));
my $unknown_count = 0;
my $previous = undef;
for(my $i=0; $i <= $#steps; $i++) {
my $host = $steps[$i]->{'step'};
my $time = to_number($steps[$i]->{'time'});
my $preffix = 'RouteStep_';
my $desc = '';
if (!defined($time)) {
next;
}
if ($host eq "???") {
$host = "Hidden_" . (++$unknown_count);
}
if (($i == $#steps) && in_array($conf->{'target_ip'},$host)) {
$preffix = 'RouteStepTarget_';
}
elsif($i == $#steps) {
$desc = 'Step unreachable';
}
push @modules, {
name => $preffix . $host,
type => "generic_data",
value => $time,
unit => 'ms',
desc => $desc,
module_parent => $previous,
parent_unlink => (empty($previous)?'1':undef)
};
$previous = $preffix . $host;
}
return \@modules;
}
else {
# MTR mode
if ($#route_raw < 0) {
# Empty output
msg("Failed to analyze [$target]");
return [];
}
for (my $i=0; $i <= $#route_raw; $i++) {
my $line = $route_raw[$i];
if (trim($line) =~ /(.*?);(.*)/) {
my $host = $1;
my $time = to_number($2);
my $preffix = 'RouteStep_';
my $desc = '';
my $item;
my $_r;
if (!defined($time)) {
next;
}
$_r->{'step'} = $host;
$_r->{'time'} = $time;
push @steps, $_r;
}
}
my $__origin;
if ($^O !~ /win/i){
$__origin = shift @steps;
}
my $gw;
if ($^O =~ /win/i) {
($gw->{'step'},$__origin->{'step'}) = split /;/, trim(`route print -4 | gawk "BEGIN {min=10000} /^\\ *0.0.0.0/ {met=\$NF;if(met<min){min=met; gw=\$3\\\";\\\"\$4}} END {print gw}"`);
$gw->{'time'} = trim(`ping -n $conf->{'c'} $gw->{'step'} 2>/NUL | grep ms | grep -v TTL | gawk "{print \$NF}" | tr -d "ms"`);
$__origin->{'time'} = 0;
}
else {
$gw->{'step'} = trim(`route -n | awk 'BEGIN {min=100000} /^0/ {met=\$5; if(min>met){gw=\$2;min=met} } END { print gw}'`);
$gw->{'time'} = trim(`ping -c $conf->{'c'} $gw->{'step'} 2>/dev/null | grep rtt |awk '{print \$4}'| cut -f2 -d"/"`);
my $__xorigin = trim(`ip a show dev \`route -n | awk 'BEGIN {min=100000} /^0/ {met=\$5; if(min>met){iface=\$NF;min=met} } END { print iface}'\` | grep -w inet | awk '{print \$2}' | cut -d'/' -f1`);
if ($__xorigin ne $__origin->{'step'}) {
unshift(@steps, $__origin);
$__origin = {};
$__origin->{'step'} = $__xorigin;
$__origin->{'time'} = 0;
}
}
unshift (@steps,($__origin,$gw));
my $unknown_count = 0;
my $previous = undef;
for(my $i=0; $i <= $#steps; $i++) {
my $host = $steps[$i]->{'step'};
my $time = to_number($steps[$i]->{'time'});
my $preffix = 'RouteStep_';
my $desc = '';
if (!defined($time)) {
next;
}
if ($host eq "???") {
$host = "Hidden_" . (++$unknown_count);
}
if (($i == $#steps) && in_array($conf->{'target_ip'},$host)) {
$preffix = 'RouteStepTarget_';
}
elsif($i == $#steps) {
$desc = 'Step unreachable';
}
push @modules, {
name => $preffix . $host,
type => "generic_data",
value => $time,
unit => 'ms',
desc => $desc,
module_parent => $previous,
parent_unlink => (empty($previous)?'1':undef)
};
$previous = $preffix . $host;
}
}
return \@modules;
}
##########################################################################
##########################################################################
# MAIN
##########################################################################
##########################################################################
if ($#ARGV < 0) {
print STDERR $HELP;
exit 1;
}
my $conf;
my $file_conf = {};
my $args_conf = {};
if (-e $ARGV[0]) {
$file_conf = parse_configuration($ARGV[0]);
shift @ARGV;
}
$args_conf = parse_arguments(\@ARGV);
$conf = merge_hashes($file_conf,$args_conf);
if (!defined $conf->{'t'}) {
print STDERR $HELP;
exit 1;
}
my @targets = gethostbyname($conf->{'t'});
@targets = map { inet_ntoa($_) } @targets[4 .. $#targets];
if (empty(\@targets)) {
print STDERR "Cannot resolve $conf->{'t'} \n";
exit 2;
}
$conf->{'target_ip'} = \@targets;
$conf->{'c'} = 4 unless looks_like_number($conf->{'c'});
$conf->{'s'} = 1 unless looks_like_number($conf->{'s'});
my $results = get_steps($conf);
foreach (@{$results}) {
print_module($conf, $_);
}

View File

@ -1,6 +1,6 @@
# Base config file for Pandora FMS Windows Agent
# (c) 2006-2017 Artica Soluciones Tecnologicas
# Version 7.0NG.714
# Version 7.0NG.716
# 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

Binary file not shown.

Binary file not shown.

View File

@ -3,7 +3,7 @@ AllowLanguageSelection
{Yes}
AppName
{Pandora FMS Windows Agent v7.0NG.714}
{Pandora FMS Windows Agent v7.0NG.716}
ApplicationID
{17E3D2CF-CA02-406B-8A80-9D31C17BD08F}
@ -186,7 +186,7 @@ UpgradeApplicationID
{}
Version
{171026}
{171129}
ViewReadme
{Yes}

View File

@ -30,7 +30,7 @@ using namespace Pandora;
using namespace Pandora_Strutils;
#define PATH_SIZE _MAX_PATH+1
#define PANDORA_VERSION ("7.0NG.714(Build 171026)")
#define PANDORA_VERSION ("7.0NG.716(Build 171129)")
string pandora_path;
string pandora_dir;

View File

@ -11,7 +11,7 @@ BEGIN
VALUE "LegalCopyright", "Artica ST"
VALUE "OriginalFilename", "PandoraAgent.exe"
VALUE "ProductName", "Pandora FMS Windows Agent"
VALUE "ProductVersion", "(7.0NG.714(Build 171026))"
VALUE "ProductVersion", "(7.0NG.716(Build 171129))"
VALUE "FileVersion", "1.0.0.0"
END
END

View File

@ -1,5 +1,5 @@
package: pandorafms-console
Version: 7.0NG.714-171026
Version: 7.0NG.716-171129
Architecture: all
Priority: optional
Section: admin

View File

@ -14,7 +14,7 @@
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
pandora_version="7.0NG.714-171026"
pandora_version="7.0NG.716-171129"
package_pear=0
package_pandora=1

View File

@ -546,9 +546,11 @@ ui_require_jquery_file('pandora');
});
$('#group_id').change(function(){
var regx = /&group_id=\d*/g;
var url = location.href.replace(regx, "");
location.href = url+"&group_id="+$("#group_id").val();
if(location.href.indexOf("extensions/agents_modules") == -1){
var regx = /&group_id=\d*/g;
var url = location.href.replace(regx, "");
location.href = url+"&group_id="+$("#group_id").val();
}
});
});

View File

@ -72,7 +72,7 @@ function mainAgentsModules() {
$hor_offset = (int)get_parameter('hor_offset', 0);
$block = $config['block_size'];
if(get_parameter('modulegroup') != null){
$agents_id = (array)get_parameter('id_agents2', -1);
$agents_id = (array)get_parameter('id_agents2', -1);
}
$selection_a_m = (int)get_parameter('selection_agent_module');
$modules_selected = (array)get_parameter('module', 0);

View File

@ -259,80 +259,60 @@ function extension_db_check_tables_differences($connection_test,
$field_system = $fields_system[$name_field];
$diff = array_diff($field_test, $field_system);
if (!empty($diff)) {
foreach ($diff as $config_field => $value) {
switch ($config_field) {
case 'type':
ui_print_error_message(
__('Unsuccessful the field %s in the table %s must be set the type with %s.',
$name_field, $table, $value));
ui_print_info_message(
__('You can execute this SQL query for to fix.') . "<br />" .
'<pre>' .
"ALTER TABLE " . $table . " MODIFY COLUMN " . $name_field . " " . $value . ";" .
'</pre>'
);
break;
case 'null':
ui_print_error_message(
__('Unsuccessful the field %s in the table %s must be null: (%s).',
$name_field, $table, $value));
$info_message = "";
$error_message = "";
if($diff['type']){
$error_message .= "Unsuccessful the field ".$name_field." in the table ".$table." must be set the type with ".$diff['type']."<br>";
}
if($diff['null']){
$error_message .= "Unsuccessful the field $name_field in the table $table must be null: (".$diff['null'].").<br>";
}
if($diff['default']){
$error_message .= "Unsuccessful the field $name_field in the table $table must be set ".$diff['default']." as default value.<br>";
}
if($field_test['null'] == "YES" || !isset($field_test['null']) || $field_test['null'] == ""){
$null_defect = " NULL";
}
else{
$null_defect = " NOT NULL";
}
if(!isset($field_test['default']) || $field_test['default'] == ""){
$default_value = "";
}
else{
$default_value = " DEFAULT ".$field_test['default'];
}
if($diff['type'] || $diff['null'] || $diff['default']){
$info_message .= "ALTER TABLE " . $table . " MODIFY COLUMN " . $name_field . " " . $field_test['type'] . $null_defect . $default_value.";";
}
if($diff['key']){
$error_message .= "Unsuccessful the field $name_field in the table $table must be set the key as defined in the SQL file.<br>";
$info_message .= "<br><br>Please check the SQL file for to know the kind of key needed.";
}
if($diff['extra']){
$error_message .= "Unsuccessful the field $name_field in the table $table must be set as defined in the SQL file.<br>";
$info_message .= "<br><br>Please check the SQL file for to know the kind of extra config needed.";
}
ui_print_error_message(
__($error_message));
if ($value == "YES") {
ui_print_info_message(
__('You can execute this SQL query for to fix.') . "<br />" .
'<pre>' .
"ALTER TABLE " . $table . " MODIFY COLUMN " . $name_field . " " . $field_test['type'] . " NULL;" .
'</pre>'
);
}
else {
ui_print_info_message(
__('You can execute this SQL query for to fix.') . "<br />" .
'<pre>' .
"ALTER TABLE " . $table . " MODIFY COLUMN " . $name_field . " " . $field_test['type'] . " NOT NULL;" .
'</pre>'
);
}
ui_print_info_message(
__($info_message));
break;
case 'key':
ui_print_error_message(
__('Unsuccessful the field %s in the table %s must be set the key as defined in the SQL file.',
$name_field, $table));
ui_print_info_message(
__('Please check the SQL file for to know the kind of key needed.'));
break;
case 'default':
if($field_test['null'] == "YES" || !isset($field_test['null']) || $field_test['null'] == ""){
$null_defect = " NULL";
}
else{
$null_defect = " NOT NULL";
}
ui_print_error_message(
__('Unsuccessful the field %s in the table %s must be set %s as default value.',
$name_field, $table, $value));
ui_print_info_message(
__('You can execute this SQL query for to fix.') . "<br />" .
'<pre>' .
"ALTER TABLE " . $table . " MODIFY COLUMN " . $name_field . " " . $field_test['type'] . $null_defect . " DEFAULT " . $value . ";" .
'</pre>'
);
break;
case 'extra':
ui_print_error_message(
__('Unsuccessful the field %s in the table %s must be set as defined in the SQL file.',
$name_field, $table));
ui_print_info_message(
__('Please check the SQL file for to know the kind of extra config needed.'));
break;
}
}
}
}
}
}
if ($correct_fields) {
ui_print_success_message(
@ -366,4 +346,4 @@ function extension_db_status_execute_sql_file($url, $connection) {
extensions_add_godmode_function('extension_db_status');
extensions_add_godmode_menu_option(__('DB Schema check'), 'DM', 'gextensions', null, "v1r1", 'gdbman');
?>
?>

View File

@ -0,0 +1,5 @@
START TRANSACTION;
ALTER TABLE tsnmp_filter ADD unified_filters_id int(10) NOT NULL DEFAULT 0;
COMMIT;

View File

@ -0,0 +1,21 @@
START TRANSACTION;
ALTER TABLE tusuario ADD COLUMN `time_autorefresh` int(5) unsigned NOT NULL default '30';
ALTER TABLE treport_content ADD COLUMN lapse_calc tinyint(1) default '0';
ALTER TABLE treport_content ADD COLUMN lapse int(11) default '300';
ALTER TABLE treport_content ADD COLUMN visual_format tinyint(1) default '0';
ALTER TABLE treport_content_template ADD COLUMN lapse_calc tinyint(1) default '0';
ALTER TABLE treport_content_template ADD COLUMN lapse int(11) default '300';
ALTER TABLE treport_content_template ADD COLUMN visual_format tinyint(1) default '0';
UPDATE `talert_commands`
SET `description` = 'This&#x20;alert&#x20;send&#x20;an&#x20;email&#x20;using&#x20;internal&#x20;Pandora&#x20;FMS&#x20;Server&#x20;SMTP&#x20;capabilities&#x20;&#40;defined&#x20;in&#x20;each&#x20;server,&#x20;using:&#x0d;&#x0a;_field1_&#x20;as&#x20;destination&#x20;email&#x20;address,&#x20;and&#x0d;&#x0a;_field2_&#x20;as&#x20;subject&#x20;for&#x20;message.&#x20;&#x0d;&#x0a;_field3_&#x20;as&#x20;text&#x20;of&#x20;message.&#x20;&#x0d;&#x0a;_field4_&#x20;as&#x20;content&#x20;type&#x20;&#40;text/plain&#x20;or&#x20;html/text&#41;.',
`fields_descriptions` = '[\"Destination&#x20;address\",\"Subject\",\"Text\",\"Content&#x20;Type\",\"\",\"\",\"\",\"\",\"\",\"\"]',
`fields_values` = '[\"\",\"\",\"_html_editor_\",\"_content_type_\",\"\",\"\",\"\",\"\",\"\",\"\"]'
WHERE id=1;
UPDATE `talert_actions`
SET `field4` = 'text/html',
`field4_recovery` = 'text/html'
WHERE id = 1;
COMMIT;

View File

@ -0,0 +1,24 @@
START TRANSACTION;
SET @st_oum708 = (SELECT IF(
(SELECT COUNT(*) FROM information_schema.tables WHERE table_schema = DATABASE() AND table_name = 'tuser_task_scheduled') > 0,
"ALTER TABLE tuser_task_scheduled MODIFY args TEXT NOT NULL",
"SELECT 1"
));
PREPARE pr_oum708 FROM @st_oum708;
EXECUTE pr_oum708;
DEALLOCATE PREPARE pr_oum708;
ALTER TABLE tagente ADD COLUMN `safe_mode_module` int(10) unsigned NOT NULL default '0';
ALTER TABLE tmetaconsole_agent ADD COLUMN `safe_mode_module` int(10) unsigned NOT NULL default '0';
alter table tlayout_data add column element_group int(10) not null default 0;
alter table tlayout_data add column id_layout_linked_weight int(10) not null default 0;
ALTER TABLE tlayout_data ADD COLUMN show_on_top tinyint(1) default 0;
ALTER TABLE `tdashboard` ADD COLUMN `cells_slideshow` TINYINT(1) NOT NULL default 0;
COMMIT;

View File

@ -725,6 +725,9 @@ CREATE TABLE IF NOT EXISTS `treport_content_template` (
`module_free_text` TEXT,
`each_agent` tinyint(1) default 1,
`historical_db` tinyint(1) UNSIGNED NOT NULL default 0,
`lapse_calc` tinyint(1) UNSIGNED NOT NULL default '0',
`lapse` int(11) UNSIGNED NOT NULL default '300',
`visual_format` tinyint(1) UNSIGNED NOT NULL default '0',
PRIMARY KEY(`id_rc`)
) ENGINE = InnoDB DEFAULT CHARSET=utf8;
@ -1134,6 +1137,10 @@ ALTER TABLE talert_actions ADD COLUMN `field15_recovery` TEXT NOT NULL DEFAULT "
-- ---------------------------------------------------------------------
UPDATE `talert_commands` SET `fields_descriptions` = '[\"Integria&#x20;IMS&#x20;API&#x20;path\",\"Integria&#x20;IMS&#x20;API&#x20;pass\",\"Integria&#x20;IMS&#x20;user\",\"Integria&#x20;IMS&#x20;user&#x20;pass\",\"Ticket&#x20;title\",\"Ticket&#x20;group&#x20;ID\",\"Ticket&#x20;priority\",\"Email&#x20;copy\",\"Ticket&#x20;owner\",\"Ticket&#x20;description\"]', `fields_values` = '[\"\",\"\",\"\",\"\",\"\",\"\",\"10,Maintenance;0,Informative;1,Low;2,Medium;3,Serious;4,Very&#x20;Serious\",\"\",\"\",\"\"]' WHERE `id` = 11 AND `name` = 'Integria&#x20;IMS&#x20;Ticket';
UPDATE `talert_commands` SET `description` = 'This&#x20;alert&#x20;send&#x20;an&#x20;email&#x20;using&#x20;internal&#x20;Pandora&#x20;FMS&#x20;Server&#x20;SMTP&#x20;capabilities&#x20;&#40;defined&#x20;in&#x20;each&#x20;server,&#x20;using:&#x0d;&#x0a;_field1_&#x20;as&#x20;destination&#x20;email&#x20;address,&#x20;and&#x0d;&#x0a;_field2_&#x20;as&#x20;subject&#x20;for&#x20;message.&#x20;&#x0d;&#x0a;_field3_&#x20;as&#x20;text&#x20;of&#x20;message.&#x20;&#x0d;&#x0a;_field4_&#x20;as&#x20;content&#x20;type&#x20;&#40;text/plain&#x20;or&#x20;html/text&#41;.', `fields_descriptions` = '[\"Destination&#x20;address\",\"Subject\",\"Text\",\"Content&#x20;Type\",\"\",\"\",\"\",\"\",\"\",\"\"]', `fields_values` = '[\"\",\"\",\"_html_editor_\",\"_content_type_\",\"\",\"\",\"\",\"\",\"\",\"\"]' WHERE id=1;
UPDATE `talert_actions` SET `field4` = 'text/html', `field4_recovery` = 'text/html' WHERE id = 1;
-- ---------------------------------------------------------------------
-- Table `tmap`
-- ---------------------------------------------------------------------
@ -1150,10 +1157,10 @@ ALTER TABLE titem MODIFY `source_data` int(10) unsigned;
INSERT INTO `tconfig` (`token`, `value`) VALUES ('big_operation_step_datos_purge', '100');
INSERT INTO `tconfig` (`token`, `value`) VALUES ('small_operation_step_datos_purge', '1000');
INSERT INTO `tconfig` (`token`, `value`) VALUES ('days_autodisable_deletion', '30');
INSERT INTO `tconfig` (`token`, `value`) VALUES ('MR', 7);
INSERT INTO `tconfig` (`token`, `value`) VALUES ('MR', 9);
UPDATE tconfig SET value = 'https://licensing.artica.es/pandoraupdate7/server.php' WHERE token='url_update_manager';
DELETE FROM `tconfig` WHERE `token` = 'current_package_enterprise';
INSERT INTO `tconfig` (`token`, `value`) VALUES ('current_package_enterprise', '714');
INSERT INTO `tconfig` (`token`, `value`) VALUES ('current_package_enterprise', '716');
-- ---------------------------------------------------------------------
-- Table `tplanned_downtime_agents`
@ -1183,6 +1190,7 @@ ALTER TABLE tusuario ADD COLUMN `id_filter` int(10) UNSIGNED NULL DEFAULT NULL;
ALTER TABLE tusuario ADD CONSTRAINT `fk_id_filter` FOREIGN KEY (`id_filter`) REFERENCES tevent_filter(`id_filter`) ON DELETE SET NULL;
ALTER TABLE tusuario ADD COLUMN `session_time` int(10) signed NOT NULL default '0';
alter table tusuario add autorefresh_white_list text not null default '';
ALTER TABLE tusuario ADD COLUMN `time_autorefresh` int(5) unsigned NOT NULL default '30';
-- ---------------------------------------------------------------------
-- Table `tagente_modulo`
@ -1218,6 +1226,7 @@ ALTER TABLE tagente ADD `remote` tinyint(1) NOT NULL default 0;
ALTER TABLE tagente ADD COLUMN `cascade_protection_module` int(10) unsigned NOT NULL default '0';
ALTER TABLE tagente ADD COLUMN (alias varchar(600) not null default '');
ALTER TABLE tagente ADD `alias_as_name` int(2) unsigned default '0';
ALTER TABLE tagente ADD COLUMN `safe_mode_module` int(10) unsigned NOT NULL default '0';
UPDATE tagente SET tagente.alias = tagente.nombre;
-- ---------------------------------------------------------------------
@ -1231,6 +1240,9 @@ ALTER TABLE tlayout ADD `background_color` varchar(50) NOT NULL default '#FFF';
ALTER TABLE tlayout_data ADD `type_graph` varchar(50) NOT NULL default 'area';
ALTER TABLE tlayout_data ADD `label_position` varchar(50) NOT NULL default 'down';
ALTER TABLE tlayout_data ADD COLUMN `show_statistics` tinyint(2) NOT NULL default '0';
ALTER TABLE tlayout_data ADD COLUMN `element_group` int(10) NOT NULL default '0';
ALTER TABLE tlayout_data ADD COLUMN `id_layout_linked_weight` int(10) NOT NULL default '0';
ALTER TABLE tlayout_data ADD COLUMN `show_on_top` tinyint(1) NOT NULL default '0';
-- ---------------------------------------------------------------------
-- Table `tagent_custom_fields`
@ -1248,6 +1260,8 @@ UPDATE tagente_modulo SET cron_interval = '' WHERE cron_interval LIKE '% %';
-- Table `tgraph`
-- ---------------------------------------------------------------------
ALTER TABLE tgraph ADD COLUMN `percentil` int(4) unsigned default '0';
ALTER TABLE tgraph ADD COLUMN `summatory_series` tinyint(1) UNSIGNED NOT NULL default '0';
ALTER TABLE tgraph ADD COLUMN `average_series` tinyint(1) UNSIGNED NOT NULL default '0';
-- ---------------------------------------------------------------------
-- Table `tnetflow_filter`
@ -1269,6 +1283,9 @@ UPDATE treport_custom_sql SET `sql` = 'select&#x20;t1.alias&#x20;as&#x20;agent_n
-- ---------------------------------------------------------------------
ALTER TABLE treport_content ADD COLUMN `historical_db` tinyint(1) NOT NULL DEFAULT '0';
ALTER TABLE treport_content ADD COLUMN `lapse_calc` tinyint(1) default '0';
ALTER TABLE treport_content ADD COLUMN `lapse` int(11) default '300';
ALTER TABLE treport_content ADD COLUMN `visual_format` tinyint(1) default '0';
-- ---------------------------------------------------------------------
-- Table `tmodule_relationship`
@ -1295,6 +1312,7 @@ ALTER TABLE tmetaconsole_agent ADD COLUMN `cascade_protection_module` int(10) de
ALTER TABLE tmetaconsole_agent ADD COLUMN `transactional_agent` tinyint(1) NOT NULL default '0';
ALTER TABLE tmetaconsole_agent ADD COLUMN `alias` VARCHAR(600) not null DEFAULT '';
ALTER TABLE tmetaconsole_agent ADD COLUMN `alias_as_name` int(2) unsigned default '0';
ALTER TABLE tmetaconsole_agent ADD COLUMN `safe_mode_module` int(10) unsigned NOT NULL default '0';
UPDATE `tmetaconsole_agent` SET tmetaconsole_agent.alias = tmetaconsole_agent.nombre;
-- ---------------------------------------------------------------------
@ -1326,6 +1344,10 @@ SET @vv1 = (SELECT COUNT(*) FROM information_schema.tables WHERE table_schema =
IF @vv1>0 THEN
ALTER TABLE tbackup ADD COLUMN `filepath` varchar(512) NOT NULL DEFAULT "";
END IF;
SET @vv2 = (SELECT COUNT(*) FROM information_schema.tables WHERE table_schema = DATABASE() AND table_name = 'tuser_task_scheduled');
IF @vv2>0 THEN
ALTER TABLE tuser_task_scheduled MODIFY args TEXT NOT NULL;
END IF;
END;
//
delimiter ;
@ -1440,3 +1462,7 @@ INSERT INTO tmodule VALUES (8, 'Wux module');
INSERT INTO ttipo_modulo VALUES (25,'web_analysis', 8, 'Web analysis data', 'module-wux.png');
-- ---------------------------------------------------------------------
-- Table `tdashboard`
-- ---------------------------------------------------------------------
ALTER TABLE `tdashboard` ADD COLUMN `cells_slideshow` TINYINT(1) NOT NULL default 0;

View File

@ -191,7 +191,7 @@ config_check();
$_GET['refr'] = null;
}
$select = db_process_sql("SELECT autorefresh_white_list FROM tusuario WHERE id_user = '" . $config['id_user'] . "'");
$select = db_process_sql("SELECT autorefresh_white_list,time_autorefresh FROM tusuario WHERE id_user = '" . $config['id_user'] . "'");
$autorefresh_list = json_decode($select[0]['autorefresh_white_list']);
if ($autorefresh_list !== null && array_search($_GET['sec2'], $autorefresh_list) !== false) {
@ -261,7 +261,13 @@ config_check();
if ($check_minor_release_available) {
if (users_is_admin($config['id_user'])) {
set_pandora_error_for_header('There are one or more minor releases waiting for update', 'minor release/s available');
if($config['language'] == 'es'){
set_pandora_error_for_header('Hay una o mas revisiones menores en espera para ser actualizadas. <a style="font-size:8pt;font-style:italic;" target="blank" href="http://wiki.pandorafms.com/index.php?title=Pandora:Documentation_es:Actualizacion#Versi.C3.B3n_7.0NG_.28_Rolling_Release_.29">'.__('Sobre actualización de revisión menor').'</a>', 'Revisión/es menor/es disponible/s');
}
else{
set_pandora_error_for_header('There are one or more minor releases waiting for update. <a style="font-size:8pt;font-style:italic;" target="blank" href="http://wiki.pandorafms.com/index.php?title=Pandora:Documentation_en:Anexo_Upgrade#Version_7.0NG_.28_Rolling_Release_.29">'.__('About minor release update').'</a>', 'minor release/s available');
}
}
}
echo '<div id="alert_messages" style="display: none"></div>';
@ -389,7 +395,15 @@ config_check();
$("#combo_refr").toggle ();
$("#combo_refr").css('padding-right', '9px');
href = $("a.autorefresh").attr ("href");
$(document).attr ("location", href + "30");
<?php
if($select[0]['time_autorefresh']){
?>
var refresh = '<?php echo $select[0]["time_autorefresh"] ?>';
$(document).attr ("location", href + refresh);
<?php
}
?>
<?php
}
}

View File

@ -252,25 +252,6 @@ foreach ($modules as $m) {
$modules_values[$m['id_module']] = $m['name'];
}
$table->data[3][0] = __('Parent');
$params = array();
$params['return'] = true;
$params['show_helptip'] = true;
$params['input_name'] = 'id_parent';
$params['print_hidden_input_idagent'] = true;
$params['hidden_input_idagent_name'] = 'id_agent_parent';
$params['hidden_input_idagent_value'] = $id_parent;
$params['value'] = db_get_value ("alias","tagente","id_agente",$id_parent);
$params['selectbox_id'] = 'cascade_protection_module';
$params['javascript_is_function_select'] = true;
$params['cascade_protection'] = true;
$table->data[3][1] = ui_print_agent_autocomplete_input($params);
$table->data[3][1] .= html_print_checkbox ("cascade_protection", 1, $cascade_protection, true).__('Cascade protection'). "&nbsp;" . ui_print_help_icon("cascade_protection", true);
$table->data[3][1] .= "&nbsp;&nbsp;" . __('Module') . "&nbsp;" . html_print_select ($modules_values, "cascade_protection_module", $cascade_protection_module, "", "", 0, true);
$table->data[4][0] = __('Group');
$table->data[4][1] = html_print_select_groups(false, "AR", false, 'grupo', $grupo, '', '', 0, true);
$table->data[4][1] .= ' <span id="group_preview">';
@ -320,52 +301,87 @@ $table->class = "databox filters";
$table->head = array ();
$table->style = array ();
$table->style[0] = 'font-weight: bold; ';
$table->style[2] = 'font-weight: bold;';
$table->style[4] = 'font-weight: bold;';
$table->data = array ();
// Custom ID
$table->data[0][0] = __('Custom ID');
$table->data[0][1] = html_print_input_text ('custom_id', $custom_id, '', 16, 255, true);
$table->data[1][0] = __('Parent');
$params = array();
$params['return'] = true;
$params['show_helptip'] = true;
$params['input_name'] = 'id_parent';
$params['print_hidden_input_idagent'] = true;
$params['hidden_input_idagent_name'] = 'id_agent_parent';
$params['hidden_input_idagent_value'] = $id_parent;
$params['value'] = db_get_value ("alias","tagente","id_agente",$id_parent);
$params['selectbox_id'] = 'cascade_protection_module';
$params['javascript_is_function_select'] = true;
$params['cascade_protection'] = true;
$table->data[1][1] = ui_print_agent_autocomplete_input($params);
$table->data[1][1] .= html_print_checkbox ("cascade_protection", 1, $cascade_protection, true).__('Cascade protection'). "&nbsp;" . ui_print_help_icon("cascade_protection", true);
$table->data[1][1] .= "&nbsp;&nbsp;" . __('Module') . "&nbsp;" . html_print_select ($modules_values, "cascade_protection_module", $cascade_protection_module, "", "", 0, true);
//safe operation mode
if($id_agente){
$sql_modules = db_get_all_rows_sql("SELECT id_agente_modulo as id_module, nombre as name FROM tagente_modulo
WHERE id_agente = " . $id_agente);
$safe_mode_modules = array();
$safe_mode_modules[0] = __('Any');
foreach ($sql_modules as $m) {
$safe_mode_modules[$m['id_module']] = $m['name'];
}
$table->data[2][0] = __('Safe operation mode')
. ui_print_help_tip(__('This mode allow Pandora FMS to disable all modules
of this agent while the selected module is on CRITICAL status'), true);
$table->data[2][1] = html_print_checkbox('safe_mode', 1, $safe_mode, true);
$table->data[2][1] .= "&nbsp;&nbsp;" . __('Module') . "&nbsp;" . html_print_select ($safe_mode_modules, "safe_mode_module", $safe_mode_module, "", "", 0, true);
}
// Learn mode / Normal mode
$table->data[1][0] = __('Module definition') .
$table->data[3][0] = __('Module definition') .
ui_print_help_icon("module_definition", true);
$table->data[1][1] = __('Learning mode') . ' ' .
$table->data[3][1] = __('Learning mode') . ' ' .
html_print_radio_button_extended ("modo", 1, '', $modo, false, 'show_modules_not_learning_mode_context_help();',
'style="margin-right: 40px;"', true);
$table->data[1][1] .= __('Normal mode') . ' ' .
$table->data[3][1] .= __('Normal mode') . ' ' .
html_print_radio_button_extended ("modo", 0, '', $modo, false, 'show_modules_not_learning_mode_context_help();',
'style="margin-right: 40px;"', true);
$table->data[1][1] .= __('Autodisable mode') . ' ' .
$table->data[3][1] .= __('Autodisable mode') . ' ' .
html_print_radio_button_extended ("modo", 2, '', $modo, false, 'show_modules_not_learning_mode_context_help();',
'style="margin-right: 40px;"', true);
// Status (Disabled / Enabled)
$table->data[2][0] = __('Status');
$table->data[2][1] = __('Disabled') . ' ' .
$table->data[4][0] = __('Status');
$table->data[4][1] = __('Disabled') . ' ' .
html_print_radio_button_extended ("disabled", 1, '', $disabled, false, '', 'style="margin-right: 40px;"', true);
$table->data[2][1] .= __('Active') . ' ' .
$table->data[4][1] .= __('Active') . ' ' .
html_print_radio_button_extended ("disabled", 0, '', $disabled, false, '', 'style="margin-right: 40px;"', true);
// Remote configuration
$table->data[3][0] = __('Remote configuration');
$table->data[5][0] = __('Remote configuration');
if (!$new_agent) {
$table->data[3][1] = '<em>' . __('Not available') . '</em>';
$table->data[5][1] = '<em>' . __('Not available') . '</em>';
if (isset($filename)) {
if (file_exists ($filename['md5'])) {
$table->data[3][1] = date ("F d Y H:i:s", fileatime ($filename['md5']));
$table->data[5][1] = date ("F d Y H:i:s", fileatime ($filename['md5']));
// Delete remote configuration
$table->data[3][1] .= '<a href="index.php?' .
$table->data[5][1] .= '<a href="index.php?' .
'sec=gagente&amp;' .
'sec2=godmode/agentes/configurar_agente&amp;' .
'tab=main&amp;' .
'disk_conf_delete=1&amp;' .
'id_agente=' . $id_agente . '">';
$table->data[3][1] .= html_print_image(
$table->data[5][1] .= html_print_image(
"images/cross.png", true,
array ('title' => __('Delete remote configuration file'), 'style' => 'vertical-align: middle;')).'</a>';
$table->data[3][1] .= '</a>' .
$table->data[5][1] .= '</a>' .
ui_print_help_tip(
__('Delete this conf file implies that for restore you must reactive remote config in the local agent.'),
true);
@ -373,7 +389,7 @@ if (!$new_agent) {
}
}
else
$table->data[3][1] = '<em>' . __('Not available') . '</em>';
$table->data[5][1] = '<em>' . __('Not available') . '</em>';
$listIcons = gis_get_array_list_icons();
@ -411,23 +427,23 @@ $table->data[0][3] = html_print_select($arraySelectIcon, "icon_path",
array("id" => "icon_warning", "style" => "display:".$display_icons.";"));
if ($config['activate_gis']) {
$table->data[1][2] = __('Ignore new GIS data:');
$table->data[1][3] = __('Yes') . ' ' .
$table->data[3][2] = __('Ignore new GIS data:');
$table->data[3][3] = __('Yes') . ' ' .
html_print_radio_button_extended ("update_gis_data", 0, '',
$update_gis_data, false, '', 'style="margin-right: 40px;"', true);
$table->data[1][3] .= __('No') . ' ' .
$table->data[3][3] .= __('No') . ' ' .
html_print_radio_button_extended ("update_gis_data", 1, '',
$update_gis_data, false, '', 'style="margin-right: 40px;"', true);
}
$table->data[2][2] = __('Url address');
$table->data[2][3] = html_print_input_text ('url_description',
$table->data[4][2] = __('Url address');
$table->data[4][3] = html_print_input_text ('url_description',
$url_description, '', 45, 255, true);
$table->data[3][2] = __('Quiet');
$table->data[3][3] = ui_print_help_tip(
$table->data[5][2] = __('Quiet');
$table->data[5][3] = ui_print_help_tip(
__('The agent still runs but the alerts and events will be stop'), true);
$table->data[3][3] .= html_print_checkbox('quiet', 1, $quiet, true);
$table->data[5][3] .= html_print_checkbox('quiet', 1, $quiet, true);
ui_toggle(html_print_table ($table, true), __('Advanced options'));
unset($table);
@ -582,6 +598,26 @@ ui_require_jquery_file('bgiframe');
$("#cascade_protection_module").attr("disabled", 'disabled');
}
});
var safe_mode_checked = $("#checkbox-safe_mode").is(":checked");
if (safe_mode_checked) {
$("#safe_mode_module").removeAttr("disabled");
}
else {
$("#safe_mode_module").attr("disabled", 'disabled');
}
$("#checkbox-safe_mode").change(function () {
var safe_mode_checked = $("#checkbox-safe_mode").is(":checked");
if (safe_mode_checked) {
$("#safe_mode_module").removeAttr("disabled");
}
else {
$("#safe_mode_module").val(0);
$("#safe_mode_module").attr("disabled", 'disabled');
}
});
paint_qrcode(
"<?php

View File

@ -35,12 +35,12 @@ $use_agent = get_parameter ('use_agent');
$snmp_community = (string) get_parameter ('snmp_community', 'public');
$snmp_version = get_parameter('snmp_version', '1');
$server_to_exec = get_parameter('server_to_exec', 0);
$snmp3_auth_user = get_parameter('snmp3_auth_user');
$snmp3_auth_user = io_safe_output(get_parameter('snmp3_auth_user'));
$snmp3_security_level = get_parameter('snmp3_security_level');
$snmp3_auth_method = get_parameter('snmp3_auth_method');
$snmp3_auth_pass = get_parameter('snmp3_auth_pass');
$snmp3_auth_pass = io_safe_output(get_parameter('snmp3_auth_pass'));
$snmp3_privacy_method = get_parameter('snmp3_privacy_method');
$snmp3_privacy_pass = get_parameter('snmp3_privacy_pass');
$snmp3_privacy_pass = io_safe_output(get_parameter('snmp3_privacy_pass'));
$tcp_port = (string) get_parameter ('tcp_port');
//See if id_agente is set (either POST or GET, otherwise -1

View File

@ -32,12 +32,12 @@ $use_agent = get_parameter ('use_agent');
$snmp_community = (string) get_parameter ('snmp_community', 'public');
$server_to_exec = get_parameter('server_to_exec', 0);
$snmp_version = get_parameter('snmp_version', '1');
$snmp3_auth_user = get_parameter('snmp3_auth_user');
$snmp3_auth_user = io_safe_output(get_parameter('snmp3_auth_user'));
$snmp3_security_level = get_parameter('snmp3_security_level');
$snmp3_auth_method = get_parameter('snmp3_auth_method');
$snmp3_auth_pass = get_parameter('snmp3_auth_pass');
$snmp3_auth_pass = io_safe_output(get_parameter('snmp3_auth_pass'));
$snmp3_privacy_method = get_parameter('snmp3_privacy_method');
$snmp3_privacy_pass = get_parameter('snmp3_privacy_pass');
$snmp3_privacy_pass = io_safe_output(get_parameter('snmp3_privacy_pass'));
$tcp_port = (string) get_parameter ('tcp_port');
//See if id_agente is set (either POST or GET, otherwise -1
@ -542,7 +542,7 @@ if (!empty($interfaces_list)) {
$table->data[0][1] = '';
$table->data[0][2] = '<b>'.__('Modules').'</b>';
$table->data[1][0] = html_print_select ($interfaces_list, 'id_snmp[]', 0, false, '', '', true, true, true, '', false, 'width:200px;');
$table->data[1][0] = html_print_select ($interfaces_list, 'id_snmp[]', 0, false, '', '', true, true, true, '', false, 'width:500px;');
$table->data[1][1] = html_print_image('images/darrowright.png', true);
$table->data[1][2] = html_print_select (array (), 'module[]', 0, false, '', 0, true, true, true, '', false, 'width:200px;');
$table->data[1][2] .= html_print_input_hidden('agent', $id_agent, true);

View File

@ -135,6 +135,8 @@ $id_os = 9; // Windows
$custom_id = "";
$cascade_protection = 0;
$cascade_protection_modules = 0;
$safe_mode = 0;
$safe_mode_module = 0;
$icon_path = '';
$update_gis_data = 0;
$unit = "";
@ -166,6 +168,8 @@ if ($create_agent) {
$custom_id = (string) get_parameter_post ("custom_id",'');
$cascade_protection = (int) get_parameter_post ("cascade_protection", 0);
$cascade_protection_module = (int) get_parameter_post("cascade_protection_module", 0);
$safe_mode = (int) get_parameter_post ("safe_mode", 0);
$safe_mode_module = (int) get_parameter_post ("safe_mode_module", 0);
$icon_path = (string) get_parameter_post ("icon_path",'');
$update_gis_data = (int) get_parameter_post("update_gis_data", 0);
$url_description = (string) get_parameter("url_description");
@ -228,7 +232,7 @@ if ($create_agent) {
if ($id_agente !== false) {
// Create custom fields for this agent
foreach ($field_values as $key => $value) {
db_process_sql_insert ('tagent_custom_data',
$update_custom = db_process_sql_insert ('tagent_custom_data',
array('id_field' => $key, 'id_agent' => $id_agente,
'description' => $value));
}
@ -707,6 +711,7 @@ if ($update_agent) { // if modified some agent paramenter
$custom_id = (string) get_parameter_post ("custom_id", "");
$cascade_protection = (int) get_parameter_post ("cascade_protection", 0);
$cascade_protection_module = (int) get_parameter ("cascade_protection_module", 0);
$safe_mode_module = (int) get_parameter ("safe_mode_module", 0);
$icon_path = (string) get_parameter_post ("icon_path",'');
$update_gis_data = (int) get_parameter_post("update_gis_data", 0);
$url_description = (string) get_parameter("url_description");
@ -730,13 +735,17 @@ if ($update_agent) { // if modified some agent paramenter
if ($old_value === false) {
// Create custom field if not exist
db_process_sql_insert ('tagent_custom_data',
$update_custom = db_process_sql_insert ('tagent_custom_data',
array('id_field' => $key,'id_agent' => $id_agente, 'description' => $value));
}
else {
db_process_sql_update ('tagent_custom_data',
$update_custom = db_process_sql_update ('tagent_custom_data',
array('description' => $value),
array('id_field' => $key,'id_agent' => $id_agente));
if($update_custom == 1){
$update_custom_result = 1;
}
}
}
@ -782,7 +791,8 @@ if ($update_agent) { // if modified some agent paramenter
'update_gis_data' => $update_gis_data,
'url_address' => $url_description,
'url_address' => $url_description,
'quiet' => $quiet);
'quiet' => $quiet,
'safe_mode_module' => $safe_mode_module);
if ($config['metaconsole_agent_cache'] == 1) {
$values['update_module_count'] = 1; // Force an update of the agent cache.
@ -793,7 +803,9 @@ if ($update_agent) { // if modified some agent paramenter
WHERE id_group = ".$group_old);
$result = db_process_sql_update ('tagente', $values, array ('id_agente' => $id_agente));
if ($result == false) {
if ($result == false && $update_custom_result == false) {
ui_print_error_message(
__('There was a problem updating the agent'));
}
@ -900,6 +912,8 @@ if ($id_agente) {
$update_gis_data = $agent["update_gis_data"];
$url_description = $agent["url_address"];
$quiet = $agent["quiet"];
$safe_mode_module = $agent["safe_mode_module"];
$safe_mode = ($safe_mode_module) ? 1 : 0;
}
$update_module = (bool) get_parameter ('update_module');

View File

@ -201,13 +201,13 @@ switch ($sortField) {
switch ($sort) {
case 'up':
$selectRemoteUp = $selected;
$order = array('field' => 'remote ' . $order_collation,
$order = array('field' => 'remote ',
'field2' => 'nombre ' . $order_collation,
'order' => 'ASC');
break;
case 'down':
$selectRemoteDown = $selected;
$order = array('field' => 'remote ' . $order_collation,
$order = array('field' => 'remote ',
'field2' => 'nombre ' . $order_collation,
'order' => 'DESC');
break;

View File

@ -111,12 +111,12 @@ if (is_ajax ()) {
else
$snmp_community = (string) get_parameter ('snmp_community');
$snmp_version = get_parameter('snmp_version');
$snmp3_auth_user = get_parameter('snmp3_auth_user');
$snmp3_auth_user = io_safe_output(get_parameter('snmp3_auth_user'));
$snmp3_security_level = get_parameter('snmp3_security_level');
$snmp3_auth_method = get_parameter('snmp3_auth_method');
$snmp3_auth_pass = get_parameter('snmp3_auth_pass');
$snmp3_auth_pass = io_safe_output(get_parameter('snmp3_auth_pass'));
$snmp3_privacy_method = get_parameter('snmp3_privacy_method');
$snmp3_privacy_pass = get_parameter('snmp3_privacy_pass');
$snmp3_privacy_pass = io_safe_output(get_parameter('snmp3_privacy_pass'));
$snmp_port = get_parameter('snmp_port');
$snmpwalk = get_snmpwalk($ip_target, $snmp_version, $snmp_community,

View File

@ -590,8 +590,7 @@ $table_advanced->colspan[10][1] = 6;
if (isset($id_agente) && $moduletype == MODULE_DATA) {
$has_remote_conf = enterprise_hook('config_agents_has_remote_configuration',array($agent["id_agente"]));
if ($has_remote_conf) {
$table_advanced->data[11][0] = __('Cron from') .
ui_print_help_tip (__('If cron is set the module interval is ignored and the module runs on the specified date and time'), true);
$table_advanced->data[11][0] = __('Cron from') . ui_print_help_icon ('cron', true);
$table_advanced->data[11][1] = html_print_extended_select_for_cron ($hour_from, $minute_from, $mday_from, $month_from, $wday_from, true, $disabledBecauseInPolicy);
$table_advanced->colspan[11][1] = 6;
@ -600,8 +599,7 @@ if (isset($id_agente) && $moduletype == MODULE_DATA) {
$table_advanced->colspan[12][1] = 6;
}
else {
$table_advanced->data[11][0] = __('Cron from') .
ui_print_help_tip (__('If cron is set the module interval is ignored and the module runs on the specified date and time'), true);
$table_advanced->data[11][0] = __('Cron from') . ui_print_help_icon ('cron', true);
$table_advanced->data[11][1] = html_print_extended_select_for_cron ($hour_from, $minute_from, $mday_from, $month_from, $wday_from, true, true);
$table_advanced->colspan[11][1] = 6;
@ -611,8 +609,7 @@ if (isset($id_agente) && $moduletype == MODULE_DATA) {
}
}
else {
$table_advanced->data[11][0] = __('Cron from') .
ui_print_help_tip (__('If cron is set the module interval is ignored and the module runs on the specified date and time'), true);
$table_advanced->data[11][0] = __('Cron from') . ui_print_help_icon ('cron', true);
$table_advanced->data[11][1] = html_print_extended_select_for_cron ($hour_from, $minute_from, $mday_from, $month_from, $wday_from, true, $disabledBecauseInPolicy);
$table_advanced->colspan[11][1] = 6;

View File

@ -398,12 +398,12 @@ function snmpBrowserWindow () {
$('#text-target_ip').val($('#text-ip_target').val());
$('#text-community').val($('#text-snmp_community').val());
$('#snmp_browser_version').val($('#snmp_version').val());
$('#snmp3_browser_auth_user').val($('#snmp3_auth_user').val());
$('#text-snmp3_browser_auth_user').val($('#text-snmp3_auth_user').val());
$('#snmp3_browser_security_level').val($('#snmp3_security_level').val());
$('#snmp3_browser_auth_method').val($('#snmp3_auth_method').val());
$('#snmp3_browser_auth_pass').val($('#snmp3_auth_pass').val());
$('#password-snmp3_browser_auth_pass').val($('#password-snmp3_auth_pass').val());
$('#snmp3_browser_privacy_method').val($('#snmp3_privacy_method').val());
$('#snmp3_browser_privacy_pass').val($('#snmp3_privacy_pass').val());
$('#password-snmp3_browser_privacy_pass').val($('#password-snmp3_privacy_pass').val());
$("#snmp_browser_container").show().dialog ({
title: '',

View File

@ -165,8 +165,26 @@ if (is_ajax ()) {
$rfield = $editor_type_chkbx;
$rfield .= html_print_textarea ('field'.$i.'_recovery_value', 1, 1, '', 'class="fields_recovery"', true);
}
elseif(preg_match ("/^_content_type_$/i", $field_value)){
$editor_type_chkbx = "<div style=\"padding: 4px 0px;\"><b><small>";
$editor_type_chkbx .= __('Text/plain') . ui_print_help_tip (__("For sending emails only text plain"), true);
$editor_type_chkbx .= html_print_radio_button_extended ('field'.$i.'_value', 'text/plain', '', '', false, '', '', true);
$editor_type_chkbx .= "&nbsp;&nbsp;&nbsp;&nbsp;";
$editor_type_chkbx .= __('Text/html') . "&nbsp;&nbsp;";
$editor_type_chkbx .= html_print_radio_button_extended ('field'.$i.'_value', 'text/html', '', 'text/html', false, '', '', true);
$editor_type_chkbx .= "</small></b></div>";
$ffield = $editor_type_chkbx;
$editor_type_chkbx = "<div style=\"padding: 4px 0px;\"><b><small>";
$editor_type_chkbx .= __('Text/plain') . ui_print_help_tip (__("For sending emails only text plain"), true);
$editor_type_chkbx .= html_print_radio_button_extended ('field'.$i.'_recovery_value', 'text/plain', '', '', false, '', '', true);
$editor_type_chkbx .= "&nbsp;&nbsp;&nbsp;&nbsp;";
$editor_type_chkbx .= __('Text/html') . "&nbsp;&nbsp;";
$editor_type_chkbx .= html_print_radio_button_extended ('field'.$i.'_recovery_value', 'text/html', '', 'text/html', false, '', '', true);
$editor_type_chkbx .= "</small></b></div>";
$rfield = $editor_type_chkbx;
// Select type
else {
}else {
$fields_value_select = array();
$fv = explode(';', $field_value);

View File

@ -305,8 +305,33 @@ $(document).ready (function () {
// Replace the old column with the new
$table_macros_field.replaceWith(field_row);
if (old_value != '' || old_recovery_value != '') {
$("[name=field" + i + "_value]").val(old_value);
$("[name=field" + i + "_recovery_value]").val(old_recovery_value);
var inputType = $("[name=field" + i + "_value]").attr('type')
if (inputType == 'radio') {
if(old_value == 'text/plain'){
if ($("[name=field" + i + "_value]").val() == 'text/plain') {
$("[name=field" + i + "_value]").attr('checked','checked');
}
}
else{
if($("[name=field" + i + "_value]").val() == 'text/html') {
$("[name=field" + i + "_value]").attr('checked','checked');
}
}
if(old_recovery_value == 'text/plain'){
if ($("[name=field" + i + "_recovery_value]").val() == 'text/plain') {
$("[name=field" + i + "_recovery_value]").attr('checked','checked');
}
}
else{
if ($("[name=field" + i + "_recovery_value]").val() == 'text/html') {
$("[name=field" + i + "_recovery_value]").attr('checked','checked');
}
}
}
else {
$("[name=field" + i + "_value]").val(old_value);
$("[name=field" + i + "_recovery_value]").val(old_recovery_value);
}
}
else {
$("[name=field" + i + "_value]")

View File

@ -503,6 +503,10 @@ $table->data['edit3'][2] = __('SMNP community');
$table->data['edit3'][3] = html_print_input_text ('snmp_community', '',
'', 10, 100, true);
$table->data['edit15'][2] = __('SNMP OID');
$table->data['edit15'][3] = html_print_input_text ('snmp_oid', '',
'', 80, 80, true);
$target_ip_values = array();
$target_ip_values['auto'] = __('Auto');
$target_ip_values['force_pri'] = __('Force primary key');
@ -736,7 +740,8 @@ $(document).ready (function () {
"tr#delete_table-edit11, " +
"tr#delete_table-edit12, " +
"tr#delete_table-edit13, " +
"tr#delete_table-edit14").hide ();
"tr#delete_table-edit14, " +
"tr#delete_table-edit15").hide ();
var params = {
"page" : "operation/agentes/ver_agente",
@ -800,7 +805,8 @@ $(document).ready (function () {
"tr#delete_table-edit11, " +
"tr#delete_table-edit12, " +
"tr#delete_table-edit13, " +
"tr#delete_table-edit14").show ();
"tr#delete_table-edit14, " +
"tr#delete_table-edit15").show ();
}
function clean_lists() {
@ -829,7 +835,8 @@ $(document).ready (function () {
"tr#delete_table-edit11, " +
"tr#delete_table-edit12, " +
"tr#delete_table-edit13, " +
"tr#delete_table-edit14").hide ();
"tr#delete_table-edit14, " +
"tr#delete_table-edit15").hide ();
$('input[type=checkbox]').attr('checked', false);
$('input[type=checkbox]').attr('disabled', true);
@ -877,7 +884,8 @@ $(document).ready (function () {
"tr#delete_table-edit11, " +
"tr#delete_table-edit12, " +
"tr#delete_table-edit13, " +
"tr#delete_table-edit14").hide ();
"tr#delete_table-edit14, " +
"tr#delete_table-edit15").hide ();
}
}
}
@ -919,7 +927,8 @@ $(document).ready (function () {
"tr#delete_table-edit11, " +
"tr#delete_table-edit12, " +
"tr#delete_table-edit13, " +
"tr#delete_table-edit14").show ();
"tr#delete_table-edit14, " +
"tr#delete_table-edit15").show ();
}
else {
$(".select_agents_row_2").css('display', '');
@ -942,7 +951,8 @@ $(document).ready (function () {
"tr#delete_table-edit11, " +
"tr#delete_table-edit12, " +
"tr#delete_table-edit13, " +
"tr#delete_table-edit14").hide ();
"tr#delete_table-edit14, " +
"tr#delete_table-edit15").hide ();
}
}
}
@ -1026,7 +1036,8 @@ $(document).ready (function () {
"tr#delete_table-edit11, " +
"tr#delete_table-edit12, " +
"tr#delete_table-edit13, " +
"tr#delete_table-edit14").hide ();
"tr#delete_table-edit14, " +
"tr#delete_table-edit15").hide ();
jQuery.post ("ajax.php",
{"page" : "operation/agentes/ver_agente",
@ -1158,8 +1169,8 @@ function process_manage_edit ($module_name, $agents_select = null, $module_statu
/* List of fields which can be updated */
$fields = array ('dynamic_interval', 'dynamic_max', 'dynamic_min', 'dynamic_two_tailed', 'min_warning', 'max_warning', 'str_warning',
'min_critical', 'max_critical', 'str_critical', 'min_ff_event',
'module_interval', 'disabled', 'post_process', 'unit_select',
'snmp_community', 'tcp_send', 'custom_string_1',
'module_interval', 'disabled', 'post_process', 'unit',
'snmp_community','snmp_oid','tcp_send', 'custom_string_1',
'plugin_parameter', 'custom_string_2', 'custom_string_3', 'min',
'max', 'id_module_group', 'plugin_user', 'plugin_pass',
'id_export', 'history_data', 'critical_inverse',

View File

@ -129,7 +129,7 @@ else {
}
$snmp_version = (string) get_parameter('snmp_version');
$snmp3_auth_user = (string) get_parameter('snmp3_auth_user');
$snmp3_auth_user = (string) io_safe_output(get_parameter('snmp3_auth_user'));
$snmp3_auth_pass = io_input_password((string) get_parameter('snmp3_auth_pass'));
$snmp3_auth_method = (string) get_parameter('snmp3_auth_method');
$snmp3_privacy_method = (string) get_parameter('snmp3_privacy_method');

View File

@ -112,6 +112,10 @@ $netflow_filter = 0;
$max_values = 0;
$resolution = 0;
$lapse_calc = 0;
$lapse = 300;
$visual_format = 0;
//Others
$filter_search = "";
@ -148,6 +152,7 @@ switch ($action) {
case 'network_interfaces_report':
case 'availability':
case 'event_report_log':
case 'increment':
case 'availability_graph':
case 'agent_module':
$get_data_editor = true;
@ -195,12 +200,6 @@ switch ($action) {
$name = $item['name'];
switch ($type) {
case 'avg_value':
$period = $item['period'];
$description = $item['description'];
$idAgentModule = $item['id_agent_module'];
$idAgent = db_get_value_filter('id_agente', 'tagente_modulo', array('id_agente_modulo' => $idAgentModule));
break;
case 'event_report_log':
$period = $item['period'];
$description = $item['description'];
@ -282,6 +281,13 @@ switch ($action) {
$idAgent = db_get_value_filter('id_agente', 'tagente_modulo', array('id_agente_modulo' => $idAgentModule));
break;
case 'increment':
$description = $item['description'];
$idAgentModule = $item['id_agent_module'];
$idAgent = db_get_value_filter('id_agente', 'tagente_modulo', array('id_agente_modulo' => $idAgentModule));
$period = $item['period'];
break;
case 'SLA_services':
$description = $item['description'];
$period = $item['period'];
@ -312,6 +318,9 @@ switch ($action) {
$idAgent = db_get_value_filter('id_agente', 'tagente_modulo', array('id_agente_modulo' => $idAgentModule));
$idAgentModule = $item['id_agent_module'];
$period = $item['period'];
$lapse = $item['lapse'];
$lapse_calc = $item['lapse_calc'];
$visual_format = $item['visual_format'];
break;
case 'max_value':
$description = $item['description'];
@ -319,6 +328,9 @@ switch ($action) {
$idAgent = db_get_value_filter('id_agente', 'tagente_modulo', array('id_agente_modulo' => $idAgentModule));
$idAgentModule = $item['id_agent_module'];
$period = $item['period'];
$lapse = $item['lapse'];
$lapse_calc = $item['lapse_calc'];
$visual_format = $item['visual_format'];
break;
case 'min_value':
$description = $item['description'];
@ -326,6 +338,9 @@ switch ($action) {
$idAgent = db_get_value_filter('id_agente', 'tagente_modulo', array('id_agente_modulo' => $idAgentModule));
$idAgentModule = $item['id_agent_module'];
$period = $item['period'];
$lapse = $item['lapse'];
$lapse_calc = $item['lapse_calc'];
$visual_format = $item['visual_format'];
break;
case 'sumatory':
$description = $item['description'];
@ -593,6 +608,7 @@ switch ($action) {
case 'MTTR':
case 'simple_baseline_graph':
case 'event_report_log':
case 'increment':
$label = (isset($style['label'])) ? $style['label'] : '';
break;
default:
@ -1580,6 +1596,78 @@ You can of course remove the warnings, that's why we include the source and do n
?>
</td>
</tr>
<!-- advanced elements -->
<!-- <tr id="advanced_expansion">
<td colspan="2" style="cursor:pointer;" onclick="if($('.advanced_elements').css('display') == 'none'){$('.advanced_elements').css('display','table-row');}else{$('.advanced_elements').css('display','none');}">
+ ADVANCED
</td>
</tr> -->
<tr id="row_lapse_calc" style="" class="datos advanced_elements">
<td style="font-weight:bold;">
<?php echo __('Calculate for custom intervals'); ?>
</td>
<td style="">
<?php
html_print_checkbox('lapse_calc',1,$lapse_calc);?>
</td>
</tr>
<tr id="row_lapse" style="" class="datos advanced_elements">
<td style="font-weight:bold;">
<?php
echo __('Time lapse intervals');
ui_print_help_tip(__('Lapses of time in which the period is divided to make more precise calculations
'));
?>
</td>
<td style="">
<?php
html_print_extended_select_for_time('lapse', $lapse,
'', '', '0', 10,'','','','',!$lapse_calc);
?>
</td>
</tr>
<tr id="row_visual_format" style="" class="datos advanced_elements">
<td style="font-weight:bold;" colspan="2">
<?php
if($visual_format == 1){
$visual_format_table = true;
$visual_format_graph = false;
$visual_format_both = false;
}
elseif ($visual_format == 2) {
$visual_format_table = false;
$visual_format_graph = true;
$visual_format_both = false;
}
elseif ($visual_format == 3) {
$visual_format_table = false;
$visual_format_graph = false;
$visual_format_both = true;
}
echo __('Table only').'<span style="margin-left:10px;"></span>';
html_print_radio_button ('visual_format', 1, '', $visual_format_table,'',!$lapse_calc);
echo ('<span style="margin:30px;"></span>');
echo __('Graph only').'<span style="margin-left:10px;"></span>';
html_print_radio_button ('visual_format', 2, '', $visual_format_graph,'',!$lapse_calc);
echo ('<span style="margin:30px;"></span>');
echo __('Graph and table').'<span style="margin-left:10px;"></span>';
html_print_radio_button ('visual_format', 3, '', $visual_format_both,'',!$lapse_calc);
?>
</td>
</tr>
</tbody>
</table>
@ -2211,6 +2299,19 @@ $(document).ready (function () {
}
});
$("#checkbox-lapse_calc").change(function () {
if($(this).is(":checked")){
$( "#lapse_select" ).prop( "disabled", false );
$("[name=visual_format]").prop( "disabled", false );
}
else{
$( "#lapse_select" ).prop( "disabled", true );
$("[name=visual_format]").prop( "disabled", true );
}
});
});
function create_custom_graph() {
@ -2692,6 +2793,9 @@ function chooseType() {
$("#row_show_in_two_columns").hide();
$("#row_show_in_same_row").hide();
$("#row_historical_db_check").hide();
$("#row_lapse_calc").hide();
$("#row_lapse").hide();
$("#row_visual_format").hide();
$("#row_show_in_landscape").hide();
$('#row_hide_notinit_agents').hide();
$("#row_module_group").hide();
@ -2763,6 +2867,13 @@ function chooseType() {
$("#row_source").show();
$("#row_historical_db_check").hide();
break;
case 'increment':
$("#row_description").show();
$("#row_agent").show();
$("#row_module").show();
$("#row_period").show();
break;
case 'simple_graph':
$("#row_time_compare_overlapped").show();
@ -2884,6 +2995,9 @@ function chooseType() {
$("#row_module").show();
$("#row_period").show();
$("#row_show_in_two_columns").show();
$("#row_lapse_calc").show();
$("#row_lapse").show();
$("#row_visual_format").show();
$("#row_historical_db_check").hide();
break;
@ -2893,6 +3007,9 @@ function chooseType() {
$("#row_module").show();
$("#row_period").show();
$("#row_show_in_two_columns").show();
$("#row_lapse_calc").show();
$("#row_lapse").show();
$("#row_visual_format").show();
$("#row_historical_db_check").hide();
break;
@ -2902,6 +3019,9 @@ function chooseType() {
$("#row_module").show();
$("#row_period").show();
$("#row_show_in_two_columns").show();
$("#row_lapse_calc").show();
$("#row_lapse").show();
$("#row_visual_format").show();
$("#row_historical_db_check").hide();
break;

View File

@ -1069,6 +1069,15 @@ switch ($action) {
$values['period'] = get_parameter('period');
$good_format = true;
break;
case 'min_value':
case 'max_value':
case 'avg_value':
$values['period'] = get_parameter('period');
$values['lapse_calc'] = get_parameter('lapse_calc');
$values['lapse'] = get_parameter('lapse');
$values['visual_format'] = get_parameter('visual_format');
$good_format = true;
break;
default:
$values['period'] = get_parameter('period');
$values['top_n'] = get_parameter('radiobutton_max_min_avg',0);
@ -1404,6 +1413,15 @@ switch ($action) {
$values['period'] = get_parameter('period');
$good_format = true;
break;
case 'min_value':
case 'max_value':
case 'avg_value':
$values['period'] = get_parameter('period');
$values['lapse_calc'] = get_parameter('lapse_calc');
$values['lapse'] = get_parameter('lapse');
$values['visual_format'] = get_parameter('visual_format');
$good_format = true;
break;
default:
$values['period'] = get_parameter('period');
$values['top_n'] = get_parameter('radiobutton_max_min_avg',0);

View File

@ -180,6 +180,7 @@ ui_require_javascript_file ('encode_decode_base64');
tinyMCE.init({
mode : "exact",
elements: "text-label",
convert_urls: false,
theme : "advanced",
<?php
if ($config['style'] == 'pandora_legacy') {

View File

@ -413,6 +413,8 @@ switch ($activeTab) {
$value_show = get_parameter ("value_show", 'percent');
$label_type = get_parameter ("label_type", 'agent_module');
$enable_link = get_parameter ("enable_link", 'enable_link');
$show_on_top = get_parameter ("show_on_top", 0);
// This var switch between creation of items, item_per_agent = 0 => item per module; item_per_agent <> 0 => item per agent
$item_per_agent = get_parameter ("item_per_agent", 0);
$id_server = (int)get_parameter('servers', 0);

View File

@ -106,6 +106,18 @@ if (is_ajax ()) {
$row['name'] = __('Login attribute');
$row['control'] = html_print_input_text ('ldap_login_attr', $config['ldap_login_attr'], '', 60, 100, true);
$table->data['ldap_login_attr'] = $row;
// Admin LDAP login
$row = array();
$row['name'] = __('Admin LDAP login');
$row['control'] = html_print_input_text ('ldap_admin_login', $config['ldap_admin_login'], '', 60, 100, true);
$table->data['ldap_admin_login'] = $row;
// Admin LDAP password
$row = array();
$row['name'] = __('Admin LDAP password');
$row['control'] = html_print_input_password ('ldap_admin_pass', $config['ldap_admin_pass'], $alt = '', 60, 100, true);
$table->data['ldap_admin_pass'] = $row;
break;
case 'pandora':

View File

@ -28,6 +28,7 @@ $update_filter = (int) get_parameter ('update_filter', -2);
$delete_filter = (int) get_parameter ('delete_filter', -1);
$description = (string) get_parameter ('description', '');
$filter = (string) get_parameter ('filter', '');
$index_post = (int) get_parameter('index_post', 0);
// Create/update header
if ($edit_filter > -2) {
@ -44,9 +45,35 @@ else {// Overview header
// Create/update filter
if ($update_filter > -2) {
// UPDATE
if ($update_filter > -1) {
$values = array('description' => $description, 'filter' => $filter);
$result = db_process_sql_update('tsnmp_filter', $values, array('id_snmp_filter' => $update_filter));
$new_unified_id = (db_get_value_sql("SELECT unified_filters_id FROM tsnmp_filter WHERE id_snmp_filter = " . $update_filter));
$elements = get_parameter('elements', array());
$elements = explode(",", $elements);
foreach ($elements as $e) {
$filter = get_parameter('filter_' . $e);
$values = array('description' => $description, 'filter' => $filter, 'unified_filters_id' => $new_unified_id);
$result = db_process_sql_update('tsnmp_filter', $values, array('id_snmp_filter' => $e));
}
if (count($elements) == 1) {
$new_unified_id = (db_get_value_sql("SELECT MAX(unified_filters_id) FROM tsnmp_filter")) + 1;
$filter = get_parameter('filter_' . $elements[0]);
$values = array('description' => $description, 'filter' => $filter, 'unified_filters_id' => $new_unified_id);
$result = db_process_sql_update('tsnmp_filter', $values, array('id_snmp_filter' => $elements[0]));
}
for ($i = 1; $i < $index_post; $i++) {
$filter = get_parameter('filter_' . $i);
if ($filter != "") {
$values = array(
'description' => $description,
'filter' => $filter,
'unified_filters_id' => $new_unified_id);
$result = db_process_sql_insert('tsnmp_filter', $values);
}
}
if ($result === false) {
ui_print_error_message (__('There was a problem updating the filter'));
}
@ -54,11 +81,29 @@ if ($update_filter > -2) {
ui_print_success_message (__('Successfully updated'));
}
}
// CREATE
else {
$values = array(
'description' => $description,
'filter' => $filter);
$result = db_process_sql_insert('tsnmp_filter', $values);
$new_unified_id = (db_get_value_sql("SELECT MAX(unified_filters_id) FROM tsnmp_filter")) + 1;
if ($index_post == 1) {
$filter = get_parameter('filter_0');
$values = array(
'description' => $description,
'filter' => $filter,
'unified_filters_id' => 0);
$result = db_process_sql_insert('tsnmp_filter', $values);
}
else {
for ($i = 0; $i < $index_post; $i++) {
$filter = get_parameter('filter_' . $i);
$values = array(
'description' => $description,
'filter' => $filter,
'unified_filters_id' => $new_unified_id);
$result = db_process_sql_insert('tsnmp_filter', $values);
}
}
if ($result === false) {
ui_print_error_message (__('There was a problem creating the filter'));
}
@ -68,7 +113,15 @@ if ($update_filter > -2) {
}
}
else if ($delete_filter > -1) { // Delete
$result = db_process_sql_delete('tsnmp_filter', array('id_snmp_filter' => $delete_filter));
$unified_id_to_delete = (db_get_value_sql("SELECT unified_filters_id FROM tsnmp_filter WHERE id_snmp_filter = " . $delete_filter));
if ($unified_id_to_delete == 0) {
$result = db_process_sql_delete('tsnmp_filter', array('id_snmp_filter' => $delete_filter));
}
else {
$result = db_process_sql_delete('tsnmp_filter', array('unified_filters_id' => $unified_id_to_delete));
}
if ($result === false) {
ui_print_error_message (__('There was a problem deleting the filter'));
}
@ -88,19 +141,50 @@ if ($edit_filter > -1) {
// Create/update form
if ($edit_filter > -2) {
$index = $index_post;
$table->data = array ();
$table->id = 'filter_table';
$table->width = '100%';
$table->class = 'databox filters';
$table->data[0][0] = __('Description');
$table->data[0][1] = html_print_input_text ('description', $description, '', 60, 100, true);
$table->data[1][0] = __('Filter');
$table->data[1][1] = html_print_input_text ('filter', $filter, '', 60, 100, true);
$table->data[1][1] .= ui_print_help_tip (__("This field contains a substring, could be part of a IP address, a numeric OID, or a plain substring") . SEPARATOR_COLUMN, true);
if ($edit_filter > -1) {
$filters = db_get_all_rows_sql("SELECT * FROM tsnmp_filter WHERE unified_filters_id = (SELECT unified_filters_id FROM tsnmp_filter WHERE id_snmp_filter = " . $edit_filter . ")");
$j = 1;
foreach ($filters as $f) {
if ($j != 1) {
$table->data[$j][0] = "";
}
$table->data[$j][1] = html_print_input_text ('filter_' . $f['id_snmp_filter'], $f['filter'], '', 60, 100, true);
if ($j == 1) {
$table->data[$j][1] .= ui_print_help_tip (__("This field contains a substring, could be part of a IP address, a numeric OID, or a plain substring") . SEPARATOR_COLUMN, true);
}
else {
$table->data[$j][1] .= html_print_image('images/cross.png', true, array('id' => 'delete_filter_' . $f['id_snmp_filter'], 'alt' => __('Click to add new filter'), 'title' => __('Click to add new filter')));
}
$j++;
$index++;
}
}
else {
$table->data[1][1] = html_print_input_text ('filter_' . $index, $filter, '', 60, 100, true);
$table->data[1][1] .= ui_print_help_tip (__("This field contains a substring, could be part of a IP address, a numeric OID, or a plain substring") . SEPARATOR_COLUMN, true);
}
$index++;
echo '<form action="index.php?sec=snmpconsole&sec2=godmode/snmpconsole/snmp_filters" method="post">';
html_print_input_hidden ('update_filter', $edit_filter);
html_print_input_hidden ('index_post', $index);
if ($edit_filter > -1) {
$filters_to_post = array();
foreach ($filters as $fil) {
$filters_to_post[] = $fil['id_snmp_filter'];
}
html_print_input_hidden ('elements', implode(",", $filters_to_post));
}
html_print_table ($table);
echo '<div class="action-buttons" style="width: '.$table->width.'">';
html_print_image('images/add.png', false, array('id' => 'add_filter', 'alt' => __('Click to add new filter'), 'title' => __('Click to add new filter'), 'style' => 'float:left;'));
if ($edit_filter > -1) {
html_print_submit_button (__('Update'), 'submit_button', false, 'class="sub upd"');
}
@ -112,13 +196,13 @@ if ($edit_filter > -2) {
// Overview
}
else {
$result = db_get_all_rows_in_table ("tsnmp_filter");
if ($result === false) {
$result = array ();
require_once ($config['homedir'] . "/general/firts_task/snmp_filters.php");
return;
$result_unified = db_get_all_rows_sql("SELECT DISTINCT(unified_filters_id) FROM tsnmp_filter ORDER BY unified_filters_id ASC");
$aglomerate_result = array();
foreach ($result_unified as $res) {
$aglomerate_result[$res['unified_filters_id']] = db_get_all_rows_sql("SELECT * FROM tsnmp_filter WHERE unified_filters_id = " . $res['unified_filters_id'] . " ORDER BY id_snmp_filter ASC");
}
$table->data = array ();
$table->head = array ();
$table->size = array ();
@ -133,16 +217,43 @@ else {
$table->head[2] = __('Action');
$table->size[2] = "50px";
$table->align[2] = 'center';
foreach ($result as $row) {
$data = array ();
$data[0] = '<a href="index.php?sec=snmpconsole&sec2=godmode/snmpconsole/snmp_filters&edit_filter='.$row['id_snmp_filter'].'">' . $row['description'] . '</a>';
$data[1] = $row['filter'];
$data[2] = '<a href="index.php?sec=snmpconsole&sec2=godmode/snmpconsole/snmp_filters&edit_filter='.$row['id_snmp_filter'].'">' .
html_print_image("images/config.png", true, array("border" => '0', "alt" => __('Update'))) . '</a>' .
'&nbsp;&nbsp;<a onclick="if (confirm(\'' . __('Are you sure?') . '\')) return true; else return false;" href="index.php?sec=snmpconsole&sec2=godmode/snmpconsole/snmp_filters&delete_filter='.$row['id_snmp_filter'].'">' .
html_print_image("images/cross.png", true, array("border" => '0', "alt" => __('Delete'))) . '</a>';
array_push ($table->data, $data);
foreach ($aglomerate_result as $ind => $row) {
if ($ind == 0) {
foreach ($row as $r) {
$data = array ();
$data[0] = '<a href="index.php?sec=snmpconsole&sec2=godmode/snmpconsole/snmp_filters&edit_filter='.$r['id_snmp_filter'].'">' . $r['description'] . '</a>';
$data[1] = $r['filter'];
$data[2] = '<a href="index.php?sec=snmpconsole&sec2=godmode/snmpconsole/snmp_filters&edit_filter='.$r['id_snmp_filter'].'">' .
html_print_image("images/config.png", true, array("border" => '0', "alt" => __('Update'))) . '</a>' .
'&nbsp;&nbsp;<a onclick="if (confirm(\'' . __('Are you sure?') . '\')) return true; else return false;" href="index.php?sec=snmpconsole&sec2=godmode/snmpconsole/snmp_filters&delete_filter='.$r['id_snmp_filter'].'">' .
html_print_image("images/cross.png", true, array("border" => '0', "alt" => __('Delete'))) . '</a>';
array_push ($table->data, $data);
}
}
else {
$ind2 = 0;
$compose_filter = array();
$compose_id = "";
$compose_action = "";
foreach ($row as $i => $r) {
if ($ind2 == 0) {
$compose_id = '<a href="index.php?sec=snmpconsole&sec2=godmode/snmpconsole/snmp_filters&edit_filter='.$r['id_snmp_filter'].'">' . $r['description'] . '</a>';
$compose_action = '<a href="index.php?sec=snmpconsole&sec2=godmode/snmpconsole/snmp_filters&edit_filter='.$r['id_snmp_filter'].'">' .
html_print_image("images/config.png", true, array("border" => '0', "alt" => __('Update'))) . '</a>' .
'&nbsp;&nbsp;<a onclick="if (confirm(\'' . __('Are you sure?') . '\')) return true; else return false;" href="index.php?sec=snmpconsole&sec2=godmode/snmpconsole/snmp_filters&delete_filter='.$r['id_snmp_filter'].'">' .
html_print_image("images/cross.png", true, array("border" => '0', "alt" => __('Delete'))) . '</a>';
$ind2++;
}
$compose_filter[] = $r['filter'];
}
$data = array ();
$data[0] = $compose_id;
$data[1] = implode(" AND ", $compose_filter);
$data[2] = $compose_action;
array_push ($table->data, $data);
}
}
if (!empty ($table->data)) {
@ -157,3 +268,44 @@ else {
echo '</form></div>';
}
?>
<script type="text/javascript">
var id = "<?php echo $index; ?>";
$(document).ready (function () {
$('#add_filter').click(function(e) {
$('#filter_table').append('<tr id="filter_table-' + id + '" style="" class="datos"><td id="filter_table-' + id + '-0" style="" class="datos "></td><td id="filter_table-' + id + '-1" style="" class="datos "><input type="text" name="filter_' + id + '" value="" id="text-filter_' + id + '" size="60" maxlength="100"><img src="http://localhost/pandora_console/images/cross.png" onclick="delete_this_row(' + id + ');" data-title="Click to delete the filter" data-use_title_for_force_title="1" class="forced_title" alt="Click to delete the filter"></td></tr>');
id++;
$('#hidden-index_post').val(id);
});
$('[id^=delete_filter_]').click(function(e) {
var elem_id = this.id;
var id_array = elem_id.split("delete_filter_");
var id = id_array[1];
params = {};
params['page'] = "include/ajax/snmp.ajax";
params['delete_snmp_filter'] = 1;
params['filter_id'] = id;
jQuery.ajax ({
data: params,
type: "POST",
url: "ajax.php",
dataType: "html",
success: function(data){
var elem = $('#hidden-elements').val();
$('#hidden-elements').val(elem - 1);
$('#' + elem_id).parent().parent().remove();
}
});
});
});
function delete_this_row (id_row) {
$('#filter_table-' + id_row).remove();
}
</script>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 693 B

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 700 B

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 695 B

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 694 B

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 753 B

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 760 B

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 763 B

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 565 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 769 B

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 283 B

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 279 B

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 284 B

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 279 B

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 905 B

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 908 B

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 912 B

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 923 B

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 705 B

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 708 B

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 719 B

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 586 B

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 574 B

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 589 B

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 577 B

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 778 B

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 769 B

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 791 B

After

Width:  |  Height:  |  Size: 1.5 KiB

Some files were not shown because too many files have changed in this diff Show More