Merge branch 'develop' into 1242-Unificar-ayudas-de-alertas

Conflicts:
	pandora_console/include/help/en/help_alert_config.php
	pandora_console/include/help/en/help_alert_macros.php
	pandora_console/include/help/es/help_alert_config.php
	pandora_console/include/help/es/help_alert_macros.php
This commit is contained in:
enriquecd 2017-11-30 11:47:47 +01:00
commit 4f3f2525e1
352 changed files with 9406 additions and 2124 deletions

View File

@ -1,8 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<project version="4"> <project version="4">
<component name="EntryPointsManager">
<entry_points version="2.0" />
</component>
<component name="NullableNotNullManager"> <component name="NullableNotNullManager">
<option name="myDefaultNullable" value="android.support.annotation.Nullable" /> <option name="myDefaultNullable" value="android.support.annotation.Nullable" />
<option name="myDefaultNotNull" value="android.support.annotation.NonNull" /> <option name="myDefaultNotNull" value="android.support.annotation.NonNull" />
@ -27,17 +24,7 @@
</value> </value>
</option> </option>
</component> </component>
<component name="ProjectLevelVcsManager" settingsEditedManually="false"> <component name="ProjectRootManager" version="2" languageLevel="JDK_1_6" default="true" project-jdk-name="JDK" project-jdk-type="JavaSDK">
<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">
<output url="file://$PROJECT_DIR$/build/classes" /> <output url="file://$PROJECT_DIR$/build/classes" />
</component> </component>
<component name="ProjectType"> <component name="ProjectType">

View File

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

View File

@ -159,7 +159,13 @@ 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")); registerReceiver(onBroadcast, new IntentFilter("eventlist.java"));

View File

@ -96,10 +96,29 @@ public class Main extends Activity {
Activity.MODE_PRIVATE); Activity.MODE_PRIVATE);
setContentView(R.layout.main); 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 Button buttonSetAsFilterWatcher = (Button) findViewById(R.id.button_set_as_filter_watcher);
final ImageButton buttonSearch = (ImageButton) findViewById(R.id.refresh_icon_button_main); final ImageButton buttonSearch = (ImageButton) findViewById(R.id.refresh_icon_button_main);
final ImageButton buttonDeleteProfile = (ImageButton) findViewById(R.id.button_delete_profile); final ImageButton buttonDeleteProfile = (ImageButton) findViewById(R.id.button_delete_profile);
final ImageButton buttonSaveProfile = (ImageButton) findViewById(R.id.button_save_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. // Check if the user preferences it is set.
if (object.user.length() == 0 || object.password.length() == 0 if (object.user.length() == 0 || object.password.length() == 0
|| object.url.length() == 0) { || object.url.length() == 0) {

View File

@ -63,8 +63,22 @@
android:layout_weight="0" android:layout_weight="0"
android:padding="0dp" android:padding="0dp"
android:src="@drawable/filter_icon_button" 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:background="@null"
/> android:tint="@android:color/white"
android:src="@android:drawable/ic_menu_preferences" />
</LinearLayout> </LinearLayout>
<LinearLayout <LinearLayout

View File

@ -64,6 +64,21 @@
android:background="@null" android:background="@null"
android:padding="0dp" android:padding="0dp"
android:src="@drawable/icon_filter_pressed" /> 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>
<LinearLayout <LinearLayout

View File

@ -4,7 +4,7 @@ buildscript {
jcenter() jcenter()
} }
dependencies { 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 distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists 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 # Base config file for Pandora FMS agents
# Version 7.0NG.714, AIX version # Version 7.0NG.716, AIX version
# Licensed under GPL license v2, # Licensed under GPL license v2,
# Copyright (c) 2003-2010 Artica Soluciones Tecnologicas # Copyright (c) 2003-2010 Artica Soluciones Tecnologicas
# http://www.pandorafms.com # http://www.pandorafms.com

View File

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

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents # 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, # Licensed under GPL license v2,
# Copyright (c) 2003-2009 Artica Soluciones Tecnologicas # Copyright (c) 2003-2009 Artica Soluciones Tecnologicas
# http://www.pandorafms.com # http://www.pandorafms.com

View File

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

View File

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

View File

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

View File

@ -1,6 +1,6 @@
# Base config file for Pandora FMS Windows Agent # Base config file for Pandora FMS Windows Agent
# (c) 2006-2010 Artica Soluciones Tecnologicas # (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 # 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 # 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 # Fichero de configuracion base de agentes de Pandora
# Base config file for Pandora agents # Base config file for Pandora agents
# Version 7.0NG.714, AIX version # Version 7.0NG.716, AIX version
# General Parameters # General Parameters
# ================== # ==================

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents # 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, # Licensed under GPL license v2,
# Copyright (c) 2003-2009 Artica Soluciones Tecnologicas # Copyright (c) 2003-2009 Artica Soluciones Tecnologicas
# http://www.pandorafms.com # http://www.pandorafms.com

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -9,8 +9,8 @@
# Please see http://www.pandorafms.org. This code is licensed under GPL 2.0 license. # Please see http://www.pandorafms.org. This code is licensed under GPL 2.0 license.
# ********************************************************************** # **********************************************************************
PI_VERSION="7.0NG.714" PI_VERSION="7.0NG.716"
PI_BUILD="171026" PI_BUILD="171130"
OS_NAME=`uname -s` OS_NAME=`uname -s`
FORCE=0 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 # Base config file for Pandora FMS Windows Agent
# (c) 2006-2014 Artica Soluciones Tecnologicas # (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 # 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 # under the terms of the GNU General Public Licence as published by the Free Software
@ -21,6 +21,13 @@ server_ip $ServerIP$
server_path /var/spool/pandora/data_in server_path /var/spool/pandora/data_in
temporal "%ProgramFiles%\pandora_agent\temp" temporal "%ProgramFiles%\pandora_agent\temp"
# Group assigned for this agent (descriptive, p.e: Servers)
group $GroupName$
# If set to 1 allows the agent to be configured via the web console
# (only works on enterprise version). Set to 0 to disable it
remote_config 0
#include "C:\Archivos de programa\pandora_agent\pandora_agent_alt.conf" #include "C:\Archivos de programa\pandora_agent\pandora_agent_alt.conf"
#broker_agent name_agent #broker_agent name_agent
@ -43,15 +50,10 @@ agent_name_cmd __rand__
# address: Enforce to server a ip address to this agent # address: Enforce to server a ip address to this agent
# You can also try to detect the first IP using "auto", for example # You can also try to detect the first IP using "auto", for example
address auto address auto
# or setting a fixed IP address, like for example: # or setting a fixed IP address, like for example:
#address 192.168.36.73 #address 192.168.36.73
# Group assigned for this agent (descriptive, p.e: Servers)
group Servers
# This limits operation if temporal dir has not enough free disk. # This limits operation if temporal dir has not enough free disk.
#temporal_min_size 1024 #temporal_min_size 1024
@ -80,10 +82,6 @@ server_port 41121
# Debug mode renames XML in the temp folder and continues running # Debug mode renames XML in the temp folder and continues running
# debug 1 # debug 1
# If set to 1 allows the agent to be configured via the web console
# (only works on enterprise version). Set to 0 to disable it
remote_config 0
# XML encoding (ISO-8859-1 by default). Most windows servers experience problems when you set to UTF-8. Other special codepages may be specified here. # XML encoding (ISO-8859-1 by default). Most windows servers experience problems when you set to UTF-8. Other special codepages may be specified here.
#encoding ISO-8859-1 #encoding ISO-8859-1
@ -102,6 +100,10 @@ xml_buffer 1
# Agent mode: Learn (default), No-learn, Autodisable # Agent mode: Learn (default), No-learn, Autodisable
# agent_mode autodisable # agent_mode autodisable
# EHorus configuration file default full path.
#It try to find the EKID and set it like a custom field.
ehorus_conf "C:\Program Files\ehorus_agent\ehorus_agent.conf"
# Secondary server configuration # Secondary server configuration
# ============================== # ==============================
@ -127,74 +129,166 @@ xml_buffer 1
#process_firefox_stop killall firefox #process_firefox_stop killall firefox
#service_messenger 1 #service_messenger 1
###############################################
# Module Definition # Module Definition
# Check online documentation and module library at http://pandorafms.org # Check online documentation and module library at http://pandorafms.org
# ================= # =================
# Get Network information using Agent plugin # CPU Load using WMI
module_plugin cscript //B "%ProgramFiles%\Pandora_Agent\util\nettraffic.vbs"
# Get disk occupation (percent)
module_plugin cscript.exe //B "%ProgramFiles%\Pandora_Agent\util\df_percent.vbs"
# External inventory plugin
module_begin
module_plugin cscript.exe //B "%ProgramFiles%\Pandora_Agent\util\software_installed.vbs"
module_interval 288
# 288 x 5min = 24 hr, one execution per day, using module_interval <factor>
module_end
# CPU Load
module_begin module_begin
module_name CPU Load module_name CPU Load
module_type generic_data module_type generic_data
#module_wmiquery SELECT LoadPercentage FROM Win32_Processor module_wmiquery SELECT LoadPercentage FROM Win32_Processor
#module_wmicolumn LoadPercentage module_wmicolumn LoadPercentage
module_cpuusage all module_max 100
module_description CPU Load (%) module_min 0
module_unit % module_description User CPU Usage (%)
module_min_warning 80 module_min_warning 70
module_max_warning 90 module_max_warning 90
module_min_critical 91 module_min_critical 91
module_max_critical 100 module_max_critical 100
module_unit %
module_group System
module_end module_end
# Number processes # Basic info about TCP Connection
module_begin module_begin
module_name Number processes module_name TCP_Connections
module_type generic_data module_type generic_data
module_exec tasklist | gawk "NR > 3 {print$0}" | wc -l module_exec netstat -an | find /c /v "estab"
module_description Number of processes running module_description Total number of TCP connections active
module_min_warning 175 module_group Networking
module_max_warning 249
module_min_critical 250
module_max_critical 300
module_end module_end
# Example plugin to retrieve drive usage
module_plugin cscript.exe //B "%ProgramFiles%\Pandora_Agent\util\df_percent_used.vbs"
# Example plugin to retrieve memory usage
module_plugin cscript.exe //B "%ProgramFiles%\Pandora_Agent\util\mem_percent_used.vbs"
# Example plugin to retrieve network usage
module_plugin cscript.exe //B "%ProgramFiles%\Pandora_Agent\util\network.vbs"
## Windows inventory module (This information will be displayed only in enterprise version)
## Please check the WMI is healthy before activate this functionality
#module_begin
#module_plugin cscript.exe //B //t:20 "%PROGRAMFILES%\Pandora_Agent\util\cpuinfo.vbs"
#module_crontab * 12-15 * * 1
#module_end
#module_begin
#module_plugin cscript.exe //B //t:20 "%PROGRAMFILES%\Pandora_Agent\util\moboinfo.vbs"
#module_crontab * 12-15 * * 1
#module_end
#module_begin
#module_plugin cscript.exe //B //t:20 "%PROGRAMFILES%\Pandora_Agent\util\diskdrives.vbs"
#module_crontab * 12-15 * * 1
#module_end
#module_begin
#module_plugin cscript.exe //B //t:20 "%PROGRAMFILES%\Pandora_Agent\util\cdromdrives.vbs"
#module_crontab * 12-15 * * 1
#module_end
#module_begin
#module_plugin cscript.exe //B //t:20 "%PROGRAMFILES%\Pandora_Agent\util\videocardinfo.vbs"
#module_crontab * 12-15 * * 1
#module_end
#module_begin
#module_plugin cscript.exe //B //t:20 "%PROGRAMFILES%\Pandora_Agent\util\ifaces.vbs"
#module_crontab * 12-15 * * 1
#module_end
#module_begin
#module_plugin cscript.exe //B //t:20 "%PROGRAMFILES%\Pandora_Agent\util\monitors.vbs"
#module_crontab * 12-15 * * 1
#module_end
#module_begin
#module_plugin cscript.exe //B //t:20 "%PROGRAMFILES%\Pandora_Agent\util\printers.vbs"
#module_crontab * 12-15 * * 1
#module_end
#module_begin
#module_plugin cscript.exe //B //t:20 "%PROGRAMFILES%\Pandora_Agent\util\raminfo.vbs"
#module_crontab * 12-15 * * 1
#module_end
#module_begin
#module_plugin cscript.exe //B //t:20 "%PROGRAMFILES%\Pandora_Agent\util\software_installed.vbs"
#module_crontab * 12-15 * * 1
#module_end
#module_begin
#module_plugin cscript.exe //B //t:20 "%PROGRAMFILES%\Pandora_Agent\util\userslogged.vbs"
#module_crontab * 12-15 * * 1
#module_end
#module_begin
#module_plugin cscript.exe //B //t:20 "%PROGRAMFILES%\Pandora_Agent\util\productkey.vbs"
#module_crontab * 12-15 * * 1
#module_end
#module_begin
#module_plugin cscript.exe //B //t:20 "%PROGRAMFILES%\Pandora_Agent\util\productID.vbs"
#module_crontab * 12-15 * * 1
#module_end
#########################################
# EXAMPLES #
#########################################
# Example: get Network information using Agent plugin
#module_plugin cscript //B "%ProgramFiles%\Pandora_Agent\util\nettraffic.vbs"
# External inventory plugin
#module_begin
#module_plugin cscript.exe //B "%ProgramFiles%\Pandora_Agent\util\software_installed.vbs"
#module_interval 288
## 288 x 5min = 24 hr, one execution per day, using module_interval <factor>
#module_end
# Free Memory # Free Memory
module_begin #module_begin
module_name FreeMemory #module_name FreeMemory
module_type generic_data #module_type generic_data
module_freepercentmemory #module_freepercentmemory
module_unit % #module_description Free memory (%).
module_description Free memory (%). #module_min_warning 21
module_min_warning 21 #module_max_warning 30
module_max_warning 30 #module_min_critical 0
module_min_critical 0 #module_max_critical 20
module_max_critical 20 #module_end
module_end
# Log events # Log events
#module_begin
#module_name System Events (TermService)
#module_type async_string
#module_logevent
#module_description Log Events coming from Terminal Service
#module_source System
#module_application TermService
#module_end
module_begin #module_begin
module_name Security Events (Invalid Login) #module_name Security Events (Invalid Login)
module_type async_string #module_type async_string
module_description Security log events for invalid login attempt #module_description Security log events for invalid login attempt
module_logevent #module_logevent
module_source Security #module_source Security
module_eventcode 529 #module_eventcode 529
module_end #module_end
# Check if Dhcp service is enabled
#module_begin
#module_name DHCP Enabled
#module_type generic_proc
#module_service Dhcp
#module_description Check DCHP service enabled
#module_end
#Antivirus monitoring #Antivirus monitoring
#This modules checks the antivirus is running on your system, if there is and antivirus #This modules checks the antivirus is running on your system, if there is and antivirus
@ -207,72 +301,51 @@ module_end
#module_description Last update for Antivirus Signature file #module_description Last update for Antivirus Signature file
#module_end #module_end
## Windows inventory module (This information will be displayed only in enterprise version) # Number processes
## Please check the WMI is healthy before activate this functionality #module_begin
#module_name Number processes
#module_type generic_data
#module_exec tasklist | gawk "NR > 3 {print$0}" | wc -l
#module_description Number of processes running
#module_min_warning 175
#module_max_warning 249
#module_min_critical 250
#module_max_critical 300
#module_end
# module_begin # Example plugin to retrieve drive usage
# module_plugin cscript.exe //B //t:20 "%PROGRAMFILES%\Pandora_Agent\util\cpuinfo.vbs" #module_plugin cscript.exe //B "%ProgramFiles%\Pandora_Agent\util\df.vbs"
# module_crontab * 12-15 * * 1
# module_end
# module_begin # Free space on disk C: (%)
# module_plugin cscript.exe //B //t:20 "%PROGRAMFILES%\Pandora_Agent\util\moboinfo.vbs" #module_begin
# module_crontab * 12-15 * * 1 #module_name FreeDiskC
# module_end #module_type generic_data
#module_freepercentdisk C:
#module_description Free space on drive C: (%)
#module_min_warning 31
#module_max_warning 40
#module_min_critical 0
#module_max_critical 30
#module_end
# module_begin # CPU usage percentage
# module_plugin cscript.exe //B //t:20 "%PROGRAMFILES%\Pandora_Agent\util\diskdrives.vbs" #module_begin
# module_crontab * 12-15 * * 1 #module_name CPUUse
# module_end #module_type generic_data
#module_cpuusage all
#module_description CPU# usage
#module_min_warning 70
#module_max_warning 90
#module_min_critical 91
#module_max_critical 100
#module_end
# Free space on disk D: (%)
# module_begin # module_begin
# module_plugin cscript.exe //B //t:20 "%PROGRAMFILES%\Pandora_Agent\util\cdromdrives.vbs" # module_name FreeDiskD
# module_crontab * 12-15 * * 1 # module_type generic_data
# module_end # module_freepercentdisk D:
# module_description Free space on drive D: (%)
# module_begin
# module_plugin cscript.exe //B //t:20 "%PROGRAMFILES%\Pandora_Agent\util\videocardinfo.vbs"
# module_crontab * 12-15 * * 1
# module_end
# module_begin
# module_plugin cscript.exe //B //t:20 "%PROGRAMFILES%\Pandora_Agent\util\ifaces.vbs"
# module_crontab * 12-15 * * 1
# module_end
# module_begin
# module_plugin cscript.exe //B //t:20 "%PROGRAMFILES%\Pandora_Agent\util\monitors.vbs"
# module_crontab * 12-15 * * 1
# module_end
# module_begin
# module_plugin cscript.exe //B //t:20 "%PROGRAMFILES%\Pandora_Agent\util\printers.vbs"
# module_crontab * 12-15 * * 1
# module_end
# module_begin
# module_plugin cscript.exe //B //t:20 "%PROGRAMFILES%\Pandora_Agent\util\raminfo.vbs"
# module_crontab * 12-15 * * 1
# module_end
# module_begin
# module_plugin cscript.exe //B //t:20 "%PROGRAMFILES%\Pandora_Agent\util\software_installed.vbs"
# module_crontab * 12-15 * * 1
# module_end
# module_begin
# module_plugin cscript.exe //B //t:20 "%PROGRAMFILES%\Pandora_Agent\util\userslogged.vbs"
# module_crontab * 12-15 * * 1
# module_end
# module_begin
# module_plugin cscript.exe //B //t:20 "%PROGRAMFILES%\Pandora_Agent\util\productkey.vbs"
# module_crontab * 12-15 * * 1
# module_end
# module_begin
# module_plugin cscript.exe //B //t:20 "%PROGRAMFILES%\Pandora_Agent\util\productID.vbs"
# module_crontab * 12-15 * * 1
# module_end # module_end
## Plugin example for custom fields (version, architecture, IP, IPv6, MAC) ## Plugin example for custom fields (version, architecture, IP, IPv6, MAC)
@ -281,10 +354,9 @@ module_end
# module_crontab * 12-15 * * 1 # module_crontab * 12-15 * * 1
# module_end # module_end
# ---------------------------------------------------------------------------------------------------- # Example plugin to retrieve last 5 min events in log4x format
# This samples below need to be reconfigured and uncommented. Please read documentation # module_plugin cscript.exe //B "%ProgramFiles%\Pandora_Agent\util\logevent_log4x.vbs" Aplicacion System 300
# on how to setup pandora fms windows agent at http://wiki.pandorafms.com
# ----------------------------------------------------------------------------------------------------
# Sample on how to get a value from registry # Sample on how to get a value from registry
# This returns the last time user launch microsoft Windows update # This returns the last time user launch microsoft Windows update
#module_begin #module_begin
@ -391,11 +463,11 @@ module_end
#module_description Postcondition test module #module_description Postcondition test module
#module_end #module_end
#Example of when module_native_encoding is necessary # Example of native encoding.
#Dont uncomment module_native_encoding tag to see the difference
#module_begin #module_begin
#module_name Accent_example #module_name Written Accent
#module_type generic_data_string #module_type generic_data_string
#module_exec echo Bordón #module_exec echo Bordón
#module_native_encoding OEM #module_native_encoding OEM
#module_end #module_end

Binary file not shown.

Binary file not shown.

View File

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

View File

@ -1170,7 +1170,7 @@ Pandora_Module_Factory::getModuleFromDefinition (string definition) {
try { try {
char buffer[100]; char buffer[100];
unsigned long memory = Pandora_Wmi::getDiskFreeSpace(module_freedisk_percent); unsigned long memory = Pandora_Wmi::getDiskFreeSpace(module_freedisk_percent);
if (sprintf(buffer, "Free memory %s %dMB", if (sprintf(buffer, "Free space on drive %s %dMB",
module_freedisk_percent.c_str(), memory) > 0) { module_freedisk_percent.c_str(), memory) > 0) {
module->setDescription(buffer); module->setDescription(buffer);
} }

View File

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

View File

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

View File

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

View File

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

View File

@ -546,9 +546,11 @@ ui_require_jquery_file('pandora');
}); });
$('#group_id').change(function(){ $('#group_id').change(function(){
var regx = /&group_id=\d*/g; if(location.href.indexOf("extensions/agents_modules") == -1){
var url = location.href.replace(regx, ""); var regx = /&group_id=\d*/g;
location.href = url+"&group_id="+$("#group_id").val(); 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); $hor_offset = (int)get_parameter('hor_offset', 0);
$block = $config['block_size']; $block = $config['block_size'];
if(get_parameter('modulegroup') != null){ 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'); $selection_a_m = (int)get_parameter('selection_agent_module');
$modules_selected = (array)get_parameter('module', 0); $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]; $field_system = $fields_system[$name_field];
$diff = array_diff($field_test, $field_system); $diff = array_diff($field_test, $field_system);
if (!empty($diff)) { if (!empty($diff)) {
foreach ($diff as $config_field => $value) { $info_message = "";
switch ($config_field) { $error_message = "";
case 'type': if($diff['type']){
ui_print_error_message( $error_message .= "Unsuccessful the field ".$name_field." in the table ".$table." must be set the type with ".$diff['type']."<br>";
__('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));
if ($value == "YES") { if($diff['null']){
ui_print_info_message( $error_message .= "Unsuccessful the field $name_field in the table $table must be null: (".$diff['null'].").<br>";
__('You can execute this SQL query for to fix.') . "<br />" . }
'<pre>' .
"ALTER TABLE " . $table . " MODIFY COLUMN " . $name_field . " " . $field_test['type'] . " NULL;" . if($diff['default']){
'</pre>' $error_message .= "Unsuccessful the field $name_field in the table $table must be set ".$diff['default']." as default value.<br>";
); }
}
else { if($field_test['null'] == "YES" || !isset($field_test['null']) || $field_test['null'] == ""){
ui_print_info_message( $null_defect = " NULL";
__('You can execute this SQL query for to fix.') . "<br />" . }
'<pre>' . else{
"ALTER TABLE " . $table . " MODIFY COLUMN " . $name_field . " " . $field_test['type'] . " NOT NULL;" . $null_defect = " NOT NULL";
'</pre>' }
);
} 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));
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) { if ($correct_fields) {
ui_print_success_message( ui_print_success_message(

View File

@ -69,9 +69,9 @@ function pandoralogs_extension_main () {
ui_print_page_header (__("System logfile viewer"), "images/extensions.png", false, "", true, "" ); ui_print_page_header (__("System logfile viewer"), "images/extensions.png", false, "", true, "" );
echo "<p>" . __('This tool is used just to view your Pandora FMS system logfiles directly from console') . "</p>"; echo "<p>" . __('Use this tool to view your Pandora FMS logfiles directly on the console') . "</p>";
echo "<p>" . __('You can control the size information to show in general setup (Log size limit in view extension), actually ') . $config['max_log_size'] * 1000 . "B" . "</p>"; echo "<p>" . __('You can choose the amount of information shown in general setup (Log size limit in system logs viewer extension), ' . $config['max_log_size'] * 1000 . 'B at the moment') . "</p>";
$logs_directory = (!empty($config["server_log_dir"])) ? io_safe_output($config["server_log_dir"]) : "/var/log/pandora"; $logs_directory = (!empty($config["server_log_dir"])) ? io_safe_output($config["server_log_dir"]) : "/var/log/pandora";

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, `module_free_text` TEXT,
`each_agent` tinyint(1) default 1, `each_agent` tinyint(1) default 1,
`historical_db` tinyint(1) UNSIGNED NOT NULL default 0, `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`) PRIMARY KEY(`id_rc`)
) ENGINE = InnoDB DEFAULT CHARSET=utf8; ) 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 `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` -- 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 ('big_operation_step_datos_purge', '100');
INSERT INTO `tconfig` (`token`, `value`) VALUES ('small_operation_step_datos_purge', '1000'); 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 ('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'; UPDATE tconfig SET value = 'https://licensing.artica.es/pandoraupdate7/server.php' WHERE token='url_update_manager';
DELETE FROM `tconfig` WHERE `token` = 'current_package_enterprise'; 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` -- 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 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 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 autorefresh_white_list text not null default '';
ALTER TABLE tusuario ADD COLUMN `time_autorefresh` int(5) unsigned NOT NULL default '30';
-- --------------------------------------------------------------------- -- ---------------------------------------------------------------------
-- Table `tagente_modulo` -- 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 `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 COLUMN (alias varchar(600) not null default '');
ALTER TABLE tagente ADD `alias_as_name` int(2) unsigned default '0'; 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; 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 `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 `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 `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` -- Table `tagent_custom_fields`
@ -1248,6 +1260,8 @@ UPDATE tagente_modulo SET cron_interval = '' WHERE cron_interval LIKE '% %';
-- Table `tgraph` -- Table `tgraph`
-- --------------------------------------------------------------------- -- ---------------------------------------------------------------------
ALTER TABLE tgraph ADD COLUMN `percentil` int(4) unsigned default '0'; 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` -- 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 `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` -- 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 `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` 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 `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; 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 IF @vv1>0 THEN
ALTER TABLE tbackup ADD COLUMN `filepath` varchar(512) NOT NULL DEFAULT ""; ALTER TABLE tbackup ADD COLUMN `filepath` varchar(512) NOT NULL DEFAULT "";
END IF; 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; END;
// //
delimiter ; 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'); 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; $_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']); $autorefresh_list = json_decode($select[0]['autorefresh_white_list']);
if ($autorefresh_list !== null && array_search($_GET['sec2'], $autorefresh_list) !== false) { if ($autorefresh_list !== null && array_search($_GET['sec2'], $autorefresh_list) !== false) {
@ -261,7 +261,13 @@ config_check();
if ($check_minor_release_available) { if ($check_minor_release_available) {
if (users_is_admin($config['id_user'])) { 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>'; echo '<div id="alert_messages" style="display: none"></div>';
@ -383,13 +389,27 @@ config_check();
} }
} }
$new_dashboard = get_parameter('new_dashboard',0);
if ($_GET['sec2'] == 'enterprise/dashboard/main_dashboard' && $new_dashboard) {
$do_refresh = false;
}
if ($do_refresh) { if ($do_refresh) {
?> ?>
$("a.autorefresh_txt").toggle (); $("a.autorefresh_txt").toggle ();
$("#combo_refr").toggle (); $("#combo_refr").toggle ();
$("#combo_refr").css('padding-right', '9px'); $("#combo_refr").css('padding-right', '9px');
href = $("a.autorefresh").attr ("href"); 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 <?php
} }
} }

View File

@ -252,25 +252,6 @@ foreach ($modules as $m) {
$modules_values[$m['id_module']] = $m['name']; $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][0] = __('Group');
$table->data[4][1] = html_print_select_groups(false, "AR", false, 'grupo', $grupo, '', '', 0, true); $table->data[4][1] = html_print_select_groups(false, "AR", false, 'grupo', $grupo, '', '', 0, true);
$table->data[4][1] .= ' <span id="group_preview">'; $table->data[4][1] .= ' <span id="group_preview">';
@ -320,52 +301,87 @@ $table->class = "databox filters";
$table->head = array (); $table->head = array ();
$table->style = array (); $table->style = array ();
$table->style[0] = 'font-weight: bold; '; $table->style[0] = 'font-weight: bold; ';
$table->style[2] = 'font-weight: bold;'; $table->style[4] = 'font-weight: bold;';
$table->data = array (); $table->data = array ();
// Custom ID // Custom ID
$table->data[0][0] = __('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[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 // Learn mode / Normal mode
$table->data[1][0] = __('Module definition') . $table->data[3][0] = __('Module definition') .
ui_print_help_icon("module_definition", true); 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();', html_print_radio_button_extended ("modo", 1, '', $modo, false, 'show_modules_not_learning_mode_context_help();',
'style="margin-right: 40px;"', true); '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();', html_print_radio_button_extended ("modo", 0, '', $modo, false, 'show_modules_not_learning_mode_context_help();',
'style="margin-right: 40px;"', true); '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();', html_print_radio_button_extended ("modo", 2, '', $modo, false, 'show_modules_not_learning_mode_context_help();',
'style="margin-right: 40px;"', true); 'style="margin-right: 40px;"', true);
// Status (Disabled / Enabled) // Status (Disabled / Enabled)
$table->data[2][0] = __('Status'); $table->data[4][0] = __('Status');
$table->data[2][1] = __('Disabled') . ' ' . $table->data[4][1] = __('Disabled') . ' ' .
html_print_radio_button_extended ("disabled", 1, '', $disabled, false, '', 'style="margin-right: 40px;"', true); 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); html_print_radio_button_extended ("disabled", 0, '', $disabled, false, '', 'style="margin-right: 40px;"', true);
// Remote configuration // Remote configuration
$table->data[3][0] = __('Remote configuration'); $table->data[5][0] = __('Remote configuration');
if (!$new_agent) { if (!$new_agent) {
$table->data[3][1] = '<em>' . __('Not available') . '</em>'; $table->data[5][1] = '<em>' . __('Not available') . '</em>';
if (isset($filename)) { if (isset($filename)) {
if (file_exists ($filename['md5'])) { 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 // Delete remote configuration
$table->data[3][1] .= '<a href="index.php?' . $table->data[5][1] .= '<a href="index.php?' .
'sec=gagente&amp;' . 'sec=gagente&amp;' .
'sec2=godmode/agentes/configurar_agente&amp;' . 'sec2=godmode/agentes/configurar_agente&amp;' .
'tab=main&amp;' . 'tab=main&amp;' .
'disk_conf_delete=1&amp;' . 'disk_conf_delete=1&amp;' .
'id_agente=' . $id_agente . '">'; 'id_agente=' . $id_agente . '">';
$table->data[3][1] .= html_print_image( $table->data[5][1] .= html_print_image(
"images/cross.png", true, "images/cross.png", true,
array ('title' => __('Delete remote configuration file'), 'style' => 'vertical-align: middle;')).'</a>'; 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( ui_print_help_tip(
__('Delete this conf file implies that for restore you must reactive remote config in the local agent.'), __('Delete this conf file implies that for restore you must reactive remote config in the local agent.'),
true); true);
@ -373,7 +389,7 @@ if (!$new_agent) {
} }
} }
else else
$table->data[3][1] = '<em>' . __('Not available') . '</em>'; $table->data[5][1] = '<em>' . __('Not available') . '</em>';
$listIcons = gis_get_array_list_icons(); $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.";")); array("id" => "icon_warning", "style" => "display:".$display_icons.";"));
if ($config['activate_gis']) { if ($config['activate_gis']) {
$table->data[1][2] = __('Ignore new GIS data:'); $table->data[3][2] = __('Ignore new GIS data:');
$table->data[1][3] = __('Yes') . ' ' . $table->data[3][3] = __('Yes') . ' ' .
html_print_radio_button_extended ("update_gis_data", 0, '', html_print_radio_button_extended ("update_gis_data", 0, '',
$update_gis_data, false, '', 'style="margin-right: 40px;"', true); $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, '', html_print_radio_button_extended ("update_gis_data", 1, '',
$update_gis_data, false, '', 'style="margin-right: 40px;"', true); $update_gis_data, false, '', 'style="margin-right: 40px;"', true);
} }
$table->data[2][2] = __('Url address'); $table->data[4][2] = __('Url address');
$table->data[2][3] = html_print_input_text ('url_description', $table->data[4][3] = html_print_input_text ('url_description',
$url_description, '', 45, 255, true); $url_description, '', 45, 255, true);
$table->data[3][2] = __('Quiet'); $table->data[5][2] = __('Quiet');
$table->data[3][3] = ui_print_help_tip( $table->data[5][3] = ui_print_help_tip(
__('The agent still runs but the alerts and events will be stop'), true); __('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')); ui_toggle(html_print_table ($table, true), __('Advanced options'));
unset($table); unset($table);
@ -583,6 +599,26 @@ ui_require_jquery_file('bgiframe');
} }
}); });
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( paint_qrcode(
"<?php "<?php
echo ui_get_full_url('mobile/index.php?page=agent&id=' . $id_agente); echo ui_get_full_url('mobile/index.php?page=agent&id=' . $id_agente);

View File

@ -35,12 +35,12 @@ $use_agent = get_parameter ('use_agent');
$snmp_community = (string) get_parameter ('snmp_community', 'public'); $snmp_community = (string) get_parameter ('snmp_community', 'public');
$snmp_version = get_parameter('snmp_version', '1'); $snmp_version = get_parameter('snmp_version', '1');
$server_to_exec = get_parameter('server_to_exec', 0); $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_security_level = get_parameter('snmp3_security_level');
$snmp3_auth_method = get_parameter('snmp3_auth_method'); $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_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'); $tcp_port = (string) get_parameter ('tcp_port');
//See if id_agente is set (either POST or GET, otherwise -1 //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'); $snmp_community = (string) get_parameter ('snmp_community', 'public');
$server_to_exec = get_parameter('server_to_exec', 0); $server_to_exec = get_parameter('server_to_exec', 0);
$snmp_version = get_parameter('snmp_version', '1'); $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_security_level = get_parameter('snmp3_security_level');
$snmp3_auth_method = get_parameter('snmp3_auth_method'); $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_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'); $tcp_port = (string) get_parameter ('tcp_port');
//See if id_agente is set (either POST or GET, otherwise -1 //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][1] = '';
$table->data[0][2] = '<b>'.__('Modules').'</b>'; $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][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_select (array (), 'module[]', 0, false, '', 0, true, true, true, '', false, 'width:200px;');
$table->data[1][2] .= html_print_input_hidden('agent', $id_agent, true); $table->data[1][2] .= html_print_input_hidden('agent', $id_agent, true);

View File

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

View File

@ -24,6 +24,7 @@ $sortField = get_parameter('sort_field');
$sort = get_parameter('sort', 'none'); $sort = get_parameter('sort', 'none');
$recursion = (bool) get_parameter('recursion',false); $recursion = (bool) get_parameter('recursion',false);
$disabled = get_parameter('disabled', 0); $disabled = get_parameter('disabled', 0);
$os = get_parameter('os', 0);
if ($ag_group == -1 ) if ($ag_group == -1 )
$ag_group = (int) get_parameter ("ag_group", -1); $ag_group = (int) get_parameter ("ag_group", -1);
@ -163,6 +164,20 @@ html_print_select($fields,"disabled",$disabled,'this.form.submit()');
echo "</td>"; echo "</td>";
echo "<td>";
echo __('Operative System') . '&nbsp;';
$pre_fields = db_get_all_rows_sql('select distinct(tagente.id_os),tconfig_os.description from tagente,tconfig_os where tagente.id_os = tconfig_os.id_os');
$fields = array();
foreach ($pre_fields as $key => $value) {
$fields[$value['id_os']] = $value['description'];
}
html_print_select($fields,"os",$os,'this.form.submit()','All',0);
echo "</td>";
echo "<td>"; echo "<td>";
echo __('Recursion') . '&nbsp;'; echo __('Recursion') . '&nbsp;';
html_print_checkbox ("recursion", 1, $recursion, false, false, 'this.form.submit()'); html_print_checkbox ("recursion", 1, $recursion, false, false, 'this.form.submit()');
@ -171,6 +186,8 @@ echo "</td><td>";
echo __('Search') . '&nbsp;'; echo __('Search') . '&nbsp;';
html_print_input_text ("search", $search, '', 12); html_print_input_text ("search", $search, '', 12);
echo ui_print_help_tip(__('Search filter by alias, name, description, IP address or custom fields content'), true);
echo "</td><td>"; echo "</td><td>";
echo "<input name='srcbutton' type='submit' class='sub search' value='".__('Search')."'>"; echo "<input name='srcbutton' type='submit' class='sub search' value='".__('Search')."'>";
echo "</form>"; echo "</form>";
@ -201,13 +218,13 @@ switch ($sortField) {
switch ($sort) { switch ($sort) {
case 'up': case 'up':
$selectRemoteUp = $selected; $selectRemoteUp = $selected;
$order = array('field' => 'remote ' . $order_collation, $order = array('field' => 'remote ',
'field2' => 'nombre ' . $order_collation, 'field2' => 'nombre ' . $order_collation,
'order' => 'ASC'); 'order' => 'ASC');
break; break;
case 'down': case 'down':
$selectRemoteDown = $selected; $selectRemoteDown = $selected;
$order = array('field' => 'remote ' . $order_collation, $order = array('field' => 'remote ',
'field2' => 'nombre ' . $order_collation, 'field2' => 'nombre ' . $order_collation,
'order' => 'DESC'); 'order' => 'DESC');
break; break;
@ -296,20 +313,26 @@ if ($search != "") {
}else{ }else{
$search_sql = " AND ( nombre " . $order_collation . " $search_sql = " AND ( nombre " . $order_collation . "
LIKE LOWER('%$search%') OR alias " . $order_collation . " LIKE LOWER('%$search%') OR alias " . $order_collation . "
LIKE LOWER('%$search%')) "; LIKE LOWER('%$search%') OR comentarios " . $order_collation . " LIKE LOWER('%$search%')
OR EXISTS (SELECT * FROM tagent_custom_data
WHERE id_agent = id_agente AND description LIKE '%$search%'))";
} }
} }
if ($disabled == 1) if ($disabled == 1)
{ {
$search_sql = " AND disabled = ". $disabled . $search_sql; $search_sql .= " AND disabled = ". $disabled . $search_sql;
} }
else { else {
if ($disabled == 0) { if ($disabled == 0) {
$search_sql = " AND disabled = 0" . $search_sql; $search_sql .= " AND disabled = 0" . $search_sql;
} }
} }
if($os != 0){
$search_sql .= " AND id_os = " . $os;
}
// Show only selected groups // Show only selected groups
if ($ag_group > 0) { if ($ag_group > 0) {

View File

@ -45,10 +45,10 @@ echo "<tr><td class='datos' style='width:20%; font-weight: bold;'>";
echo __('Search') . ' ' . echo __('Search') . ' ' .
html_print_input_text ('search_string', $search_string, '', 15, 255, true); html_print_input_text ('search_string', $search_string, '', 15, 255, true);
echo "</td>"; echo "</td>";
echo "<td class='datos' style='width:20%'>"; echo "<td class='datos' style='width:10%'>";
html_print_submit_button (__('Filter'), 'filter', false, 'class="sub search"'); html_print_submit_button (__('Filter'), 'filter', false, 'class="sub search"');
echo "</td>"; echo "</td>";
echo "<td class='datos' style='width:20%'></td>"; echo "<td class='datos' style='width:10%'></td>";
echo '</form>'; echo '</form>';
// Check if there is at least one server of each type available to assign that // Check if there is at least one server of each type available to assign that
// kind of modules. If not, do not show server type in combo // kind of modules. If not, do not show server type in combo
@ -119,7 +119,7 @@ if (($policy_page) || (isset($agent))) {
// Create module/type combo // Create module/type combo
echo '<form id="create_module_type" method="post" action="'.$url.'">'; echo '<form id="create_module_type" method="post" action="'.$url.'">';
if (!$policy_page) { if (!$policy_page) {
echo '<td class="datos" style="font-weight: bold;">'; echo '<td class="datos" style="font-weight: bold; width:20%;">';
echo __('Show in hierachy mode'); echo __('Show in hierachy mode');
if ($checked == "true") { if ($checked == "true") {
$checked = true; $checked = true;
@ -130,12 +130,12 @@ if (($policy_page) || (isset($agent))) {
html_print_checkbox ('status_hierachy_mode', "", $checked, false, false, "onChange=change_mod_filter();"); html_print_checkbox ('status_hierachy_mode', "", $checked, false, false, "onChange=change_mod_filter();");
echo '</td>'; echo '</td>';
} }
echo '<td class="datos" style="font-weight: bold;">'; echo '<td class="datos" style="font-weight: bold; width:20%;">';
echo __("Type"); echo __("Type");
html_print_select ($modules, 'moduletype', '', '', '', '', false, false, false, '', false, 'max-width:300px;' ); html_print_select ($modules, 'moduletype', '', '', '', '', false, false, false, '', false, 'max-width:300px;' );
html_print_input_hidden ('edit_module', 1); html_print_input_hidden ('edit_module', 1);
echo '</td>'; echo '</td>';
echo '<td class="datos">'; echo '<td class="datos" style="width:10%;">';
echo '<input align="right" name="updbutton" type="submit" class="sub next" value="'.__('Create').'">'; echo '<input align="right" name="updbutton" type="submit" class="sub next" value="'.__('Create').'">';
echo '</td>'; echo '</td>';
echo '</tr>'; echo '</tr>';

View File

@ -111,12 +111,12 @@ if (is_ajax ()) {
else else
$snmp_community = (string) get_parameter ('snmp_community'); $snmp_community = (string) get_parameter ('snmp_community');
$snmp_version = get_parameter('snmp_version'); $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_security_level = get_parameter('snmp3_security_level');
$snmp3_auth_method = get_parameter('snmp3_auth_method'); $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_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'); $snmp_port = get_parameter('snmp_port');
$snmpwalk = get_snmpwalk($ip_target, $snmp_version, $snmp_community, $snmpwalk = get_snmpwalk($ip_target, $snmp_version, $snmp_community,

View File

@ -291,7 +291,7 @@ if (modules_is_string_type($id_module_type) || $edit) {
$table_simple->data[4][1] .= '<br /><em>'.__('Inverse interval').'</em>'; $table_simple->data[4][1] .= '<br /><em>'.__('Inverse interval').'</em>';
$table_simple->data[4][1] .= html_print_checkbox ("warning_inverse", 1, $warning_inverse, true, $disabledBecauseInPolicy); $table_simple->data[4][1] .= html_print_checkbox ("warning_inverse", 1, $warning_inverse, true, $disabledBecauseInPolicy);
if (!modules_is_string_type($id_module_type) || $edit) { if (!modules_is_string_type($id_module_type) || $edit) {
$table_simple->data[4][2] = '<svg id="svg_dinamic" width="350" height="200" style="padding:40px; padding-left: 100px; margin-bottom: 60px;"> </svg>'; $table_simple->data[4][2] = '<svg id="svg_dinamic" width="350px" height="200px" style="padding:40px; padding-left: 100px; margin-bottom: 60px;"></svg>';
$table_simple->colspan[4][2] = 2; $table_simple->colspan[4][2] = 2;
$table_simple->rowspan[4][2] = 3; $table_simple->rowspan[4][2] = 3;
} }
@ -590,8 +590,7 @@ $table_advanced->colspan[10][1] = 6;
if (isset($id_agente) && $moduletype == MODULE_DATA) { if (isset($id_agente) && $moduletype == MODULE_DATA) {
$has_remote_conf = enterprise_hook('config_agents_has_remote_configuration',array($agent["id_agente"])); $has_remote_conf = enterprise_hook('config_agents_has_remote_configuration',array($agent["id_agente"]));
if ($has_remote_conf) { if ($has_remote_conf) {
$table_advanced->data[11][0] = __('Cron from') . $table_advanced->data[11][0] = __('Cron from') . ui_print_help_icon ('cron', true);
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][1] = html_print_extended_select_for_cron ($hour_from, $minute_from, $mday_from, $month_from, $wday_from, true, $disabledBecauseInPolicy); $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; $table_advanced->colspan[11][1] = 6;
@ -600,8 +599,7 @@ if (isset($id_agente) && $moduletype == MODULE_DATA) {
$table_advanced->colspan[12][1] = 6; $table_advanced->colspan[12][1] = 6;
} }
else { else {
$table_advanced->data[11][0] = __('Cron from') . $table_advanced->data[11][0] = __('Cron from') . ui_print_help_icon ('cron', true);
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][1] = html_print_extended_select_for_cron ($hour_from, $minute_from, $mday_from, $month_from, $wday_from, true, 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; $table_advanced->colspan[11][1] = 6;
@ -611,8 +609,7 @@ if (isset($id_agente) && $moduletype == MODULE_DATA) {
} }
} }
else { else {
$table_advanced->data[11][0] = __('Cron from') . $table_advanced->data[11][0] = __('Cron from') . ui_print_help_icon ('cron', true);
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][1] = html_print_extended_select_for_cron ($hour_from, $minute_from, $mday_from, $month_from, $wday_from, true, $disabledBecauseInPolicy); $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; $table_advanced->colspan[11][1] = 6;
@ -1323,8 +1320,8 @@ function paint_graph_status(min_w, max_w, min_c, max_c, inverse_w, inverse_c, er
.attr("id", "legend_normal") .attr("id", "legend_normal")
.attr("x", 72) .attr("x", 72)
.attr("y", -30) .attr("y", -30)
.attr("width", 10) .attr("width", '10px')
.attr("height", 10) .attr("height", '10px')
.style("fill", "#82B92E"); .style("fill", "#82B92E");
//legend Warning text //legend Warning text
@ -1343,8 +1340,8 @@ function paint_graph_status(min_w, max_w, min_c, max_c, inverse_w, inverse_c, er
.attr("id", "legend_warning") .attr("id", "legend_warning")
.attr("x", 168) .attr("x", 168)
.attr("y", -30) .attr("y", -30)
.attr("width", 10) .attr("width", '10px')
.attr("height", 10) .attr("height", '10px')
.style("fill", "#ffd731"); .style("fill", "#ffd731");
//legend Critical text //legend Critical text
@ -1363,8 +1360,8 @@ function paint_graph_status(min_w, max_w, min_c, max_c, inverse_w, inverse_c, er
.attr("id", "legend_critical") .attr("id", "legend_critical")
.attr("x", 258) .attr("x", 258)
.attr("y", -30) .attr("y", -30)
.attr("width", 10) .attr("width", '10px')
.attr("height", 10) .attr("height", '10px')
.style("fill", "#fc4444"); .style("fill", "#fc4444");
//styles for number and axes //styles for number and axes
@ -1382,8 +1379,8 @@ function paint_graph_status(min_w, max_w, min_c, max_c, inverse_w, inverse_c, er
.attr("id", "warning_rect") .attr("id", "warning_rect")
.attr("x", 3) .attr("x", 3)
.attr("y", 0) .attr("y", 0)
.attr("width", 300) .attr("width", '300px')
.attr("height", 200) .attr("height", '200px')
.style("fill", "#82B92E"); .style("fill", "#82B92E");
//controls the inverse warning //controls the inverse warning

View File

@ -398,12 +398,12 @@ function snmpBrowserWindow () {
$('#text-target_ip').val($('#text-ip_target').val()); $('#text-target_ip').val($('#text-ip_target').val());
$('#text-community').val($('#text-snmp_community').val()); $('#text-community').val($('#text-snmp_community').val());
$('#snmp_browser_version').val($('#snmp_version').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_security_level').val($('#snmp3_security_level').val());
$('#snmp3_browser_auth_method').val($('#snmp3_auth_method').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_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 ({ $("#snmp_browser_container").show().dialog ({
title: '', title: '',

View File

@ -165,8 +165,26 @@ if (is_ajax ()) {
$rfield = $editor_type_chkbx; $rfield = $editor_type_chkbx;
$rfield .= html_print_textarea ('field'.$i.'_recovery_value', 1, 1, '', 'class="fields_recovery"', true); $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 // Select type
else { }else {
$fields_value_select = array(); $fields_value_select = array();
$fv = explode(';', $field_value); $fv = explode(';', $field_value);

View File

@ -132,8 +132,8 @@ $form_filter .= "</tr>";
$form_filter .= "<tr>"; $form_filter .= "<tr>";
$form_filter .= "<td style='font-weight: bold;'>".__('Enabled / Disabled')."</td><td>"; $form_filter .= "<td style='font-weight: bold;'>".__('Enabled / Disabled')."</td><td>";
$ed_list = array (); $ed_list = array ();
$ed_list[0] = __('Enable'); $ed_list[0] = __('Enabled');
$ed_list[1] = __('Disable'); $ed_list[1] = __('Disabled');
$form_filter .= html_print_select ($ed_list, 'enabledisable', $enabledisable, '', __('All'), -1, true); $form_filter .= html_print_select ($ed_list, 'enabledisable', $enabledisable, '', __('All'), -1, true);
$form_filter .= "</td><td style='font-weight: bold;'>".__('Standby')."</td><td>"; $form_filter .= "</td><td style='font-weight: bold;'>".__('Standby')."</td><td>";
$sb_list = array (); $sb_list = array ();

View File

@ -305,8 +305,33 @@ $(document).ready (function () {
// Replace the old column with the new // Replace the old column with the new
$table_macros_field.replaceWith(field_row); $table_macros_field.replaceWith(field_row);
if (old_value != '' || old_recovery_value != '') { if (old_value != '' || old_recovery_value != '') {
$("[name=field" + i + "_value]").val(old_value); var inputType = $("[name=field" + i + "_value]").attr('type')
$("[name=field" + i + "_recovery_value]").val(old_recovery_value); 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 { else {
$("[name=field" + i + "_value]") $("[name=field" + i + "_value]")

View File

@ -30,15 +30,15 @@ $default = (int) get_parameter('default', 0);
if ($default != 0) { if ($default != 0) {
$event_fields = io_safe_input('evento,id_agente,estado,timestamp'); //$event_fields = io_safe_input('evento,id_agente,estado,timestamp');
$fields_selected = explode (',', $event_fields); $fields_selected = explode (',', $config['event_fields']);
} }
else if ($update != '') { else if ($update != '') {
$fields_selected = (array)get_parameter('fields_selected'); $fields_selected = (array)get_parameter('fields_selected');
if ($fields_selected[0] == '') { if ($fields_selected[0] == '') {
$event_fields = io_safe_input('evento,id_agente,estado,timestamp'); //$event_fields = io_safe_input('evento,id_agente,estado,timestamp');
$fields_selected = explode (',', $event_fields); $fields_selected = explode (',', $config['event_fields']);
} }
else { else {
$event_fields = implode (',', $fields_selected); $event_fields = implode (',', $fields_selected);
@ -130,7 +130,7 @@ $event = array();
echo '<h3>'.__('Show event fields'); echo '<h3>'.__('Show event fields');
echo '&nbsp;<a href="index.php?sec=geventos&sec2=godmode/events/events&section=fields&default=1">'; echo '&nbsp;<a href="index.php?sec=geventos&sec2=godmode/events/events&section=fields&default=1">';
html_print_image ('images/clean.png', false, array ('title' => __('Load default event fields'), 'onclick' => "if (! confirm ('" . __('Default event fields will be loaded. Do you want to continue?') ."')) return false")); html_print_image ('images/clean.png', false, array ('title' => __('Load the fields from previous events'), 'onclick' => "if (! confirm ('" . __('Event fields will be loaded. Do you want to continue?') ."')) return false"));
echo '</a></h3>'; echo '</a></h3>';
$table = new stdClass(); $table = new stdClass();

View File

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

View File

@ -129,7 +129,7 @@ else {
} }
$snmp_version = (string) get_parameter('snmp_version'); $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_pass = io_input_password((string) get_parameter('snmp3_auth_pass'));
$snmp3_auth_method = (string) get_parameter('snmp3_auth_method'); $snmp3_auth_method = (string) get_parameter('snmp3_auth_method');
$snmp3_privacy_method = (string) get_parameter('snmp3_privacy_method'); $snmp3_privacy_method = (string) get_parameter('snmp3_privacy_method');

View File

@ -473,8 +473,8 @@ $next_row++;
.attr("id", "legend_normal") .attr("id", "legend_normal")
.attr("x", 72) .attr("x", 72)
.attr("y", -30) .attr("y", -30)
.attr("width", 10) .attr("width", '10px')
.attr("height", 10) .attr("height", '10px')
.style("fill", "#82B92E"); .style("fill", "#82B92E");
//legend Warning text //legend Warning text

View File

@ -112,6 +112,10 @@ $netflow_filter = 0;
$max_values = 0; $max_values = 0;
$resolution = 0; $resolution = 0;
$lapse_calc = 0;
$lapse = 300;
$visual_format = 0;
//Others //Others
$filter_search = ""; $filter_search = "";
@ -148,6 +152,7 @@ switch ($action) {
case 'network_interfaces_report': case 'network_interfaces_report':
case 'availability': case 'availability':
case 'event_report_log': case 'event_report_log':
case 'increment':
case 'availability_graph': case 'availability_graph':
case 'agent_module': case 'agent_module':
$get_data_editor = true; $get_data_editor = true;
@ -195,12 +200,6 @@ switch ($action) {
$name = $item['name']; $name = $item['name'];
switch ($type) { 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': case 'event_report_log':
$period = $item['period']; $period = $item['period'];
$description = $item['description']; $description = $item['description'];
@ -282,6 +281,13 @@ switch ($action) {
$idAgent = db_get_value_filter('id_agente', 'tagente_modulo', array('id_agente_modulo' => $idAgentModule)); $idAgent = db_get_value_filter('id_agente', 'tagente_modulo', array('id_agente_modulo' => $idAgentModule));
break; 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': case 'SLA_services':
$description = $item['description']; $description = $item['description'];
$period = $item['period']; $period = $item['period'];
@ -312,6 +318,9 @@ switch ($action) {
$idAgent = db_get_value_filter('id_agente', 'tagente_modulo', array('id_agente_modulo' => $idAgentModule)); $idAgent = db_get_value_filter('id_agente', 'tagente_modulo', array('id_agente_modulo' => $idAgentModule));
$idAgentModule = $item['id_agent_module']; $idAgentModule = $item['id_agent_module'];
$period = $item['period']; $period = $item['period'];
$lapse = $item['lapse'];
$lapse_calc = $item['lapse_calc'];
$visual_format = $item['visual_format'];
break; break;
case 'max_value': case 'max_value':
$description = $item['description']; $description = $item['description'];
@ -319,6 +328,9 @@ switch ($action) {
$idAgent = db_get_value_filter('id_agente', 'tagente_modulo', array('id_agente_modulo' => $idAgentModule)); $idAgent = db_get_value_filter('id_agente', 'tagente_modulo', array('id_agente_modulo' => $idAgentModule));
$idAgentModule = $item['id_agent_module']; $idAgentModule = $item['id_agent_module'];
$period = $item['period']; $period = $item['period'];
$lapse = $item['lapse'];
$lapse_calc = $item['lapse_calc'];
$visual_format = $item['visual_format'];
break; break;
case 'min_value': case 'min_value':
$description = $item['description']; $description = $item['description'];
@ -326,6 +338,9 @@ switch ($action) {
$idAgent = db_get_value_filter('id_agente', 'tagente_modulo', array('id_agente_modulo' => $idAgentModule)); $idAgent = db_get_value_filter('id_agente', 'tagente_modulo', array('id_agente_modulo' => $idAgentModule));
$idAgentModule = $item['id_agent_module']; $idAgentModule = $item['id_agent_module'];
$period = $item['period']; $period = $item['period'];
$lapse = $item['lapse'];
$lapse_calc = $item['lapse_calc'];
$visual_format = $item['visual_format'];
break; break;
case 'sumatory': case 'sumatory':
$description = $item['description']; $description = $item['description'];
@ -593,6 +608,7 @@ switch ($action) {
case 'MTTR': case 'MTTR':
case 'simple_baseline_graph': case 'simple_baseline_graph':
case 'event_report_log': case 'event_report_log':
case 'increment':
$label = (isset($style['label'])) ? $style['label'] : ''; $label = (isset($style['label'])) ? $style['label'] : '';
break; break;
default: default:
@ -1580,6 +1596,78 @@ You can of course remove the warnings, that's why we include the source and do n
?> ?>
</td> </td>
</tr> </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> </tbody>
</table> </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() { function create_custom_graph() {
@ -2692,6 +2793,9 @@ function chooseType() {
$("#row_show_in_two_columns").hide(); $("#row_show_in_two_columns").hide();
$("#row_show_in_same_row").hide(); $("#row_show_in_same_row").hide();
$("#row_historical_db_check").hide(); $("#row_historical_db_check").hide();
$("#row_lapse_calc").hide();
$("#row_lapse").hide();
$("#row_visual_format").hide();
$("#row_show_in_landscape").hide(); $("#row_show_in_landscape").hide();
$('#row_hide_notinit_agents').hide(); $('#row_hide_notinit_agents').hide();
$("#row_module_group").hide(); $("#row_module_group").hide();
@ -2764,6 +2868,13 @@ function chooseType() {
$("#row_historical_db_check").hide(); $("#row_historical_db_check").hide();
break; break;
case 'increment':
$("#row_description").show();
$("#row_agent").show();
$("#row_module").show();
$("#row_period").show();
break;
case 'simple_graph': case 'simple_graph':
$("#row_time_compare_overlapped").show(); $("#row_time_compare_overlapped").show();
$("#row_only_avg").show(); $("#row_only_avg").show();
@ -2884,6 +2995,9 @@ function chooseType() {
$("#row_module").show(); $("#row_module").show();
$("#row_period").show(); $("#row_period").show();
$("#row_show_in_two_columns").show(); $("#row_show_in_two_columns").show();
$("#row_lapse_calc").show();
$("#row_lapse").show();
$("#row_visual_format").show();
$("#row_historical_db_check").hide(); $("#row_historical_db_check").hide();
break; break;
@ -2893,6 +3007,9 @@ function chooseType() {
$("#row_module").show(); $("#row_module").show();
$("#row_period").show(); $("#row_period").show();
$("#row_show_in_two_columns").show(); $("#row_show_in_two_columns").show();
$("#row_lapse_calc").show();
$("#row_lapse").show();
$("#row_visual_format").show();
$("#row_historical_db_check").hide(); $("#row_historical_db_check").hide();
break; break;
@ -2902,6 +3019,9 @@ function chooseType() {
$("#row_module").show(); $("#row_module").show();
$("#row_period").show(); $("#row_period").show();
$("#row_show_in_two_columns").show(); $("#row_show_in_two_columns").show();
$("#row_lapse_calc").show();
$("#row_lapse").show();
$("#row_visual_format").show();
$("#row_historical_db_check").hide(); $("#row_historical_db_check").hide();
break; break;

View File

@ -1069,6 +1069,15 @@ switch ($action) {
$values['period'] = get_parameter('period'); $values['period'] = get_parameter('period');
$good_format = true; $good_format = true;
break; 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: default:
$values['period'] = get_parameter('period'); $values['period'] = get_parameter('period');
$values['top_n'] = get_parameter('radiobutton_max_min_avg',0); $values['top_n'] = get_parameter('radiobutton_max_min_avg',0);
@ -1404,6 +1413,15 @@ switch ($action) {
$values['period'] = get_parameter('period'); $values['period'] = get_parameter('period');
$good_format = true; $good_format = true;
break; 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: default:
$values['period'] = get_parameter('period'); $values['period'] = get_parameter('period');
$values['top_n'] = get_parameter('radiobutton_max_min_avg',0); $values['top_n'] = get_parameter('radiobutton_max_min_avg',0);

View File

@ -202,6 +202,22 @@ echo "</form>";
$(document).ready (function () { $(document).ready (function () {
var metaconsole = null;
function is_metaconsole() {
if (metaconsole === null)
metaconsole = $("input[name='metaconsole']").val();
if (metaconsole != 0)
return true;
else
return false;
}
var url_hack_metaconsole = '';
if (is_metaconsole()) {
url_hack_metaconsole = '../../';
}
$("#modsize").click(function(event){ $("#modsize").click(function(event){
event.preventDefault(); event.preventDefault();
@ -260,7 +276,7 @@ $(document).ready (function () {
} }
else{ else{
original_image=new Image(); original_image=new Image();
original_image.src='images/console/background/'+$('#background').val(); original_image.src= url_hack_metaconsole + 'images/console/background/'+$('#background').val();
if (parseInt(original_image.width) < 1024){ if (parseInt(original_image.width) < 1024){
alert('Default width is '+original_image.width+'px, smaller than minimum -> 1024px'); alert('Default width is '+original_image.width+'px, smaller than minimum -> 1024px');
$('input[name=width]').val('1024'); $('input[name=width]').val('1024');
@ -310,7 +326,7 @@ $(document).ready (function () {
var size_changer_state = false; var size_changer_state = false;
$("#background").change(function() { $("#background").change(function() {
$('#imagen2').attr('src','images/console/background/'+$('#background').val()); $('#imagen2').attr('src', url_hack_metaconsole + 'images/console/background/'+$('#background').val());
$('#imagen2').width(230); $('#imagen2').width(230);
$('#imagen2').show(); $('#imagen2').show();
}); });
@ -323,7 +339,7 @@ $(document).ready (function () {
$("#background").mouseout(function() { $("#background").mouseout(function() {
if(size_changer_state){ if(size_changer_state){
$('#imagen').attr('src','images/console/background/'+$('#background').val()); $('#imagen').attr('src',url_hack_metaconsole + 'images/console/background/'+$('#background').val());
$('input[name=width]').val($('#imagen').width()); $('input[name=width]').val($('#imagen').width());
$('input[name=height]').val($('#imagen').height()); $('input[name=height]').val($('#imagen').height());
$('#preimagew').html($('#imagen').width()); $('#preimagew').html($('#imagen').width());

View File

@ -180,6 +180,7 @@ ui_require_javascript_file ('encode_decode_base64');
tinyMCE.init({ tinyMCE.init({
mode : "exact", mode : "exact",
elements: "text-label", elements: "text-label",
convert_urls: false,
theme : "advanced", theme : "advanced",
<?php <?php
if ($config['style'] == 'pandora_legacy') { if ($config['style'] == 'pandora_legacy') {
@ -196,11 +197,18 @@ ui_require_javascript_file ('encode_decode_base64');
"10pt=.visual_font_size_10pt, " + "10pt=.visual_font_size_10pt, " +
"12pt=.visual_font_size_12pt, " + "12pt=.visual_font_size_12pt, " +
"14pt=.visual_font_size_14pt, " + "14pt=.visual_font_size_14pt, " +
"18pt=.visual_font_size_18pt, " +
"24pt=.visual_font_size_24pt, " + "24pt=.visual_font_size_24pt, " +
"28pt=.visual_font_size_28pt, " +
"36pt=.visual_font_size_36pt, " + "36pt=.visual_font_size_36pt, " +
"48pt=.visual_font_size_48pt, " +
"60pt=.visual_font_size_60pt, " +
"72pt=.visual_font_size_72pt, " + "72pt=.visual_font_size_72pt, " +
"84pt=.visual_font_size_84pt, " +
"96pt=.visual_font_size_96pt, " + "96pt=.visual_font_size_96pt, " +
"116pt=.visual_font_size_116pt, " +
"128pt=.visual_font_size_128pt, " + "128pt=.visual_font_size_128pt, " +
"140pt=.visual_font_size_140pt, " +
"154pt=.visual_font_size_154pt, " + "154pt=.visual_font_size_154pt, " +
"196pt=.visual_font_size_196pt", "196pt=.visual_font_size_196pt",
theme_advanced_toolbar_location : "top", theme_advanced_toolbar_location : "top",

View File

@ -602,11 +602,18 @@ ui_require_javascript_file('tiny_mce', 'include/javascript/tiny_mce/');
"10pt=.visual_font_size_10pt, " + "10pt=.visual_font_size_10pt, " +
"12pt=.visual_font_size_12pt, " + "12pt=.visual_font_size_12pt, " +
"14pt=.visual_font_size_14pt, " + "14pt=.visual_font_size_14pt, " +
"18pt=.visual_font_size_18pt, " +
"24pt=.visual_font_size_24pt, " + "24pt=.visual_font_size_24pt, " +
"28pt=.visual_font_size_28pt, " +
"36pt=.visual_font_size_36pt, " + "36pt=.visual_font_size_36pt, " +
"48pt=.visual_font_size_48pt, " +
"60pt=.visual_font_size_60pt, " +
"72pt=.visual_font_size_72pt, " + "72pt=.visual_font_size_72pt, " +
"84pt=.visual_font_size_84pt, " +
"96pt=.visual_font_size_96pt, " + "96pt=.visual_font_size_96pt, " +
"116pt=.visual_font_size_116pt, " +
"128pt=.visual_font_size_128pt, " + "128pt=.visual_font_size_128pt, " +
"140pt=.visual_font_size_140pt, " +
"154pt=.visual_font_size_154pt, " + "154pt=.visual_font_size_154pt, " +
"196pt=.visual_font_size_196pt", "196pt=.visual_font_size_196pt",
theme_advanced_toolbar_location : "top", theme_advanced_toolbar_location : "top",

View File

@ -413,6 +413,8 @@ switch ($activeTab) {
$value_show = get_parameter ("value_show", 'percent'); $value_show = get_parameter ("value_show", 'percent');
$label_type = get_parameter ("label_type", 'agent_module'); $label_type = get_parameter ("label_type", 'agent_module');
$enable_link = get_parameter ("enable_link", 'enable_link'); $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 // 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); $item_per_agent = get_parameter ("item_per_agent", 0);
$id_server = (int)get_parameter('servers', 0); $id_server = (int)get_parameter('servers', 0);

View File

@ -144,7 +144,7 @@ $table->data["staticgraph_modulegraph"][1] .= '&nbsp;&nbsp;&nbsp;' .
'leaguegothic' => 'League Gothic' 'leaguegothic' => 'League Gothic'
); );
$fonts = array('4pt' => '4pt','6pt' => '6pt','8pt' => '8pt','10pt' => '10pt','12pt' => '12pt','14pt' => '14pt','24pt' => '24pt','36pt' => '36pt','72pt' => '72pt','96pt' => '96pt','128pt' => '128pt','154pt' => '154pt','196pt' => '196pt'); $fonts = array('4pt' => '4pt','6pt' => '6pt','8pt' => '8pt','10pt' => '10pt','12pt' => '12pt','14pt' => '14pt','18pt' => '18pt','24pt' => '24pt','28pt' => '28pt','36pt' => '36pt','48pt' => '48pt','60pt' => '60pt','72pt' => '72pt','84pt' => '84pt','96pt' => '96pt','116pt' => '116pt','128pt' => '128pt','140pt' => '140pt','154pt' => '154pt','196pt' => '196pt');
/* /*
$fontf = array('andale mono,times' => 'Andale Mono', $fontf = array('andale mono,times' => 'Andale Mono',

View File

@ -106,6 +106,18 @@ if (is_ajax ()) {
$row['name'] = __('Login attribute'); $row['name'] = __('Login attribute');
$row['control'] = html_print_input_text ('ldap_login_attr', $config['ldap_login_attr'], '', 60, 100, true); $row['control'] = html_print_input_text ('ldap_login_attr', $config['ldap_login_attr'], '', 60, 100, true);
$table->data['ldap_login_attr'] = $row; $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; break;
case 'pandora': case 'pandora':

View File

@ -934,6 +934,23 @@ tinyMCE.init({
}); });
$(document).ready (function () { $(document).ready (function () {
var comfort = 0;
if(comfort == 0){
$(':input,:radio,:checkbox,:file').change(function(){
$('#submit-update_button').css({'position':'fixed','right':'80px','bottom':'55px'});
var comfort = 1;
});
$("*").keydown(function(){
$('#submit-update_button').css({'position':'fixed','right':'80px','bottom':'55px'});
var comfort = 1;
});
$('#form_setup').after('<br>');
}
$("#form_setup #text-graph_color1").attachColorPicker(); $("#form_setup #text-graph_color1").attachColorPicker();
$("#form_setup #text-graph_color2").attachColorPicker(); $("#form_setup #text-graph_color2").attachColorPicker();
$("#form_setup #text-graph_color3").attachColorPicker(); $("#form_setup #text-graph_color3").attachColorPicker();

View File

@ -28,6 +28,7 @@ $update_filter = (int) get_parameter ('update_filter', -2);
$delete_filter = (int) get_parameter ('delete_filter', -1); $delete_filter = (int) get_parameter ('delete_filter', -1);
$description = (string) get_parameter ('description', ''); $description = (string) get_parameter ('description', '');
$filter = (string) get_parameter ('filter', ''); $filter = (string) get_parameter ('filter', '');
$index_post = (int) get_parameter('index_post', 0);
// Create/update header // Create/update header
if ($edit_filter > -2) { if ($edit_filter > -2) {
@ -44,9 +45,35 @@ else {// Overview header
// Create/update filter // Create/update filter
if ($update_filter > -2) { if ($update_filter > -2) {
// UPDATE
if ($update_filter > -1) { if ($update_filter > -1) {
$values = array('description' => $description, 'filter' => $filter); $new_unified_id = (db_get_value_sql("SELECT unified_filters_id FROM tsnmp_filter WHERE id_snmp_filter = " . $update_filter));
$result = db_process_sql_update('tsnmp_filter', $values, array('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) { if ($result === false) {
ui_print_error_message (__('There was a problem updating the filter')); 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')); ui_print_success_message (__('Successfully updated'));
} }
} }
// CREATE
else { else {
$values = array( $new_unified_id = (db_get_value_sql("SELECT MAX(unified_filters_id) FROM tsnmp_filter")) + 1;
'description' => $description,
'filter' => $filter); if ($index_post == 1) {
$result = db_process_sql_insert('tsnmp_filter', $values); $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) { if ($result === false) {
ui_print_error_message (__('There was a problem creating the filter')); 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 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) { if ($result === false) {
ui_print_error_message (__('There was a problem deleting the filter')); ui_print_error_message (__('There was a problem deleting the filter'));
} }
@ -88,19 +141,50 @@ if ($edit_filter > -1) {
// Create/update form // Create/update form
if ($edit_filter > -2) { if ($edit_filter > -2) {
$index = $index_post;
$table->data = array (); $table->data = array ();
$table->id = 'filter_table';
$table->width = '100%'; $table->width = '100%';
$table->class = 'databox filters'; $table->class = 'databox filters';
$table->data[0][0] = __('Description'); $table->data[0][0] = __('Description');
$table->data[0][1] = html_print_input_text ('description', $description, '', 60, 100, true); $table->data[0][1] = html_print_input_text ('description', $description, '', 60, 100, true);
$table->data[1][0] = __('Filter'); $table->data[1][0] = __('Filter');
$table->data[1][1] = html_print_input_text ('filter', $filter, '', 60, 100, true); if ($edit_filter > -1) {
$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); $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">'; 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 ('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); html_print_table ($table);
echo '<div class="action-buttons" style="width: '.$table->width.'">'; 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) { if ($edit_filter > -1) {
html_print_submit_button (__('Update'), 'submit_button', false, 'class="sub upd"'); html_print_submit_button (__('Update'), 'submit_button', false, 'class="sub upd"');
} }
@ -112,11 +196,11 @@ if ($edit_filter > -2) {
// Overview // Overview
} }
else { else {
$result = db_get_all_rows_in_table ("tsnmp_filter"); $result_unified = db_get_all_rows_sql("SELECT DISTINCT(unified_filters_id) FROM tsnmp_filter ORDER BY unified_filters_id ASC");
if ($result === false) {
$result = array (); $aglomerate_result = array();
require_once ($config['homedir'] . "/general/firts_task/snmp_filters.php"); foreach ($result_unified as $res) {
return; $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->data = array ();
@ -134,15 +218,42 @@ else {
$table->size[2] = "50px"; $table->size[2] = "50px";
$table->align[2] = 'center'; $table->align[2] = 'center';
foreach ($result as $row) { foreach ($aglomerate_result as $ind => $row) {
$data = array (); if ($ind == 0) {
$data[0] = '<a href="index.php?sec=snmpconsole&sec2=godmode/snmpconsole/snmp_filters&edit_filter='.$row['id_snmp_filter'].'">' . $row['description'] . '</a>'; foreach ($row as $r) {
$data[1] = $row['filter']; $data = array ();
$data[2] = '<a href="index.php?sec=snmpconsole&sec2=godmode/snmpconsole/snmp_filters&edit_filter='.$row['id_snmp_filter'].'">' . $data[0] = '<a href="index.php?sec=snmpconsole&sec2=godmode/snmpconsole/snmp_filters&edit_filter='.$r['id_snmp_filter'].'">' . $r['description'] . '</a>';
html_print_image("images/config.png", true, array("border" => '0', "alt" => __('Update'))) . '</a>' . $data[1] = $r['filter'];
'&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'].'">' . $data[2] = '<a href="index.php?sec=snmpconsole&sec2=godmode/snmpconsole/snmp_filters&edit_filter='.$r['id_snmp_filter'].'">' .
html_print_image("images/cross.png", true, array("border" => '0', "alt" => __('Delete'))) . '</a>'; html_print_image("images/config.png", true, array("border" => '0', "alt" => __('Update'))) . '</a>' .
array_push ($table->data, $data); '&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)) { if (!empty ($table->data)) {
@ -157,3 +268,44 @@ else {
echo '</form></div>'; 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>

View File

@ -58,7 +58,14 @@ $baseurl = ui_get_full_url(false, false, false, false);
var text1_mr_file = "<?php echo __('There are new database changes available to apply. Do you want to start the DB update process?'); ?>\n"; var text1_mr_file = "<?php echo __('There are new database changes available to apply. Do you want to start the DB update process?'); ?>\n";
var text2_mr_file = "<?php echo __('We recommend launching '); ?>\n"; var text2_mr_file = "<?php echo __('We recommend launching '); ?>\n";
var text3_mr_file = "<?php echo __('planned downtime'); ?>\n"; var text3_mr_file = "<?php echo __('planned downtime'); ?>\n";
var text4_mr_file = "<?php echo __(' to this process'); ?>\n"; var text4_mr_file = "<?php
if($config['language'] == 'es'){
echo __(' to this process').'<br><br><a style=\"font-size:10pt;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\">'.__('About minor release update').'</a>';
}
else{
echo __(' to this process').'<br><br><a style=\"font-size:10pt;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>';
}
?>";
var text1_package_file = "<?php echo __('There is a new update available'); ?>\n"; var text1_package_file = "<?php echo __('There is a new update available'); ?>\n";
var text2_package_file = "<?php echo __('There is a new update available to apply. Do you want to start the update process?'); ?>\n"; var text2_package_file = "<?php echo __('There is a new update available to apply. Do you want to start the update process?'); ?>\n";
var applying_mr = "<?php echo __('Applying DB MR'); ?>\n"; var applying_mr = "<?php echo __('Applying DB MR'); ?>\n";

View File

@ -236,6 +236,8 @@ if ($create_user) {
case "postgresql": case "postgresql":
$result = create_user($id, $password_new, $values); $result = create_user($id, $password_new, $values);
if ($result) { if ($result) {
db_process_sql_insert ('tsesion', array('id_sesion' => '','id_usuario' => $id,'ip_origen' => $_SERVER['REMOTE_ADDR'],'accion' => 'Password&#x20;change',
'descripcion' => 'Access password updated','fecha' => date("Y-m-d H:i:s"),'utimestamp' => time()));
$res = save_pass_history($id, $password_new); $res = save_pass_history($id, $password_new);
} }
break; break;
@ -334,6 +336,8 @@ if ($update_user) {
else { else {
$res2 = update_user_password ($id, $password_new); $res2 = update_user_password ($id, $password_new);
if ($res2) { if ($res2) {
db_process_sql_insert ('tsesion', array('id_sesion' => '','id_usuario' => $id,'ip_origen' => $_SERVER['REMOTE_ADDR'],'accion' => 'Password&#x20;change',
'descripcion' => 'Access password updated','fecha' => date("Y-m-d H:i:s"),'utimestamp' => time()));
$res3 = save_pass_history($id, $password_new); $res3 = save_pass_history($id, $password_new);
} }
ui_print_result_message ($res1 || $res2, ui_print_result_message ($res1 || $res2,
@ -345,6 +349,8 @@ if ($update_user) {
$res2 = update_user_password ($id, $password_new); $res2 = update_user_password ($id, $password_new);
if ($res2) { if ($res2) {
$res3 = save_pass_history($id, $password_new); $res3 = save_pass_history($id, $password_new);
db_process_sql_insert ('tsesion', array('id_sesion' => '','id_usuario' => $id,'ip_origen' => $_SERVER['REMOTE_ADDR'],'accion' => 'Password&#x20;change',
'descripcion' => 'Access password updated','fecha' => date("Y-m-d H:i:s"),'utimestamp' => time()));
} }
ui_print_result_message ($res1 || $res2, ui_print_result_message ($res1 || $res2,
__('User info successfully updated'), __('User info successfully updated'),

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

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

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