Merge branch 'develop' into 1335-Configurar_graficas_full_scale_por_defecto

This commit is contained in:
daniel 2017-10-06 08:37:56 +02:00
commit 45743e2dc5
94 changed files with 2599 additions and 1797 deletions

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -1,6 +1,6 @@
# Base config file for Pandora FMS Windows Agent
# (c) 2006-2010 Artica Soluciones Tecnologicas
# Version 7.0NG.712
# Version 7.0NG.713
# This program is Free Software, you can redistribute it and/or modify it
# under the terms of the GNU General Public Licence as published by the Free Software

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -1,5 +1,5 @@
package: pandorafms-agent-unix
Version: 7.0NG.712-170926
Version: 7.0NG.713-171006
Architecture: all
Priority: optional
Section: admin

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -40,8 +40,8 @@ my $Sem = undef;
# Semaphore used to control the number of threads
my $ThreadSem = undef;
use constant AGENT_VERSION => '7.0NG.712';
use constant AGENT_BUILD => '170926';
use constant AGENT_VERSION => '7.0NG.713';
use constant AGENT_BUILD => '171006';
# Agent log default file size maximum and instances
use constant DEFAULT_MAX_LOG_SIZE => 600000;

View File

@ -2,8 +2,8 @@
#Pandora FMS Linux Agent
#
%define name pandorafms_agent_unix
%define version 7.0NG.712
%define release 170926
%define version 7.0NG.713
%define release 171006
Summary: Pandora FMS Linux agent, PERL version
Name: %{name}

View File

@ -2,8 +2,8 @@
#Pandora FMS Linux Agent
#
%define name pandorafms_agent_unix
%define version 7.0NG.712
%define release 170926
%define version 7.0NG.713
%define release 171006
Summary: Pandora FMS Linux agent, PERL version
Name: %{name}

View File

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

View File

@ -1,6 +1,6 @@
# Base config file for Pandora FMS Windows Agent
# (c) 2006-2014 Artica Soluciones Tecnologicas
# Version 7.0NG.712
# Version 7.0NG.713
# This program is Free Software, you can redistribute it and/or modify it
# under the terms of the GNU General Public Licence as published by the Free Software

View File

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

View File

@ -169,7 +169,7 @@ Pandora_Module_Logevent::run () {
this->openLogEvent();
// Read events
this->getLogEvents (event_list, 0);
this->getLogEvents (event_list);
// No data
if (event_list.size () < 1) {
@ -215,7 +215,7 @@ Pandora_Module_Logevent::openLogEvent () {
if (this->first_run == 1) {
this->first_run = 0;
if (Pandora::getPandoraDebug() == false) {
this->getLogEvents (event_list, 1);
this->seekAtTop (event_list);
}
}
@ -237,11 +237,86 @@ Pandora_Module_Logevent::closeLogEvent () {
this->log_event = NULL;
}
/**
* Puts the event handler on top of event list
* avoiding the use of EVENTLOG_SEEK_READ because it is buggy
*/
int
Pandora_Module_Logevent::seekAtTop (list<string> &event_list) {
BYTE *buffer = NULL, *new_buffer = NULL;
DWORD to_read, read, needed;
EVENTLOGRECORD *pevlr = NULL;
bool rc = false;
DWORD last_error;
DWORD direction = EVENTLOG_BACKWARDS_READ;
if (this->log_event == NULL) {
return -1;
}
// Initialize the event record buffer
to_read = BUFFER_SIZE;
buffer = (BYTE *) malloc (sizeof (BYTE) * BUFFER_SIZE);
if (buffer == NULL) {
return -1;
}
pevlr = (EVENTLOGRECORD *) buffer;
// Read events
while (1) {
rc = ReadEventLog (this->log_event, direction | EVENTLOG_SEQUENTIAL_READ, 0, pevlr, to_read, &read, &needed);
direction = EVENTLOG_FORWARDS_READ;
if (!rc) {
// Get error details
last_error = GetLastError();
// Not enough space in the buffer
if(last_error == ERROR_INSUFFICIENT_BUFFER) {
// Initialize the new event record buffer
to_read = needed;
new_buffer = (BYTE *) realloc (buffer, sizeof (BYTE) * needed);
if (new_buffer == NULL) {
free ((void *) buffer);
return -1;
}
buffer = new_buffer;
pevlr = (EVENTLOGRECORD *) buffer;
// Try to read the event again
continue;
// File corrupted or cleared
} else if (last_error == ERROR_EVENTLOG_FILE_CORRUPT || last_error == ERROR_EVENTLOG_FILE_CHANGED) {
closeLogEvent ();
free ((void *) buffer);
return -1;
}
// Unknown error
else {
free ((void *) buffer);
return -1;
}
}
// No more events
if (read == 0) {
free ((void *) buffer);
return 0;
}
}
free ((void *) buffer);
return 0;
}
/**
* Reads available events from the event log.
*/
int
Pandora_Module_Logevent::getLogEvents (list<string> &event_list, unsigned char discard) {
Pandora_Module_Logevent::getLogEvents (list<string> &event_list) {
char message[BUFFER_SIZE], timestamp[TIMESTAMP_LEN + 1];
struct tm *time_info = NULL;
time_t epoch;
@ -313,11 +388,6 @@ Pandora_Module_Logevent::getLogEvents (list<string> &event_list, unsigned char d
free ((void *) buffer);
return 0;
}
// Discard existing events
if (discard == 1) {
continue;
}
// Process read events
while (read > 0) {

View File

@ -69,7 +69,8 @@ namespace Pandora_Modules {
HANDLE openLogEvent ();
void closeLogEvent ();
int getLogEvents (list<string> &event_list, unsigned char discard);
int getLogEvents (list<string> &event_list);
int seekAtTop (list<string> &event_list);
void timestampToSystemtime (string timestamp, SYSTEMTIME *system_time);
void getEventDescription (PEVENTLOGRECORD pevlr, char *message, DWORD flags);
string getEventDescriptionXPATH (PEVENTLOGRECORD pevlr);

View File

@ -20,12 +20,12 @@
*/
#include "pandora_module_service.h"
#include "pandora_module_list.h"
#include "../windows/pandora_wmi.h"
#include "../pandora_strutils.h"
#include "../pandora_windows_service.h"
#include <algorithm>
#include <cctype>
#include <sys/stat.h>
using namespace Pandora;
using namespace Pandora_Modules;
@ -83,8 +83,6 @@ async_run (Pandora_Module_Service *module) {
HANDLE event_log;
HANDLE event;
DWORD result;
int res;
string str_res;
BYTE buffer[BUFFER_SIZE];
EVENTLOGRECORD *record;
DWORD read;
@ -93,10 +91,20 @@ async_run (Pandora_Module_Service *module) {
bool service_event;
string prev_res;
Pandora_Module_List *modules;
bool polling;
prev_res = module->getLatestOutput ();
modules = new Pandora_Module_List ();
modules->addModule (module);
struct stat st;
// Use polling if there is not local politics and events
// do not emit logs. It is a way to check if there is a
// Home Edition Windows distribution
polling = (stat("C:\\Windows\\System32\\gpedit.msc", &st) != 0);
if (polling) {
pandoraLog("Async polling service %s for this Windows edition", module->getServiceName().c_str());
}
while (1) {
event_log = OpenEventLog (NULL, "Service Control Manager");
@ -113,6 +121,12 @@ async_run (Pandora_Module_Service *module) {
if (result != WAIT_OBJECT_0) {
CloseHandle (event);
CloseEventLog (event_log);
// If time out and polling,
// check the service status actively
if (result == WAIT_TIMEOUT && polling) {
pandoraLog("Timeout. Polling");
module->execute_async_service(prev_res, module, modules);
}
continue;
}
@ -138,17 +152,7 @@ async_run (Pandora_Module_Service *module) {
/* A start/stop action was thrown */
if (service_event) {
res = Pandora_Wmi::isServiceRunning (module->getServiceName ());
str_res = inttostr (res);
if (str_res != prev_res) {
module->setOutput (str_res);
prev_res = str_res;
Pandora_Windows_Service::getInstance ()->sendXml (modules);
}
if (res == 0 && module->isWatchdog ()) {
Pandora_Wmi::startService (module->getServiceName ());
}
module->execute_async_service(prev_res, module, modules);
}
CloseHandle (event);
CloseEventLog (event_log);
@ -156,6 +160,31 @@ async_run (Pandora_Module_Service *module) {
delete modules;
}
/*
* Execute the service async task
*/
void
Pandora_Module_Service::execute_async_service(
string &prev_res, Pandora_Module_Service *module, Pandora_Module_List *modules
) {
string str_res;
int res;
res = Pandora_Wmi::isServiceRunning (module->getServiceName ());
str_res = inttostr (res);
if (str_res != prev_res) {
module->setOutput (str_res);
prev_res = str_res;
Pandora_Windows_Service::getInstance ()->sendXml (modules);
}
if (res == 0 && module->isWatchdog ()) {
pandoraLog("Starting service");
Pandora_Wmi::startService (module->getServiceName ());
}
}
void
Pandora_Module_Service::run () {
int res;

View File

@ -23,6 +23,7 @@
#define __PANDORA_MODULE_SERVICE_H__
#include "pandora_module.h"
#include "pandora_module_list.h"
namespace Pandora_Modules {
/**
@ -41,6 +42,7 @@ namespace Pandora_Modules {
void run ();
string getServiceName () const;
bool isWatchdog () const;
void execute_async_service (string &prev_res, Pandora_Module_Service *module, Pandora_Module_List *modules);
void setWatchdog (bool watchdog);
};

View File

@ -30,7 +30,7 @@ using namespace Pandora;
using namespace Pandora_Strutils;
#define PATH_SIZE _MAX_PATH+1
#define PANDORA_VERSION ("7.0NG.712(Build 170926)")
#define PANDORA_VERSION ("7.0NG.713(Build 171006)")
string pandora_path;
string pandora_dir;

View File

@ -11,7 +11,7 @@ BEGIN
VALUE "LegalCopyright", "Artica ST"
VALUE "OriginalFilename", "PandoraAgent.exe"
VALUE "ProductName", "Pandora FMS Windows Agent"
VALUE "ProductVersion", "(7.0NG.712(Build 170926))"
VALUE "ProductVersion", "(7.0NG.713(Build 171006))"
VALUE "FileVersion", "1.0.0.0"
END
END

View File

@ -1,5 +1,5 @@
package: pandorafms-console
Version: 7.0NG.712-170926
Version: 7.0NG.713-171006
Architecture: all
Priority: optional
Section: admin

View File

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

View File

@ -31,8 +31,6 @@ function extension_db_status_extension_tables() {
function extension_db_status() {
global $config;
$db_user = get_parameter('db_user', '');
$db_password = get_parameter('db_password', '');
$db_host = get_parameter('db_host', '');
@ -40,11 +38,11 @@ function extension_db_status() {
$db_status_execute = (bool)get_parameter('db_status_execute', false);
ui_print_page_header (__("DB Status"),
ui_print_page_header (__("DB Schema check"),
"images/extensions.png", false, "", true, "");
if (! check_acl ($config['id_user'], 0, "DM")) {
if (!is_user_admin($config['id_user'])) {
db_pandora_audit("ACL Violation",
"Trying to access db status");
require ("general/noaccess.php");
@ -367,5 +365,5 @@ function extension_db_status_execute_sql_file($url, $connection) {
}
extensions_add_godmode_function('extension_db_status');
extensions_add_godmode_menu_option(__('DB Status'), 'DM', 'gextensions', null, "v1r1", 'gdbman');
extensions_add_godmode_menu_option(__('DB Schema check'), 'DM', 'gextensions', null, "v1r1", 'gdbman');
?>

View File

@ -114,7 +114,7 @@ function dbmgr_extension_main () {
global $config;
if (! check_acl ($config['id_user'], 0, "PM") && ! is_user_admin ($config['id_user'])) {
if (!is_user_admin($config['id_user'])) {
db_pandora_audit("ACL Violation", "Trying to access Setup Management");
require ("general/noaccess.php");
return;

View File

@ -38,9 +38,10 @@ function render_row ($data, $label) {
}
else {
echo "<tr>";
echo "<td>" . $label;
echo "<td>" . $data;
echo "</td>";
echo "<td style='padding:2px;border:0px;' width='60%'><div style='padding:5px;background-color:#f2f2f2;border-radius:2px;text-align:left;border:0px;'>" . $label;
echo "</div></td>";
echo "<td style='font-weight:bold;padding:2px;border:0px;' width='40%'><div style='padding:5px;background-color:#f2f2f2;border-radius:2px;text-align:left;border:0px;'>" . $data;
echo "</div></td>";
echo "</tr>";
}
}
@ -89,35 +90,154 @@ else {
// Header
ui_print_page_header (__('Pandora FMS Diagnostic tool'), "", false, "", true);
echo "<table with='100%' class='databox data' cellpadding='4' cellspacing='4'>";
echo "<tr><th align=left>".__("Item")."</th>";
echo "<th>".__("Data value")."</th></tr>";
echo "<table width='1000px' border='0' style='border:0px;' class='databox data' cellpadding='4' cellspacing='4'>";
echo "<tr><th style='background-color:#b1b1b1;font-weight:bold;font-style:italic;border-radius:2px;' align=center colspan='2'>".__("Pandora status info")."</th></tr>";
}
render_row ($build_version, "Pandora FMS Build");
render_row ($pandora_version, "Pandora FMS Version");
render_info_data ("SELECT value FROM tconfig where token ='MR'","Minor Release");
render_row ($config["homedir"], "Homedir");
render_row ($config["homeurl"], "HomeUrl");
render_info_data ("SELECT `value`
FROM tconfig
WHERE `token` = 'enterprise_installed'", "Enterprise installed");
$full_key = db_get_sql("SELECT value
FROM tupdate_settings
WHERE `key` = 'customer_key'");
$compressed_key = substr($full_key, 0,5).'...'.substr($full_key, -5);
render_row ($compressed_key,"Update Key");
render_info_data ("SELECT value
FROM tupdate_settings
WHERE `key` = 'updating_code_path'", "Updating code path");
render_info_data ("SELECT value
FROM tupdate_settings
WHERE `key` = 'current_update'", "Current Update #");
echo "<tr><th style='background-color:#b1b1b1;font-weight:bold;font-style:italic;border-radius:2px;' align=center colspan='2'>".__("PHP setup")."</th></tr>";
render_row (phpversion(), "PHP Version");
render_info ("tagente");
render_info ("tagent_access");
render_info ("tagente_datos");
render_info ("tagente_datos_string");
render_info ("tagente_estado");
render_info ("tagente_modulo");
render_info ("talert_actions");
render_info ("talert_commands");
render_info ("talert_template_modules");
render_info ("tevento");
render_info ("tlayout");
render_row (ini_get('max_execution_time'), "PHP Max ejecution time");
render_row (ini_get('max_input_time'), "PHP Max input time");
render_row (ini_get('memory_limit'), "PHP Memory limit");
render_row (ini_get('session.cookie_lifetime'), "Session cookie lifetime");
echo "<tr><th style='background-color:#b1b1b1;font-weight:bold;font-style:italic;border-radius:2px;' align=center colspan='2'>".__("Database size stats")."</th></tr>";
render_info_data ("SELECT COUNT(*) FROM tagente","Total agents");
render_info_data ("SELECT COUNT(*) FROM tagente_modulo","Total modules");
render_info_data ("SELECT COUNT(*) FROM tgrupo","Total groups");
render_info_data ("SELECT COUNT(*) FROM tagente_datos","Total module data records");
// render_info_data ("SELECT COUNT(*) FROM tagente_datos_string","Total module string data records");
// render_info_data ("SELECT COUNT(*) FROM tagente_datos_log4x","Total module log4x data records");
render_info_data ("SELECT COUNT(*) FROM tagent_access","Total agent access record");
// render_info ("tagente_estado");
// render_info ("talert_template_modules");
render_info_data ("SELECT COUNT(*) FROM tevento","Total events");
if($config['enterprise_installed'])
render_info ("tlocal_component");
render_info ("tserver");
render_info ("treport");
render_info ("ttrap");
render_info ("tusuario");
render_info ("tsesion");
render_info_data ("SELECT COUNT(*) FROM ttrap","Total traps");
render_info_data ("SELECT COUNT(*) FROM tusuario","Total users");
render_info_data ("SELECT COUNT(*) FROM tsesion","Total sessions");
echo "<tr><th style='background-color:#b1b1b1;font-weight:bold;font-style:italic;border-radius:2px;' align=center colspan='2'>".__("Database sanity")."</th></tr>";
render_info_data ("SELECT COUNT( DISTINCT tagente.id_agente)
FROM tagente_estado, tagente, tagente_modulo
WHERE tagente.disabled = 0
AND tagente_modulo.id_agente_modulo = tagente_estado.id_agente_modulo
AND tagente_modulo.disabled = 0
AND tagente_estado.id_agente = tagente.id_agente
AND tagente_estado.estado = 3","Total unknown agents");
render_info_data ("SELECT COUNT( DISTINCT tagente.id_agente)
FROM tagente_estado, tagente, tagente_modulo
WHERE tagente.disabled = 0
AND tagente_modulo.id_agente_modulo = tagente_estado.id_agente_modulo
AND tagente_modulo.disabled = 0
AND tagente_estado.id_agente = tagente.id_agente
AND tagente_estado.estado = 4","Total not-init modules");
$last_run_difference = '';
$diferencia = time() - date (
db_get_sql ("SELECT `value`
FROM tconfig
WHERE `token` = 'db_maintance'"));
$last_run_difference_months = 0;
$last_run_difference_weeks = 0;
$last_run_difference_days = 0;
$last_run_difference_minutos = 0;
$last_run_difference_seconds = 0;
while($diferencia >= 2419200){
$diferencia -= 2419200;
$last_run_difference_months++;
}
while($diferencia >= 604800){
$diferencia -= 604800;
$last_run_difference_weeks++;
}
while($diferencia >= 86400){
$diferencia -= 86400;
$last_run_difference_days++;
}
while($diferencia >= 3600){
$diferencia -= 3600;
$last_run_difference_hours++;
}
while($diferencia >= 60){
$diferencia -= 60;
$last_run_difference_minutes++;
}
$last_run_difference_seconds = $diferencia;
if($last_run_difference_months > 0){
$last_run_difference .= $last_run_difference_months.'month/s ';
}
if ($last_run_difference_weeks > 0) {
$last_run_difference .= $last_run_difference_weeks.' week/s ';
}
if ($last_run_difference_days > 0) {
$last_run_difference .= $last_run_difference_days.' day/s ';
}
if ($last_run_difference_hours > 0) {
$last_run_difference .= $last_run_difference_hours.' hour/s ';
}
if ($last_run_difference_minutes > 0) {
$last_run_difference .= $last_run_difference_minutes.' minute/s ';
}
$last_run_difference .= $last_run_difference_seconds.' second/s ago';
render_row ( date ("Y/m/d H:i:s",
db_get_sql ("SELECT `value`
FROM tconfig
WHERE `token` = 'db_maintance'")).' ('.$last_run_difference.')'.' *', "PandoraDB Last run");
echo "<tr><th style='background-color:#b1b1b1;font-weight:bold;font-style:italic;border-radius:2px;' align=center colspan='2'>".__("Database status info")."</th></tr>";
switch ($config["dbtype"]) {
case "mysql":
@ -130,23 +250,22 @@ switch ($config["dbtype"]) {
render_info_data ("SELECT `value`
FROM tconfig
WHERE `token` = 'db_scheme_build'", "DB Schema Build");
render_info_data ("SELECT `value`
FROM tconfig
WHERE `token` = 'enterprise_installed'", "Enterprise installed");
render_row ( date ("Y/m/d H:i:s",
db_get_sql ("SELECT `value`
FROM tconfig
WHERE `token` = 'db_maintance'")), "PandoraDB Last run");
if(strpos($_SERVER['HTTP_USER_AGENT'],'Windows') == false){
echo "<tr><th style='background-color:#b1b1b1;font-weight:bold;font-style:italic;border-radius:2px;' align=center colspan='2'>".__("System info")."</th></tr>";
$output = 'cat /proc/cpuinfo | grep "model name" | tail -1 | cut -f 2 -d ":"';
$output2 = 'cat /proc/cpuinfo | grep "processor" | wc -l';
render_row(exec($output).' x '.exec($output2),'CPU');
$output = 'cat /proc/meminfo | grep "MemTotal"';
render_row(exec($output),'RAM');
}
render_info_data ("SELECT value
FROM tupdate_settings
WHERE `key` = 'customer_key';", "Update Key");
render_info_data ("SELECT value
FROM tupdate_settings
WHERE `key` = 'updating_code_path'", "Updating code path");
render_info_data ("SELECT value
FROM tupdate_settings
WHERE `key` = 'current_update'", "Current Update #");
break;
case "postgresql":
render_info_data ("SELECT \"value\"
@ -201,4 +320,12 @@ switch ($config["dbtype"]) {
if ($console_mode == 0) {
echo "</table>";
}
echo "<hr color='#b1b1b1' size=1 width=1000 align=left>";
echo "<span>".__('(*) Please check your Pandora Server setup and be sure that database maintenance daemon is running. It\' very important to
keep up-to-date database to get the best performance and results in Pandora')."</span><br><br><br>";
?>

View File

@ -205,7 +205,7 @@ if (!$new_agent) {
$table->data[1][0] = __('Alias');
$table->data[1][1] = html_print_input_text ('alias', $alias, '', 50, 100, true);
if($new_agent){
$table->data[1][1] .= html_print_checkbox ("alias_as_name", 1, $alias_as_name, true).__('Use alias as name');
$table->data[1][1] .= html_print_checkbox ("alias_as_name", 1, $config['alias_as_name'], true).__('Use alias as name');
}
$table->data[2][0] = __('IP Address');

View File

@ -1043,9 +1043,7 @@ if ($update_module || $create_module) {
}
*/
$configuration_data = str_replace('\\', "&#92;",
io_safe_input($new_configuration_data));;
html_debug($configuration_data, true);
io_safe_input($new_configuration_data));
}
// Services are an enterprise feature,
@ -1110,7 +1108,11 @@ if ($update_module || $create_module) {
$ff_event_critical = (int) get_parameter ('ff_event_critical');
$each_ff = (int) get_parameter ('each_ff');
$ff_timeout = (int) get_parameter ('ff_timeout');
$unit = (string) get_parameter('unit');
$unit = (string) get_parameter('unit_select');
if($unit == "none"){
$unit = (string) get_parameter('unit_text');
}
$id_tag = (array) get_parameter('id_tag_selected');
$serialize_ops = (string) get_parameter('serialize_ops');
$critical_instructions = (string) get_parameter('critical_instructions');

View File

@ -363,8 +363,12 @@ $table_advanced->data[1][1] = html_print_input_text ('custom_id', $custom_id, ''
$disabledBecauseInPolicy, false, '', $classdisabledBecauseInPolicy);
$table_advanced->data[1][3] = __('Unit');
$table_advanced->data[1][4] = html_print_input_text ('unit', $unit, '', 20, 65, true,
$disabledBecauseInPolicy, false, '', $classdisabledBecauseInPolicy);
// $table_advanced->data[1][4] = html_print_input_text ('unit', $unit, '', 20, 65, true,
// $disabledBecauseInPolicy, false, '', $classdisabledBecauseInPolicy);
// $table_advanced->colspan[1][4] = 3;
$table_advanced->data[1][4] =
html_print_extended_select_for_unit('unit',
$unit, '', '', '0', false, true, false, false);
$table_advanced->colspan[1][4] = 3;
$module_id_policy_module = 0;

View File

@ -20,7 +20,7 @@ $disabledBecauseInPolicy = false;
$disabledTextBecauseInPolicy = '';
$page = get_parameter('page', '');
$id_agente = get_parameter('id_agente', '');
$agent_name = get_parameter('agent_name', agents_get_name($id_agente));
$agent_name = get_parameter('agent_name', agents_get_alias($id_agente));
$id_agente_modulo= get_parameter('id_agent_module',0);
$custom_integer_2 = get_parameter ('custom_integer_2', 0);
$sql = 'SELECT *

View File

@ -788,6 +788,39 @@ $(document).ready (function () {
$("#module_type").trigger("change");
}
});
$('#agents').change(function(e){
for(var i=0;i<document.forms["form_modules"].agents.length;i++) {
if(document.forms["form_modules"].agents[0].selected == true){
var any = true;
}
if(i != 0 && document.forms["form_modules"].agents[i].selected){
var others = true;
}
if(any && others){
document.forms["form_modules"].agents[i].selected = false;
document.forms["form_modules"].agents[0].selected = false;
}
}
});
$('#module').change(function(e){
for(var i=0;i<document.forms["form_modules"].module.length;i++) {
if(document.forms["form_modules"].module[0].selected == true){
var any = true;
}
if(i != 0 && document.forms["form_modules"].module[i].selected){
var others = true;
}
if(any && others){
document.forms["form_modules"].module[i].selected = false;
document.forms["form_modules"].module[0].selected = false;
}
}
});
});
/* ]]> */
</script>

View File

@ -565,7 +565,7 @@ foreach ($targets2 as $t) {
$table->data['edit6'][1] = html_print_select ($targets, 'id_export', '','', __('No change'), '', true, false, false);
$table->data['edit6'][2] = __('Unit');
$table->data['edit6'][3] = html_print_input_text ('unit', '', '', 15, 60, true);
$table->data['edit6'][3] = html_print_extended_select_for_unit('unit','', '', '', '0', '15', true, false, false);
/* FF stands for Flip-flop */
@ -1087,6 +1087,39 @@ $(document).ready (function () {
selector = $("#form_edit input[name=selection_mode]:checked").val();
$("#id_agents").trigger("change");
});
$('#agents').change(function(e){
for(var i=0;i<document.forms["form_edit"].agents.length;i++) {
if(document.forms["form_edit"].agents[0].selected == true){
var any = true;
}
if(i != 0 && document.forms["form_edit"].agents[i].selected){
var others = true;
}
if(any && others){
document.forms["form_edit"].agents[i].selected = false;
document.forms["form_edit"].agents[0].selected = false;
}
}
});
$('#module').change(function(e){
for(var i=0;i<document.forms["form_edit"].module.length;i++) {
if(document.forms["form_edit"].module[0].selected == true){
var any = true;
}
if(i != 0 && document.forms["form_edit"].module[i].selected){
var others = true;
}
if(any && others){
document.forms["form_edit"].module[i].selected = false;
document.forms["form_edit"].module[0].selected = false;
}
}
});
});
function disabled_status () {
@ -1127,7 +1160,7 @@ function process_manage_edit ($module_name, $agents_select = null, $module_statu
/* List of fields which can be updated */
$fields = array ('dynamic_interval', 'dynamic_max', 'dynamic_min', 'dynamic_two_tailed', 'min_warning', 'max_warning', 'str_warning',
'min_critical', 'max_critical', 'str_critical', 'min_ff_event',
'module_interval', 'disabled', 'post_process', 'unit',
'module_interval', 'disabled', 'post_process', 'unit_select',
'snmp_community', 'tcp_send', 'custom_string_1',
'plugin_parameter', 'custom_string_2', 'custom_string_3', 'min',
'max', 'id_module_group', 'plugin_user', 'plugin_pass',
@ -1159,6 +1192,13 @@ function process_manage_edit ($module_name, $agents_select = null, $module_statu
$values['post_process'] = $value;
}
break;
case 'unit_select':
if($value == "none"){
$values['unit'] = (string) get_parameter('unit_text');
} else {
$values['unit'] = $value;
}
break;
default:
if ($value != '') {
$values[$field] = $value;

View File

@ -285,6 +285,7 @@ if (check_acl ($config['id_user'], 0, "PM")) {
}
if (check_acl ($config['id_user'], 0, "PM") || check_acl ($config['id_user'], 0, "DM")) {
$menu_godmode["gextensions"]["text"] = __('Admin tools');
$menu_godmode["gextensions"]["sec2"] = "godmode/extensions";
$menu_godmode["gextensions"]["id"] = "god-extensions";
@ -305,18 +306,13 @@ if (check_acl ($config['id_user'], 0, "PM") || check_acl ($config['id_user'], 0,
$sub["godmode/setup/file_manager"]["id"] = 'File manager';
}
if (check_acl ($config['id_user'], 0, "DM") || check_acl ($config['id_user'], 0, "PM")) {
$sub["gdbman"]["text"] = __('DB maintenance');
if (is_user_admin($config['id_user'])) {
$sub["gdbman"]["text"] = __('Admin tools');
$sub["gdbman"]["id"] = 'DB maintenance';
$sub["gdbman"]["type"] = "direct";
$sub["gdbman"]["subtype"] = "nolink";
$sub2 = array ();
$sub2["godmode/db/db_info"]["text"] = __('DB information');
$sub2["godmode/db/db_purge"]["text"] = __('Database purge');
$sub2["godmode/db/db_refine"]["text"] = __('Database debug');
$sub2["godmode/db/db_audit"]["text"] = __('Database audit');
$sub2["godmode/db/db_event"]["text"] = __('Database event');
$sub["gdbman"]["sub2"] = $sub2;
}
@ -330,14 +326,24 @@ if (is_array ($config['extensions'])) {
$sub2 = array ();
foreach ($config['extensions'] as $extension) {
// html_debug($extension);
//If no godmode_menu is a operation extension
if ($extension['godmode_menu'] == '') {
continue;
}
if ($extension['godmode_menu']['name'] == 'System Info') {
continue;
}
$extmenu = $extension['godmode_menu'];
if ($extmenu["name"] == 'DB interface' && !check_acl ($config['id_user'], 0, "DM")) {
if ($extmenu["name"] == 'DB interface' && !is_user_admin($config['id_user'])) {
continue;
}
if ($extmenu["name"] == 'DB Schema check' && !is_user_admin($config['id_user'])) {
continue;
}

View File

@ -54,6 +54,7 @@ if (enterprise_include_once('include/functions_reporting.php') !== ENTERPRISE_NO
$enterpriseEnable = true;
}
html_print_input_hidden ('custom_graph', 1);
if ($enterpriseEnable) {
$buttons = reporting_enterprise_add_template_graph_tabs($buttons);
}

View File

@ -222,6 +222,10 @@ $table->data[37][0] = __('audit log directory') .
ui_print_help_tip (__("Directory where audit log is stored."), true);
$table->data[37][1] = html_print_input_text ('auditdir', io_safe_output($config["auditdir"]), '', 30, 100, true);
$table->data[38][0] = __('Set alias as name by default in agent creation');
$table->data[38][1] = __('Yes').'&nbsp;&nbsp;&nbsp;'.html_print_radio_button ('alias_as_name', 1, '', $config["alias_as_name"], true).'&nbsp;&nbsp;';
$table->data[38][1] .= __('No').'&nbsp;&nbsp;&nbsp;'.html_print_radio_button ('alias_as_name', 0, '', $config["alias_as_name"], true);
echo '<form id="form_setup" method="post" action="index.php?sec=gsetup&sec2=godmode/setup/setup&amp;section=general&amp;pure='.$config['pure'].'">';
echo "<fieldset>";

Binary file not shown.

After

Width:  |  Height:  |  Size: 482 B

View File

@ -256,7 +256,7 @@ if ($get_module_detail) {
'ttipo_modulo', 'nombre', 'web_content_string');
$post_process = db_get_value_filter('post_process','tagente_modulo',array('id_agente_modulo' => $module_id));
$unit = db_get_value_filter('unit','tagente_modulo',array('id_agente_modulo' =>$module_id));
foreach ($result as $row) {
$data = array ();
@ -314,7 +314,12 @@ if ($get_module_detail) {
break;
default:
$data[] = remove_right_zeros(number_format($row[$attr[0]], $config['graph_precision']));
$data_macro = modules_get_unit_macro($row[$attr[0]],$unit);
if($data_macro){
$data[] = $data_macro;
} else {
$data[] = remove_right_zeros(number_format($row[$attr[0]], $config['graph_precision']));
}
break;
}
}
@ -323,11 +328,21 @@ if ($get_module_detail) {
$data[] = 'No data';
}
else {
if(is_snapshot_data($row[$attr[0]])){
$data[] = "<a target='_blank' href='".io_safe_input($row[$attr[0]])."'><img style='width:300px' src='".io_safe_input($row[$attr[0]])."'></a>";
if(is_snapshot_data($row[$attr[0]])){
if($config['command_snapshot']){
$data[] = "<a target='_blank' href='".io_safe_input($row[$attr[0]])."'><img style='width:300px' src='".io_safe_input($row[$attr[0]])."'></a>";
}
else{
$data[] = "<span>".wordwrap(io_safe_input($row[$attr[0]]),60,"<br>\n",true)."</span>";
}
}
else{
$data[] = $row[$attr[0]];
$data_macro = modules_get_unit_macro($row[$attr[0]],$unit);
if($data_macro){
$data[] = $data_macro;
} else {
$data[] = $row[$attr[0]];
}
}
}
}
@ -1007,13 +1022,24 @@ if ($list_modules) {
}
// Show units ONLY in numeric data types
if (isset($module["unit"])) {
$salida .= "&nbsp;" . '<i>'. io_safe_output($module["unit"]) . '</i>';
$data_macro = modules_get_unit_macro($module["datos"],$module["unit"]);
if($data_macro){
$salida = $data_macro;
} else {
$salida .= "&nbsp;" . '<i>'. io_safe_output($module["unit"]) . '</i>';
}
}
}
else {
$salida = ui_print_module_string_value(
$module["datos"], $module["id_agente_modulo"],
$module["current_interval"], $module["module_name"]);
$data_macro = modules_get_unit_macro($module["datos"],$module["unit"]);
if($data_macro){
$salida = $data_macro;
} else {
$salida = ui_print_module_string_value(
$module["datos"], $module["id_agente_modulo"],
$module["current_interval"], $module["module_name"]);
}
}
}
if($module["id_tipo_modulo"] != 25){

View File

@ -173,8 +173,6 @@ function process_user_login_local ($login, $pass, $api = false) {
function process_user_login_remote ($login, $pass, $api = false) {
global $config, $mysql_cache;
// Remote authentication
switch ($config["auth"]) {
// LDAP
@ -219,8 +217,6 @@ function process_user_login_remote ($login, $pass, $api = false) {
// Authentication ok, check if the user exists in the local database
if (is_user ($login)) {
if (!user_can_login($login)) {
return false;
}
@ -228,10 +224,27 @@ function process_user_login_remote ($login, $pass, $api = false) {
if (($config["auth"] === 'ad') &&
(isset($config['ad_advanced_config']) && $config['ad_advanced_config'])) {
$return = enterprise_hook ('prepare_permissions_groups_of_user_ad',
array ($login, $pass, false, true, defined('METACONSOLE')));
if ($return === "error_permissions") {
$config["auth_error"] =
__("Problems with configuration permissions. Please contact with Administrator");
return false;
}
else {
if ($return === "permissions_changed") {
$config["auth_error"] =
__("Your permissions have changed. Please, login again.");
return false;
}
}
}
elseif (($config["auth"] === 'ldap') &&
(isset($config['ldap_advanced_config']) && $config['ldap_advanced_config'])) {
$return = enterprise_hook ('prepare_permissions_groups_of_user_ldap',
array ($login, $pass, false, true, defined('METACONSOLE')));
if ($return === "error_permissions") {
$config["auth_error"] =
@ -245,13 +258,13 @@ function process_user_login_remote ($login, $pass, $api = false) {
return false;
}
}
change_local_user_pass_ldap ($login, $pass);
}
return $login;
}
// The user does not exist and can not be created
if ($config['autocreate_remote_users'] == 0 || is_user_blacklisted ($login)) {
$config["auth_error"] = __("Ooops User not found in
@ -297,6 +310,41 @@ function process_user_login_remote ($login, $pass, $api = false) {
return false;
}
}
elseif ($config["auth"] === 'ldap' &&
(isset($config['ldap_advanced_config']) &&
$config['ldap_advanced_config'])) {
if ( defined('METACONSOLE') ) {
enterprise_include_once('include/functions_metaconsole.php');
enterprise_include_once ('meta/include/functions_groups_meta.php');
$return = groups_meta_synchronizing();
if ($return["group_create_err"] > 0 || $return["group_update_err"] > 0) {
$config["auth_error"] = __('Fail the group synchronizing');
return false;
}
$return = meta_tags_synchronizing();
if ($return['tag_create_err'] > 0 || $return['tag_update_err'] > 0) {
$config["auth_error"] = __('Fail the tag synchronizing');
return false;
}
}
// Create the user
if (enterprise_hook ('prepare_permissions_groups_of_user_ldap',
array($login,
$pass,
array ('fullname' => $login,
'comments' => 'Imported from ' . $config['auth']),
false, defined('METACONSOLE'))) === false) {
$config["auth_error"] = __("User not found in database
or incorrect password");
return false;
}
}
else {
$user_info = array ('fullname' => $login,
@ -644,33 +692,51 @@ function ldap_process_user_login ($login, $password) {
return false;
}
}
$dc = $config["ldap_base_dn"];
$ldap_login_attr = !empty($config["ldap_login_attr"]) ? io_safe_output($config["ldap_login_attr"]) . "=" : '';
#Search group of this user it belong.
$filter="(cn=" . io_safe_output($login) . ")";
$justthese = array("objectclass=group");
$sr = ldap_search($ds, $dc, $filter, $justthese);
$memberof = ldap_get_entries($ds, $sr);
if ($memberof["count"] == 0 && !isset($memberof[0]["memberof"])) {
@ldap_close ($ds);
return false;
}
else {
$memberof = $memberof[0];
}
unset($memberof["count"]);
$ldap_base_dn = !empty($config["ldap_base_dn"]) ? "," . io_safe_output($config["ldap_base_dn"]) : '';
if(!empty($ldap_base_dn)){
if (strlen($password) == 0 ||
!@ldap_bind($ds, $ldap_login_attr.io_safe_output($login).$ldap_base_dn, $password) ) {
$config["auth_error"] = 'User not found in database or incorrect password';
@ldap_close ($ds);
return false;
$correct = false;
if(!empty($ldap_base_dn)) {
if (strlen($password) != 0 && @ldap_bind($ds, $memberof['dn'], $password) ) {
$correct = true;
}
} else {
if (strlen($password) == 0 ||
!@ldap_bind($ds, io_safe_output($login), $password) ) {
$config["auth_error"] = 'User not found in database or incorrect password';
@ldap_close ($ds);
return false;
}
else {
if (strlen($password) != 0 && @ldap_bind($ds, io_safe_output($login), $password) ) {
$correct = true;
}
}
@ldap_close ($ds);
return true;
if ($correct) {
return true;
}
else {
$config["auth_error"] = 'User not found in database or incorrect password';
return false;
}
}
/**
@ -693,6 +759,27 @@ function is_user_blacklisted ($user) {
return false;
}
/**
* Update local user pass from ldap user
*
* @param string Login
* @param string Password
*
* @return bool
*/
function change_local_user_pass_ldap ($id_user, $password) {
$local_user_pass = db_get_value_filter('password', 'tusuario', array('id_user' => $id_user));
if (md5($password) !== $local_user_pass) {
$values_update = array();
$values_update['password'] = md5($password);
db_process_sql_update('tusuario', $values_update, array('id_user' => $id_user));
}
return;
}
//Reference the global use authorization error to last auth error.
$config["auth_error"] = &$mysql_cache["auth_error"];
?>

View File

@ -22,8 +22,8 @@
/**
* Pandora build version and version
*/
$build_version = 'PC170926';
$pandora_version = 'v7.0NG.712';
$build_version = 'PC171006';
$pandora_version = 'v7.0NG.713';
// Do not overwrite default timezone set if defined.
$script_tz = @date_default_timezone_get();

View File

@ -206,6 +206,8 @@ function config_update_config () {
$error_update[] = __('Identification_reminder');
if (!config_update_value ('include_agents', (bool)get_parameter('include_agents')))
$error_update[] = __('Include_agents');
if (!config_update_value ('alias_as_name', get_parameter('alias_as_name')))
$error_update[] = __('alias_as_name');
if (!config_update_value ('auditdir', get_parameter('auditdir')))
$error_update[] = __('Audit log directory');
break;
@ -260,6 +262,8 @@ function config_update_config () {
$error_update[] = __('Server SMTP');
if (!config_update_value ('email_smtpPort', (int)get_parameter('email_smtpPort')))
$error_update[] = __('Port SMTP');
if (!config_update_value ('email_encryption', get_parameter('email_encryption')))
$error_update[] = __('Encryption');
if (!config_update_value ('email_username', get_parameter('email_username')))
$error_update[] = __('Email user');
if (!config_update_value ('email_password', get_parameter('email_password')))
@ -319,11 +323,14 @@ function config_update_config () {
$error_update[] = __('Start TLS');
if (!config_update_value ('ad_advanced_config', get_parameter ('ad_advanced_config')))
$error_update[] = __('Advanced Config AD');
if (!config_update_value ('ldap_advanced_config', get_parameter ('ldap_advanced_config')))
$error_update[] = __('Advanced Config LDAP');
if (!config_update_value ('ad_domain', get_parameter ('ad_domain')))
$error_update[] = __('Domain');
if (!config_update_value ('ad_adv_perms', get_parameter ('ad_adv_perms')))
$error_update[] = __('Advanced Permisions AD');
if (!config_update_value ('ldap_adv_perms', get_parameter ('ldap_adv_perms')))
$error_update[] = __('Advanced Permisions LDAP');
if (!config_update_value ('ldap_server', get_parameter ('ldap_server')))
$error_update[] = __('LDAP server');
if (!config_update_value ('ldap_port', get_parameter ('ldap_port')))
@ -1016,6 +1023,10 @@ function config_process_config () {
if (!isset ($config["include_agents"])) {
config_update_value ('include_agents', 0);
}
if (!isset ($config["alias_as_name"])) {
config_update_value ('alias_as_name', 0);
}
if (!isset ($config["auditdir"])) {
config_update_value ('auditdir',"/var/www/html/pandora_console");
@ -1231,6 +1242,10 @@ function config_process_config () {
if (!isset ($config['email_smtpPort'])) {
config_update_value ( 'email_smtpPort', 25);
}
if (!isset ($config['email_encryption'])) {
config_update_value ( 'email_encryption', 0);
}
if (!isset ($config['email_username'])) {
config_update_value ( 'email_username', "");
@ -1353,10 +1368,18 @@ function config_process_config () {
if (!isset ($config['ad_advanced_config'])) {
config_update_value ( 'ad_advanced_config', 0);
}
if (!isset ($config['ldap_advanced_config'])) {
config_update_value ( 'ldap_advanced_config', 0);
}
if (!isset ($config['ad_adv_user_node'])) {
config_update_value ( 'ad_adv_user_node', 1);
}
if (!isset ($config['ldap_adv_user_node'])) {
config_update_value ( 'ldap_adv_user_node', 1);
}
if (!isset ($config['ad_domain'])) {
config_update_value ( 'ad_domain', '');
@ -1425,6 +1448,70 @@ function config_process_config () {
config_update_value ('ad_adv_perms', $temp_ad_adv_perms);
}
}
if (!isset ($config['ldap_adv_perms'])) {
config_update_value ('ldap_adv_perms', '');
}
else {
if (!json_decode(io_safe_output($config['ldap_adv_perms']))) {
$temp_ldap_adv_perms = array();
if ($config['ldap_adv_perms'] != '') {
$perms = explode(';', io_safe_output($config['ldap_adv_perms']));
foreach ($perms as $ad_adv_perm) {
if (preg_match('/[\[\]]/',$ad_adv_perm)) {
$all_data = explode (",", io_safe_output($ad_adv_perm));
$profile = $all_data[0];
$group_pnd = $all_data[1];
$groups_ad = str_replace(array("[","]"), "", $all_data[2]);
$tags = str_replace(array("[","]"), "", $all_data[3]);
$groups_ad = explode('|', $groups_ad);
$tags_name = explode('|', $tags);
$tags_ids = array();
foreach ($tags_name as $tag) {
$tags_ids[] = tags_get_id($tag);
}
$profile = profile_get_profiles(
array(
"name" => io_safe_input($profile)));
if (!$profile)
continue;
$profile_id = array_keys($profile);
$id_grupo = groups_get_id (io_safe_input($group_pnd), false);
$new_ldap_adv_perms[] =
array('profile' => $profile_id[0],
'group' => array($id_grupo),
'tags' => $tags_ids,
'groups_ldap' => $groups_ldap);
}
else {
$all_data = explode (",", io_safe_output($ad_adv_perm));
$profile = $all_data[0];
$group_pnd = $all_data[1];
$groups_ad = $all_data[2];
$tags = $all_data[3];
$profile = profile_get_profiles(
array(
"name" => io_safe_input($profile)));
if (!$profile)
continue;
$profile_id = array_keys($profile);
$id_grupo = groups_get_id (io_safe_input($group_pnd), false);
$new_ldap_adv_perms[] =
array('profile' => $profile_id[0],
'group' => array($id_grupo),
'tags' => array($tags),
'groups_ldap' => array($groups_ldap));
}
}
if (!empty($new_ldap_adv_perms)) {
$temp_ldap_adv_perms = json_encode($new_ldap_adv_perms);
}
}
config_update_value ('ldap_adv_perms', $temp_ldap_adv_perms);
}
}
if (!isset ($config['rpandora_server'])) {
config_update_value ( 'rpandora_server', 'localhost');

View File

@ -146,7 +146,7 @@ function events_get_events_grouped($sql_post, $offset = 0,
$sql = "SELECT COUNT(*) FROM (SELECT *
FROM $table te
WHERE 1=1 " . $sql_post . "
GROUP BY estado, evento, id_agentmodule" . $groupby_extra . ") AS t";
GROUP BY estado, evento, id_agente, id_agentmodule" . $groupby_extra . ") AS t";
}
else {
$sql = "SELECT *, MAX(id_evento) AS id_evento,
@ -161,7 +161,7 @@ function events_get_events_grouped($sql_post, $offset = 0,
(SELECT ack_utimestamp FROM $table WHERE id_evento = MAX(te.id_evento)) AS ack_utimestamp
FROM $table te
WHERE 1=1 " . $sql_post . "
GROUP BY estado, evento, id_agentmodule" . $groupby_extra . "
GROUP BY estado, evento, id_agente, id_agentmodule" . $groupby_extra . "
ORDER BY timestamp_rep " . $order . " LIMIT " . $offset . "," . $pagination;
}
break;

View File

@ -699,6 +699,9 @@ function grafico_modulo_sparse_data ($agent_module_id, $period, $show_events,
if (empty($unit)) {
$unit = modules_get_unit($agent_module_id);
if(modules_is_unit_macro($unit)){
$unit = "";
}
}
// Get module warning_min and critical_min
@ -788,8 +791,10 @@ function grafico_modulo_sparse_data ($agent_module_id, $period, $show_events,
'border' => '#000000', 'color' => $config['graph_color1'],
'alpha' => CHART_DEFAULT_ALPHA);
$color['unit'.$series_suffix] = array('border' => null, 'color' => '#0097BC', 'alpha' => 10);
$color['unit'.$series_suffix] = array('border' => null, 'color' => '#0097BC', 'alpha' => 10);
if(modules_is_unit_macro($unit)){
$unit = "";
}
if ($show_events) {
$legend['event'.$series_suffix_str] = __('Events').$series_suffix_str;
$chart_extra_data['legend_events'] = $legend['event'.$series_suffix_str];
@ -5654,13 +5659,13 @@ function graph_nodata_image($width = 300, $height = 110, $type = 'area', $text =
$image = ui_get_full_url('images/image_problem_' . $type . '.png',
false, false, false);
if ($text == '') {
$text = __('No data to show');
}
// if ($text == '') {
// $text = __('No data to show');
// }
$text_div = '<div class="nodata_text">' . $text . '</div>';
$image_div = '<div class="nodata_container" style="background-image: url(\'' . $image . '\');">' .
$image_div = '<div class="nodata_container" style="width:80%;height:80%;background-size: 80% 80%;background-image: url(\'' . $image . '\');">' .
$text_div . '</div>';
$div = '<div style="width:' . $width . 'px; height:' . $height . 'px; border: 1px dotted #ddd; background-color: white; margin: 0 auto;">' .

View File

@ -621,6 +621,85 @@ function html_print_select_from_sql ($sql, $name, $selected = '',
$disabled, $style,'', $size);
}
function html_print_extended_select_for_unit($name, $selected = '',
$script = '', $nothing = '', $nothing_value = '0', $size = false,
$return = false, $select_style = false, $unique_name = true,
$disabled = false, $no_change = 0) {
global $config;
// $fields = post_process_get_custom_values();
$fields['_timeticks_'] = 'Timeticks';
$fields['none'] = __('none');
if($no_change != 0){
$fields[-1] = __('No change');
}
// $selected_float = (float)$selected;
// $found = false;
//
// if (array_key_exists($selected, $fields))
// $found = true;
//
// if (!$found) {
// $fields[$selected] = floatval($selected);
// }
if ($unique_name === true) {
$uniq_name = uniqid($name);
}
else {
$uniq_name = $name;
}
ob_start();
echo '<div id="' . $uniq_name . '_default" style="width:100%;display:inline;">';
html_print_select ($fields, $uniq_name . '_select', $selected,
"" . $script, $nothing, $nothing_value, false, false, false,
'', $disabled, 'font-size: xx-small;' . $select_style);
echo ' <a href="javascript:">' .
html_print_image('images/pencil.png', true,
array('class' => $uniq_name . '_toggler',
'alt' => __('Custom'),
'title' => __('Custom'),
'style' => 'width: 18px;')) .
'</a>';
echo '</div>';
echo '<div id="' . $uniq_name . '_manual" style="width:100%;display:inline;">';
html_print_input_text ($uniq_name . '_text', $selected, '', 20);
html_print_input_hidden($name, $selected, false, $uniq_name);
echo ' <a href="javascript:">' .
html_print_image('images/default_list.png', true,
array('class' => $uniq_name . '_toggler',
'alt' => __('List'),
'title' => __('List'),
'style' => 'width: 18px;')) . '</a>';
echo '</div>';
echo "<script type='text/javascript'>
$(document).ready (function () {
post_process_select_init_unit('$uniq_name','$selected');
post_process_select_events_unit('$uniq_name','$selected');
});
</script>";
$returnString = ob_get_clean();
if ($return)
return $returnString;
else
echo $returnString;
}
function html_print_extended_select_for_post_process($name, $selected = '',
$script = '', $nothing = '', $nothing_value = '0', $size = false,
$return = false, $select_style = false, $unique_name = true,

View File

@ -1597,6 +1597,35 @@ function modules_get_agentmodule_last_status($id_agentmodule = 0) {
return $status_row['known_status'];
}
/**
* Get the data by applying the macro.
*
* @param string macro unit.
*
* @return false or data with applied macro.
*/
function modules_get_unit_macro($data,$macro) {
if(modules_is_unit_macro($macro)){
$data = human_milliseconds_to_string($data);
return $data;
}
return false;
}
/**
* Check if it's a unit macro.
*
* @param string macro unit.
*
* @return false or true.
*/
function modules_is_unit_macro($macro) {
if($macro == "_timeticks_"){
return true;
}
return false;
}
/**
* Get the current value of an agent module.
*

View File

@ -247,8 +247,21 @@ function treeview_printModuleTable($id_module, $server_data = false, $no_head =
$last_data_str = $data;
if ($module['unit'] != '') {
$last_data_str .= "&nbsp;";
$last_data_str .= '('.$module['unit'].')';
$data_macro = modules_get_unit_macro($last_data["datos"],$module['unit']);
if($data_macro){
if (is_numeric($data_macro))
$last_data_str = "<span style='height: 20px; display: inline-table; vertical-align: top;'>" .
remove_right_zeros(number_format($data_macro, $config['graph_precision'])) . "</span>";
else
$last_data_str = ui_print_truncate_text(io_safe_output($data_macro),
GENERIC_SIZE_TEXT, true, true, true,
'...', 'white-space: nowrap;');
} else {
$last_data_str .= "&nbsp;";
$last_data_str .= '('.$module['unit'].')';
}
}
$last_data_str .= "&nbsp;";

View File

@ -22,7 +22,7 @@
result = [];
// Throw errors
var retrieveDataOject = function (dataObjects) {
var retrieveDataOject = function (dataObjects, custom) {
var result;
if (typeof dataObjects === 'undefined')
@ -34,10 +34,13 @@
}
if (dataObjects.length > 1) {
dataObjects.forEach(function (element) {
if (/^Avg.:/i.test(element.label))
result = element;
if (/^Percentil/i.test(element.label))
if(custom){
if (/^Avg.:/i.test(element.label)){
result = element;
}
} else {
result = element;
}
});
// If the avg set is missing, retrieve the first set
@ -145,14 +148,14 @@
var custom_graph = $('#hidden-custom_graph').val();
if (custom_graph) {
dataObject = retrieveDataOject(dataObjects);
dataObject = retrieveDataOject(dataObjects,0);
dataObjects.forEach(function (element) {
elements.push(processDataObject(element));
});
graphData = elements;
}
else {
dataObject = retrieveDataOject(dataObjects);
dataObject = retrieveDataOject(dataObjects,1);
elements.push(processDataObject(dataObject));
graphData = elements;
}

View File

@ -891,10 +891,17 @@ function pandoraFlotArea(graph_id, values, labels, labels_long, legend,
// Prepared to turn series with a checkbox
// var showed = new Array();
var min_check = 0;
for (i = 0; i < values.length; i++) {
var serie = values[i].split(separator);
var aux = new Array();
$.each(serie, function(i, v) {
if(v < 0){
if(min_check > parseFloat(v)){
min_check = v;
}
}
aux.push([i, v]);
});
@ -979,6 +986,10 @@ function pandoraFlotArea(graph_id, values, labels, labels_long, legend,
// showed[i] = true;
}
if(min_check != 0){
min_check = min_check -5;
}
// If threshold and up are the same, that critical or warning is disabled
if (yellow_threshold == yellow_up) yellow_inverse = false;
if (red_threshold == red_up) red_inverse = false;
@ -1540,6 +1551,7 @@ function pandoraFlotArea(graph_id, values, labels, labels_long, legend,
position: 'left',
font: font,
reserveSpace: true,
min: min_check
}],
legend: {
position: 'se',
@ -2150,6 +2162,10 @@ function number_format(number, force_integer, unit) {
pos++;
number = number / 1000;
}
else if (number <= -1000) {
pos++;
number = number / 1000;
}
else {
break;
}

View File

@ -859,7 +859,7 @@ function pch_vertical_graph ($graph_type, $index, $data, $width, $height,
$MyData->addPoints($index,"Xaxis");
$MyData->setSerieDescription("Xaxis", $xaxisname);
$MyData->setAbscissa("Xaxis");
$MyData->setAxisDisplay(0, AXIS_FORMAT_METRIC);
$MyData->setAxisDisplay(0, AXIS_FORMAT_TWO_SIGNIFICANT, 0);
switch ($backgroundColor) {
case 'white':
@ -971,42 +971,17 @@ function pch_vertical_graph ($graph_type, $index, $data, $width, $height,
$max_data = max($v);
}
}
$default_chart_size = 40;
$rest_chars = strlen($max_data) - 6;
$default_chart_size += $rest_chars * 5;
$chart_margin = 36;
/* Area depends on yaxisname */
if ($yaxisname != '') {
$chart_size += $default_chart_size;
}
else {
$chart_size = $default_chart_size;
$chart_margin += $chart_size;
}
$myPicture->setGraphArea($chart_size, $top_margin,
$myPicture->setGraphArea($chart_margin, $top_margin,
$width,
($height - $margin_bottom));
/*Get minimun value to draw axis properly*/
$ManualScale = array();
$mode = SCALE_MODE_START0;
if ($min_data < 0) {
$mode = SCALE_MODE_FLOATING;
}
if ($max_data < 0) {
$ManualScale = array(0 => array("Min" => $min_data, "Max" => 0));
$mode = SCALE_MODE_MANUAL;
}
else if ($max_data >= 0 && $min_data <= 0){
$ManualScale = array(0 => array("Min" => $min_data, "Max" => $max_data));
$mode = SCALE_MODE_MANUAL;
}
if($graph_threshold){
$sql_treshold = 'select min_critical, max_critical, min_warning, max_warning, critical_inverse, warning_inverse from tagente_modulo where id_agente_modulo =' . $id_module;
$treshold_position = db_get_all_rows_sql($sql_treshold);
@ -1218,6 +1193,14 @@ function pch_vertical_graph ($graph_type, $index, $data, $width, $height,
}
else{
$ManualScale = array( 0 => array(
"Min" => $min_data,
"Max" => $max_data
));
//html_debug("MAX: $max_data, ROUND: $max_round", true);
$mode = SCALE_MODE_MANUAL;
/* Draw the scale */
$scaleSettings = array(
"GridR" => 200,

View File

@ -19,6 +19,7 @@
define("AXIS_FORMAT_DATE" , 680003);
define("AXIS_FORMAT_METRIC" , 680004);
define("AXIS_FORMAT_CURRENCY" , 680005);
define("AXIS_FORMAT_TWO_SIGNIFICANT" , 680006); // ARTICA-PANDORA HACK
/* Axis position */
define("AXIS_POSITION_LEFT" , 681001);

View File

@ -2801,6 +2801,22 @@
return(round($Value/1000,$Format)."K".$Unit);
}
// ARTICA-PANDORA HACK BEGIN
if ( $Mode == AXIS_FORMAT_TWO_SIGNIFICANT )
{
// Display only two significant numbers
if ($Value != 0) {
$multiplier = floor(log(abs($Value), 10)) - 1;
$Value = round($Value/pow(10, $multiplier), 0) * pow(10, $multiplier);
}
if (abs($Value) >= 1000000000)
return(round($Value/1000000000,$Format)."G".$Unit);
if (abs($Value) >= 1000000)
return(round($Value/1000000,$Format)."M".$Unit);
elseif (abs($Value) >= 1000)
return(round($Value/1000,$Format)."K".$Unit);
}
// ARTICA-PANDORA HACK END
return($Value.$Unit);
}

View File

@ -16,7 +16,7 @@
email アクションを設定するには、_field1_ (送信先アドレス)、_field2_ (件名)、および _filed3_ (本文) のみを設定します。<br><br>
これらのフィールド内では、以下のマクロを利用できます。
アクション作成時には 3つのフィールドのみ設定できます。これらのフィールド内では、以下のマクロを利用できます。
<br><br>
<?php html_print_image ("images/help/actions.png", false, array('width' => '550px')); ?>
<br><br>
@ -25,17 +25,21 @@ email アクションを設定するには、_field1_ (送信先アドレス)、
<p>
定義したモジュールマクロ以外に、次のマクロが利用できます:
<ul>
<li>_field1_ : ユーザ定義フィールド1</li>
<li>_field2_ : ユーザ定義フィールド2</li>
<li>_field3_ : ユーザ定義フィールド3</li>
<li>_agent_ : アラートが発生したエージェント</li>
<li>_agentdescription_ : 発生したアラートの説明</li>
<li>_agentgroup_ : エージェントグループ名</li>
<li>_agentstatus : エージェントの現在の状態</li>
<li>_agentstatus_ : エージェントの現在の状態</li>
<li>_agentos_: Agent's operative system</li>
<li>_address_ : アラートが発生したエージェントのアドレス</li>
<li>_all_address_ : アラートを発報した全エージェントのアドレス</li>
<li>_address_n_ : "n" で示される位置に対応するエージェントのアドレス。例: address_1_ , address_2_</li>
<li>_timestamp_ : アラートが発生した日時 (yy-mm-dd hh:mm:ss).</li>
<li>_timezone_: _timestamp_ で使用されるタイムゾーン名.</li>
<li>_data_ : アラート発生時のモジュールのデータ()</li>
<li>_prevdata_ : アラートを発報する前のモジュールデータ</li>
<li>_alert_description_ : アラートの説明</li>
<li>_alert_threshold_ : アラートのしきい値</li>
<li>_alert_times_fired_ : アラートが発生した回数</li>
@ -51,6 +55,7 @@ email アクションを設定するには、_field1_ (送信先アドレス)、
<li>_event_id_ : (イベントアラートのみ) アラート発生元のイベントID</li>
<li>_id_agent_ : エージェントのID / Webコンソールへのリンクを生成するのに便利です</li>
<li>_id_group_ : エージェントグループのID</li>
<li>_id_module_ : モジュールID</li>
<li>_id_alert_ : アラートの(ユニークな)ID / 他のソフトウエアパッケージとの連携に利用できます</li>
<li>_policy_ : モジュールが属するポリシー名 (存在する場合)</li>
<li>_interval_ : モジュールの実行間隔</li>
@ -60,7 +65,12 @@ email アクションを設定するには、_field1_ (送信先アドレス)、
<li>_groupcontact_ : グループコンタクト情報。グループの作成時に設定されます。</li>
<li>_groupother_ : グループに関するその他情報。グループの作成時に設定されます。</li>
<li>_email_tag_ : モジュールタグに関連付けられた Email。</li>
<li>_alert_critical_instructions_: モジュールが障害状態の場合の手順</li>
<li>_alert_warning_instructions_: モジュールが警告状態の場合の手順</li>
<li>_alert_unknown_instructions_: モジュールが不明状態の場合の手順</li>
<li>_modulegraph_nh_: (eMail コマンドを用いるアラートの場合のみ) n時間の期間のモジュールグラフのイメージを返します(: _modulegraph_24h_) サーバとコンソールの API の接続を正しく設定する必要があります。これはサーバの設定で行います。</li>
<li>_modulegraphth_<i>n</i>h_:上記のマクロと同じですが、モジュールに設定された障害および警告閾値を含みます。</li>
<li>_homeurl_ : 公開 URL へのリンク。URLは、基本設定メニューで設定されている必要があります。</li>
</ul>
<p>
</p>

View File

@ -30,6 +30,7 @@
<li>_timestamp_ : アラートが発生した日時 (yy-mm-dd hh:mm:ss).</li>
<li>_timezone_: _timestamp_ で使用されるタイムゾーン名.</li>
<li>_data_ : アラート発生時のモジュールのデータ()</li>
<li>_prevdata_ : アラート発生前のモジュールデータ</li>
<li>_alert_description_ : アラートの説明</li>
<li>_alert_threshold_ : アラートのしきい値</li>
<li>_alert_times_fired_ : アラートが発生した回数</li>
@ -38,6 +39,7 @@
<li>_modulegroup_ : モジュールグループ名</li>
<li>_moduledescription_ : アラートが発生したモジュールの説明</li>
<li>_modulestatus_ : モジュールの状態</li>
<li>_moduledata_X_: モジュール X の最新データ (モジュール名にスペースを含めることはできません)</li>
<li>_alert_name_ : アラート名</li>
<li>_alert_priority_ : アラート優先順位(数値)</li>
<li>_alert_text_severity_ : テキストでのアラートの重要度 (Maintenance, Informational, Normal Minor, Warning, Major, Critical)</li>
@ -45,6 +47,7 @@
<li>_event_id_ : (イベントアラートのみ) アラート発生元のイベントID</li>
<li>_id_agent_ : エージェントのID / Webコンソールへのリンクを生成するのに便利です</li>
<li>_id_group_ : エージェントグループのID</li>
<li>_id_module_ : モジュール ID</li>
<li>_id_alert_ : アラートの(ユニークな)ID / 他のソフトウエアパッケージとの連携に利用できます</li>
<li>_policy_ : モジュールが属するポリシー名 (存在する場合)</li>
<li>_interval_ : モジュールの実行間隔</li>
@ -63,6 +66,7 @@
<li>_alert_unknown_instructions_: モジュールの不明状態時手順。</li>
<li>_modulegraph_<i>n</i>h_: (>=6.0) (<i>eMail</i>コマンドを使うアラートのみ)
n で示す期間の base64 でエンコードされたモジュールグラフを返します。(: _modulegraph_24h_) サーバとコンソールの API の設定が正しくできている必要があります。この設定は、サーバの設定ファイルで行います。 </li>
<li>_modulegraphth_<i>n</i>h_: 上記のマクロと同じですが、モジュールに定義さっれた障害および警告閾値を含みます。</li>
</ul>
<p>

View File

@ -8,6 +8,7 @@
次のマクロも使えます: <br />
<ul>
エージェントごとに一つのグラフを選択した場合のみ<br />
<li><b>_agent_ </b>: レポートアイテムで選択したエージェント名。<li />
<li><b>_agentdescription_ </b>: レポートアイテムで選択したエージェントの説明。<li />
<li><b>_agentgroup_ </b>: エージェントグループ名。<li />

View File

@ -607,6 +607,51 @@ function post_process_select_init(name) {
$('#' + name + '_default').show();
}
function post_process_select_init_unit(name,selected) {
// Manual mode is hidden by default
$('#' + name + '_manual').hide();
$('#' + name + '_default').show();
if(selected != "") {
var select_or_text = false;
$('#' + name + '_select option').each(function(i,item) {
if ($(item).val() == selected) {
select_or_text = true;
return false;
}
});
console.log(select_or_text);
if(select_or_text) {
$('#' + name + '_select option[value='+ selected +']').attr("selected",true);
$('#text-' + name + '_text').val("");
} else {
$('#' + name + '_select option[value=none]').attr("selected",true);
$('#' + name + '_default').hide();
$('#' + name + '_manual').show();
}
} else {
$('#' + name + '_select option[value=none]').attr("selected",true);
}
$('#' + name + '_select').change(function() {
var value = $('#' + name + '_select').val();
$('#' + name + '_select option[value='+ value +']').attr("selected",true);
console.log(value);
});
}
function post_process_select_events_unit(name,selected) {
$('.' + name + '_toggler').click(function() {
$('#' + name + '_select option[value=none]').attr("selected",true);
$('#text-' + name + '_text').val("");
toggleBoth(name);
});
}
function post_process_select_events(name) {
$('.' + name + '_toggler').click(function() {
var value = $('#text-' + name + '_text').val();

View File

@ -156,12 +156,51 @@ div.installation_step {
}
.btn_install_next {
transition-property: background-color, color;
transition-duration: 1s;
transition-timing-function: ease-out;
-webkit-transition-property: background-color, color;
-webkit-transition-duration: 1s;
-o-transition-property: background-color, color;
-o-transition-duration: 1s;
margin: 10px;
padding: 8px 20px 8px 20px;
background-color: transparent;
border: 1px solid #82B92E;
font: bold 1em Verdana;
font-size: 14pt;
font: 1em Verdana;
font-size: 11pt;
color: #82B92E;
border-radius: 0%;
}
.btn_install_next:hover {
cursor: pointer;
transition-property: background-color, color;
transition-duration: 1s;
transition-timing-function: ease-out;
-webkit-transition-property: background-color, color;
-webkit-transition-duration: 1s;
-o-transition-property: background-color, color;
-o-transition-duration: 1s;
background-color:#82b92e;
}
.btn_install_next_text {
transition-property: background-color, color;
transition-duration: 1s;
transition-timing-function: ease-out;
-webkit-transition-property: background-color, color;
-webkit-transition-duration: 1s;
-o-transition-property: background-color, color;
-o-transition-duration: 1s;
color:#82b92e;
}
.btn_install_next:hover .btn_install_next_text {
transition-property: background-color, color;
transition-duration: 1s;
transition-timing-function: ease-out;
-webkit-transition-property: background-color, color;
-webkit-transition-duration: 1s;
-o-transition-property: background-color, color;
-o-transition-duration: 1s;
color:white;
}

View File

@ -4299,4 +4299,28 @@ div#footer_help{
.pagination_show_more{
text-align: center;
margin-top: 10px;
}
}
.dashed{
stroke-dasharray: 10;
}
.path {
stroke-dasharray: 500;
stroke-dashoffset: 500;
animation: dash 15s linear;
}
@keyframes dash {
from {
stroke-dashoffset: 500;
}
to {
stroke-dashoffset: 0;
}
}
.route {
fill: none;
transition: all 2s ease-in-out;
}

20
pandora_console/install.php Normal file → Executable file
View File

@ -70,8 +70,8 @@
<body>
<div style='height: 10px'>
<?php
$version = '7.0NG.712';
$build = '170926';
$version = '7.0NG.713';
$build = '171006';
$banner = "v$version Build $build";
error_reporting(0);
@ -379,7 +379,7 @@ function install_step1() {
if ($writable == 0) {
echo "<div style='text-align:right; width:100%;'>";
echo "<a id='step11' href='install.php?step=11'><button type='submit' class='btn_install_next'>Next</button></a>";
echo "<a id='step11' href='install.php?step=11'><button type='submit' class='btn_install_next'><span class='btn_install_next_text'>Next</span></button></a>";
echo "</div>";
}
else {
@ -419,7 +419,7 @@ function install_step1_licence() {
echo file_get_contents ("COPYING");
echo "</textarea>";
echo "<p>";
echo "<div style='text-align: right;'><button id='btn_accept' class='btn_install_next' type='submit'>Yes, I accept licence terms</button></div>";
echo "<div style='text-align: right;'><button id='btn_accept' class='btn_install_next' type='submit'><span class='btn_install_next_text'>Yes, I accept licence terms</span></button></div>";
}
echo "</div>";
@ -490,13 +490,13 @@ function install_step2() {
modules.
</div>
<div style='text-align:right; width:100%;'>
Ignore it. <a id='step3' href='install.php?step=3' style='font-weight: bolder;'><button class='btn_install_next' type='submit'>Force install Step #3</button></a>
Ignore it. <a id='step3' href='install.php?step=3' style='font-weight: bolder;'><button class='btn_install_next' type='submit'><span class='btn_install_next_text'>Force install Step #3</span></button></a>
</div>";
}
else {
echo "<div style='text-align:right; width:100%;'>";
echo "<a id='step3' href='install.php?step=3'>
<button class='btn_install_next' type='submit'>Next</button></a>";
<button class='btn_install_next' type='submit'><span class='btn_install_next_text'>Next</span></button></a>";
echo "</div>";
}
echo "</div>";
@ -637,7 +637,7 @@ function install_step3() {
if (!$error) {
echo "<div style='text-align:right; width:100%;'>";
echo "<a id='step4' href='install.php?step=4'>
<button class='btn_install_next' type='submit'>Next</button></a>";
<button class='btn_install_next' type='submit'><span class='btn_install_next_text'>Next</span></button></a>";
echo "</div>";
}
@ -898,7 +898,7 @@ function install_step4() {
if ($everything_ok == 1) {
echo "<div style='text-align:right; width:100%;'>";
echo "<a id='step5' href='install.php?step=5'>
<button class='btn_install_next' type='submit'>Next</button></a>";
<button class='btn_install_next' type='submit'><span class='btn_install_next_text'>Next</span></button></a>";
echo "</div>";
}
else {
@ -966,10 +966,10 @@ function install_step5() {
for updates.
<p>Select if you want to rename '<i>install.php</i>'.</p>
<form method='post' action='index.php'>
<button class='btn_install_next' type='submit' name='rn_file'>Yes, rename the file</button>
<button class='btn_install_next' type='submit' name='rn_file'><span class='btn_install_next_text'>Yes, rename the file</span></button>
<input type='hidden' name='rename_file' value='1'>
</form>
<p><br><b><a id='access_pandora' href='index.php'><button class='btn_install_next' type='submit'>Click here to access to your Pandora FMS console</button></a>.</b>
<p><br><b><a id='access_pandora' href='index.php'><button class='btn_install_next' type='submit'><span class='btn_install_next_text'>Click here to access to your Pandora FMS console</span></button></a>.</b>
</p>
</div>";

View File

@ -274,7 +274,7 @@ $interface_traffic_modules = array(
$table->rowclass[] ='';
$data = array();
$data[0] = __('Show full scale graph (TIP)');
$data[0] = __('Show full scale graph (TIP)') . ui_print_help_tip(__('This option may cause performance issues'), true);
$data[1] = html_print_checkbox ("fullscale", 1, (bool) $fullscale, true);
$table->data[] = $data;
$table->rowclass[] ='';

View File

@ -495,7 +495,12 @@ switch ($tab) {
$count = 0;
if (($count == 0) && ($network_map['source'] != 'empty')) {
$data['nodes'] = __('Pending to generate');
if (enterprise_installed() && ($network_map['generated'])) {
$data['nodes'] = __('Empty map');
}
else {
$data['nodes'] = __('Pending to generate');
}
}
else {
$data['nodes'] = $count - 1; //PandoraFMS node is not an agent

View File

@ -93,15 +93,6 @@ $alias = db_get_value ("alias","tagente","id_agente",$id_agent);
period_select_init(periodSelectId);
};
function fullscal_other() {
if ($('#checkbox-fullscale').is(":checked") == true) {
$("#hidden-fullscale_other").val(1);
}
else {
$("#hidden-fullscale_other").val(0);
}
}
function show_others() {
if ($('#checkbox-avg_only').is(":checked") == true) {
$("#hidden-show_other").val(1);
@ -110,8 +101,6 @@ $alias = db_get_value ("alias","tagente","id_agente",$id_agent);
$("#hidden-show_other").val(0);
}
}
//-->
</script>
</head>
@ -165,7 +154,6 @@ $alias = db_get_value ("alias","tagente","id_agente",$id_agent);
if ($period == "") {
$period = get_parameter ("period_select", SECONDS_1DAY);
}
$id = get_parameter ("id", 0);
$width = get_parameter ("width", STATWIN_DEFAULT_CHART_WIDTH);
$height = get_parameter ("height", STATWIN_DEFAULT_CHART_HEIGHT);

View File

@ -1320,8 +1320,13 @@ if (!empty($result)) {
// Show units ONLY in numeric data types
if (isset($row['unit'])) {
$salida .= '&nbsp;' . '<i>' . io_safe_output($row['unit']) . '</i>';
$salida = ui_print_truncate_text($salida, 'agent_small', true, true, false, '[&hellip;]', 'font-size:7.5pt;');
$data_macro = modules_get_unit_macro($row['datos'],$row['unit']);
if($data_macro) {
$salida = $data_macro;
} else {
$salida .= '&nbsp;' . '<i>' . io_safe_output($row['unit']) . '</i>';
$salida = ui_print_truncate_text($salida, 'agent_small', true, true, false, '[&hellip;]', 'font-size:7.5pt;');
}
}
}
else {
@ -1374,7 +1379,12 @@ if (!empty($result)) {
$salida = 0;
}
else {
$salida = $row['datos'];
$data_macro = modules_get_unit_macro($row['datos'],$row['unit']);
if($data_macro) {
$salida = $data_macro;
} else {
$salida = $row['datos'];
}
}
}
else {

View File

@ -1043,9 +1043,13 @@ if ($policyTab == -1)
$policyTab = "";
/* UX Console */
$ux_console_tab = enterprise_hook('ux_console_tab');
if ($ux_console_tab == -1)
$ux_console_tab = "";
enterprise_include_once('/include/functions_ux_console.php');
$active_ux = get_ux_transactions($id_agente);
if(!empty($active_ux)){
$ux_console_tab = enterprise_hook('ux_console_tab');
if ($ux_console_tab == -1)
$ux_console_tab = "";
}
/* WUX Console */
$modules_wux = enterprise_hook('get_wux_modules' , array($id_agente));
@ -1055,6 +1059,14 @@ if($modules_wux){
$wux_console_tab = "";
}
$url_route_analyzer = enterprise_hook('get_url_route_analyzer_modules', array($id_agente));
if ($url_route_analyzer) {
$url_route_analyzer_tab = enterprise_hook('url_route_analyzer_tab');
if ($url_route_analyzer_tab == -1) {
$url_route_analyzer_tab = "";
}
}
/* GIS tab */
$gistab="";
if ($config['activate_gis']) {
@ -1186,7 +1198,8 @@ $onheader = array('manage' => $managetab,
'graphs' => $graphs,
'policy' => $policyTab,
'ux_console' => $ux_console_tab,
'wux_console' => $wux_console_tab);
'wux_console' => $wux_console_tab,
'url_route_analyzer' => $url_route_analyzer_tab);
//Added after it exists
// If the agent has incidents associated
@ -1307,7 +1320,10 @@ switch ($tab) {
enterprise_include ("operation/agentes/ux_console_view.php");
break;
case "wux_console_tab":
enterprise_include ("operation/agentes/wux_console_view.php");
enterprise_include ("operation/agentes/wux_console_vpiew.php");
break;
case "url_route_analyzer_tab":
enterprise_include ("operation/agentes/url_route_analyzer.php");
break;
case "graphs";
require("operation/agentes/graphs.php");

View File

@ -240,9 +240,9 @@ if (!empty($tag_with)) {
$sql_post .= " OR ";
$sql_post .= "tags LIKE '" . tags_get_name($id_tag) . ",%'";
$sql_post .= " OR ";
$sql_post .= "tags LIKE '%, " . tags_get_name($id_tag) . "'";
$sql_post .= "tags LIKE '%," . tags_get_name($id_tag) . "'";
$sql_post .= " OR ";
$sql_post .= "tags LIKE '%, " . tags_get_name($id_tag) . ",%'";
$sql_post .= "tags LIKE '%," . tags_get_name($id_tag) . ",%'";
}
$sql_post .= ' ) ';
}

View File

@ -2,8 +2,8 @@
# Pandora FMS Console
#
%define name pandorafms_console
%define version 7.0NG.712
%define release 170926
%define version 7.0NG.713
%define release 171006
# User and Group under which Apache is running
%define httpd_name httpd

View File

@ -2,8 +2,8 @@
# Pandora FMS Console
#
%define name pandorafms_console
%define version 7.0NG.712
%define release 170926
%define version 7.0NG.713
%define release 171006
%define httpd_name httpd
# User and Group under which Apache is running
%define httpd_name apache2

View File

@ -9,7 +9,7 @@
# This code is licensed under GPL 2.0 license.
# **********************************************************************
PI_VERSION="7.0NG.712"
PI_VERSION="7.0NG.713"
FORCE=0
DESTDIR=""
LOG_TIMESTAMP=`date +"%Y/%m/%d %H:%M:%S"`

View File

@ -109,10 +109,10 @@ INSERT INTO `tconfig` (`token`, `value`) VALUES
('custom_report_front_logo', 'images/pandora_logo_white.jpg'),
('custom_report_front_header', ''),
('custom_report_front_footer', ''),
('MR', 4),
('MR', 7),
('identification_reminder', 1),
('identification_reminder_timestamp', 0),
('current_package_enterprise', '712'),
('current_package_enterprise', '713'),
('post_process_custom_values', '{"0.00000038580247":"Seconds&#x20;to&#x20;months","0.00000165343915":"Seconds&#x20;to&#x20;weeks","0.00001157407407":"Seconds&#x20;to&#x20;days","0.01666666666667":"Seconds&#x20;to&#x20;minutes","0.00000000093132":"Bytes&#x20;to&#x20;Gigabytes","0.00000095367432":"Bytes&#x20;to&#x20;Megabytes","0.0009765625":"Bytes&#x20;to&#x20;Kilobytes","0.00000001653439":"Timeticks&#x20;to&#x20;weeks","0.00000011574074":"Timeticks&#x20;to&#x20;days"}');
UNLOCK TABLES;

View File

@ -1,5 +1,5 @@
package: pandorafms-server
Version: 7.0NG.712-170926
Version: 7.0NG.713-171006
Architecture: all
Priority: optional
Section: admin

View File

@ -14,7 +14,7 @@
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
pandora_version="7.0NG.712-170926"
pandora_version="7.0NG.713-171006"
package_cpan=0
package_pandora=1

View File

@ -1,7 +1,7 @@
#############################################################################
# Pandora FMS Server Parameters
# Pandora FMS, the Flexible Monitoring System.
# Version 7.0NG.712
# Version 7.0NG.713
# Licensed under GPL license v2,
# (c) 2003-2016 Artica Soluciones Tecnologicas
# http://www.pandorafms.com

View File

@ -42,8 +42,8 @@ our @EXPORT = qw(
);
# version: Defines actual version of Pandora Server for this module only
my $pandora_version = "7.0NG.712";
my $pandora_build = "170926";
my $pandora_version = "7.0NG.713";
my $pandora_build = "171006";
our $VERSION = $pandora_version." ".$pandora_build;
# Setup hash

View File

@ -73,26 +73,8 @@ sub new ($$;$) {
my $self = $class->SUPER::new($config, DATASERVER, \&PandoraFMS::DataServer::data_producer, \&PandoraFMS::DataServer::data_consumer, $dbh);
# Load external .enc files for XML::Parser.
if ($config->{'enc_dir'} ne '') {
if (opendir(my $dh, $config->{'enc_dir'})) {
while (my $enc_file = readdir($dh)) {
# Ignore unknown files.
next unless ($enc_file =~ m/.enc$/);
# Load the .enc file.
eval {
local $SIG{__DIE__} = {};
XML::Parser::Expat::load_encoding($config->{'enc_dir'} . '/' . $enc_file);
};
if ($@) {
print_message ($config, " [WARNING] Error loading encoding file: $enc_file", 1);
}
}
closedir($dh);
} else {
print_message($config, " [WARNING] Error opening directory " . $config->{'enc_dir'} . ": $!", 1);
}
if ($config->{'enc_dir'} ne '' && !grep {$_ eq $config->{'enc_dir'}} @XML::Parser::Expat::Encoding_Path) {
push(@XML::Parser::Expat::Encoding_Path, $config->{'enc_dir'});
}
bless $self, $class;

View File

@ -2,8 +2,8 @@
# Pandora FMS Server
#
%define name pandorafms_server
%define version 7.0NG.712
%define release 170926
%define version 7.0NG.713
%define release 171006
Summary: Pandora FMS Server
Name: %{name}

View File

@ -2,8 +2,8 @@
# Pandora FMS Server
#
%define name pandorafms_server
%define version 7.0NG.712
%define release 170926
%define version 7.0NG.713
%define release 171006
Summary: Pandora FMS Server
Name: %{name}

View File

@ -8,8 +8,8 @@
# This code is licensed under GPL 2.0 license.
# **********************************************************************
PI_VERSION="7.0NG.712"
PI_BUILD="170926"
PI_VERSION="7.0NG.713"
PI_BUILD="171006"
MODE=$1
if [ $# -gt 1 ]; then

View File

@ -33,7 +33,7 @@ use PandoraFMS::Tools;
use PandoraFMS::DB;
# version: define current version
my $version = "7.0NG.712 PS170926";
my $version = "7.0NG.713 PS171006";
# Pandora server configuration
my %conf;

View File

@ -36,7 +36,7 @@ use Encode::Locale;
Encode::Locale::decode_argv;
# version: define current version
my $version = "7.0NG.712 PS170926";
my $version = "7.0NG.713 PS171006";
# save program name for logging
my $progname = basename($0);
@ -221,7 +221,7 @@ sub help_screen{
help_screen_line('--delete_visual_console', '<id>', 'Delete a visual console');
help_screen_line('--delete_visual_console_objects', '<id> <mode> <id_mode>', 'Delete a visual console elements');
help_screen_line('--duplicate_visual_console', '<id> <times> [<prefix>]', 'Duplicate a visual console');
help_screen_line('--export_json_visual_console', '<id> [<path>]', 'Creates a json with the visual console elements information');
help_screen_line('--export_json_visual_console', '<id> [<path>] [<with_element_id>]', 'Creates a json with the visual console elements information');
print "\n";
@ -4821,7 +4821,7 @@ sub cli_create_visual_console() {
my $id_agente_modulo = $elem->{'id_agente_modulo'};
my $id_agent = $elem->{'id_agent'};
my $id_layout_linked = $elem->{'id_layout_linked'};
my $parent_item = $elem->{'parent_item'};
my $parent_item = 0;
my $enable_link = $elem->{'enable_link'};
my $id_metaconsole = $elem->{'id_metaconsole'};
my $id_group = $elem->{'id_group'};
@ -4855,11 +4855,11 @@ sub cli_create_visual_console() {
my $number_of_elements = scalar(@$elements_in_array);
my $x_divider = 4;
my $x_divider = 8;
my $y_divider = 1;
for (my $i = 1; $i <= 1000; $i++) {
if (($i * 4) < $number_of_elements) {
if (($i * 8) < $number_of_elements) {
$y_divider++;
}
else {
@ -4870,16 +4870,17 @@ sub cli_create_visual_console() {
my $elem_width = ($pos2X - $pos1X) / $x_divider;
my $elem_height = ($pos2Y - $pos1Y) / $y_divider;
if ($number_of_elements < 4) {
$elem_height = ($pos2Y - $pos1Y) / 3;
if ($number_of_elements <= 8) {
$elem_height = ($pos2Y - $pos1Y) / 4;
}
my $elem_count = 1;
my $pos_helper_x = 0;
my $pos_helper_y = 0;
my $pos_aux_count = 0;
my $pos_helper_x = $pos1X;
my $pos_helper_y = $pos1Y;
foreach my $elem (@$elements_in_array) {
my $pos_x = $pos_helper_x * $elem_width;
my $pos_y = $pos_helper_y * $elem_height;
my $pos_x = $pos_helper_x;
my $pos_y = $pos_helper_y;
my $width = $elem_width;
my $height = $elem_height;
my $label = $elem->{'label'};
@ -4907,12 +4908,14 @@ sub cli_create_visual_console() {
$elem_count++;
if ($pos_helper_x == 3) {
$pos_helper_x = 0;
$pos_helper_y++;
if ($pos_aux_count == 7) {
$pos_helper_x = $pos1X;
$pos_helper_y += $elem_height;
$pos_aux_count = 0;
}
else {
$pos_helper_x++;
$pos_aux_count++;
$pos_helper_x += $elem_width;
}
}
}
@ -5460,7 +5463,7 @@ sub cli_duplicate_visual_console () {
##############################################################################
sub cli_export_visual_console() {
my ($id,$path) = @ARGV[2..3];
my ($id,$path,$with_id) = @ARGV[2..4];
if($id eq '') {
print_log "[ERROR] ID field cannot be empty.\n\n";
@ -5489,8 +5492,9 @@ sub cli_export_visual_console() {
FROM tlayout_data
WHERE id_layout = $id");
$data_to_json .= '[';
$data_to_json .= "'[";
foreach my $element (@console_elements) {
my $id_layout_data = $element->{'id'};
my $pos_x = $element->{'pos_x'};
my $pos_y = $element->{'pos_y'};
my $width = $element->{'width'};
@ -5522,7 +5526,13 @@ sub cli_export_visual_console() {
$label =~ s/"/\\"/g;
$data_to_json .= '{"image":"' . $image . '"';
if ($with_id == 1) {
$data_to_json .= '{"id":' . $id_layout_data;
$data_to_json .= ',"image":"' . $image . '"';
}
else {
$data_to_json .= '{"image":"' . $image . '"';
}
$data_to_json .= ',"pos_y":' . $pos_y;
$data_to_json .= ',"pos_x":' . $pos_x;
$data_to_json .= ',"width":' . $width;
@ -5546,7 +5556,7 @@ sub cli_export_visual_console() {
$data_to_json .= '}';
}
$data_to_json .= ']';
$data_to_json .= "]'";
if ($path eq '') {
open(FicheroJSON, ">console_" . $id . "_elements");
@ -6011,7 +6021,7 @@ sub pandora_manage_main ($$$) {
cli_duplicate_visual_console();
}
elsif ($param eq '--export_json_visual_console') {
param_check($ltotal, 2, 1);
param_check($ltotal, 3, 2);
cli_export_visual_console();
}
else {

View File

@ -50,7 +50,7 @@ if ($#ARGV == -1 ) {
print "-p, --process=STRING\n";
print "\tProcess or service name (only in process module)\n";
print "-v, --version=NUMBER\n";
print "-v, --version=STRING\n";
print "\tVersion of protocol\n";
print "-u, --user=STRING\n";
@ -122,7 +122,7 @@ sub options {
# process
$opts{"p"} = 0 unless ( exists( $opts{"p"} ) );
# version
$opts{"v"} = 2 unless ( exists( $opts{"v"} ) );
$opts{"v"} = "2c" unless ( exists( $opts{"v"} ) );
# user
$opts{"u"} = "" unless ( exists( $opts{"u"} ) );
# auth_pass
@ -158,19 +158,19 @@ if ($module eq "memuse") {
my $memuse = 0;
my $command_line_parammeters;
if ($version == 3) {
if ($version == "3") {
if ($auth_method eq 'authNoPriv') {
$command_line_parammeters = "-v 3 -u $user -a $auth_method -A $pass -l $security_level $host";
$command_line_parammeters = "-v $version -u $user -a $auth_method -A $pass -l $security_level $host";
}
elsif ($auth_method eq "noAuthNoPriv") {
$command_line_parammeters = "-v 3 -u $user -l $security_level $host";
$command_line_parammeters = "-v $version -u $user -l $security_level $host";
}
else {
$command_line_parammeters = "-v 3 -u $user -a $auth_method -A $pass -l $security_level -x $privacy_method -X $privacy_pass $host";
$command_line_parammeters = "-v $version -u $user -a $auth_method -A $pass -l $security_level -x $privacy_method -X $privacy_pass $host";
}
}
else {
$command_line_parammeters = "-v 1 -c $community $host";
$command_line_parammeters = "-v $version -c $community $host";
}
my $memid = `snmpwalk -On $command_line_parammeters .1.3.6.1.2.1.25.2.3.1.3 | grep Physical | head -1 | gawk '{print \$1}' | gawk -F "." '{print \$13}' | tr -d "\r"`;
@ -191,30 +191,33 @@ if ($module eq "diskuse") {
my $diskuse = 0;
my $command_line_parammeters;
if ($version == 3) {
if ($version == "3") {
if ($auth_method eq 'authNoPriv') {
$command_line_parammeters = "-v 3 -u $user -a $auth_method -A $pass -l $security_level $host";
$command_line_parammeters = "-v $version -u $user -a $auth_method -A $pass -l $security_level $host";
}
elsif ($auth_method eq "noAuthNoPriv") {
$command_line_parammeters = "-v 3 -u $user -l $security_level $host";
$command_line_parammeters = "-v $version -u $user -l $security_level $host";
}
else {
$command_line_parammeters = "-v 3 -u $user -a $auth_method -A $pass -l $security_level -x $privacy_method -X $privacy_pass $host";
$command_line_parammeters = "-v $version -u $user -a $auth_method -A $pass -l $security_level -x $privacy_method -X $privacy_pass $host";
}
}
else {
$command_line_parammeters = "-v 1 -c $community $host";
$command_line_parammeters = "-v $version -c $community $host";
}
my $diskid = `snmpwalk -On $command_line_parammeters .1.3.6.1.2.1.25.2.3.1.3 | grep "$disk" | head -1 | gawk '{print \$1}' | gawk -F "." '{print \$13}' | tr -d "\r"`;
my $disktot = `snmpget $command_line_parammeters .1.3.6.1.2.1.25.2.3.1.5.$diskid ` ;
if ($disk =~ /\\/) {
$disk =~ s/\\/\\\\/g;
}
my $diskid = `snmpwalk -r 2 -On $command_line_parammeters .1.3.6.1.2.1.25.2.3.1.3 | grep -F '$disk' | head -1 | gawk '{print \$1}' | gawk -F "." '{print \$13}' | tr -d "\r"`;
my $disktot = `snmpget -r 2 $command_line_parammeters .1.3.6.1.2.1.25.2.3.1.5.$diskid ` ;
my $disktot2 = `echo "$disktot" | gawk '{print \$4}'`;
if ($disktot2 == 0) {
$diskuse = 0;
}
else {
my $diskfree = `snmpget $command_line_parammeters .1.3.6.1.2.1.25.2.3.1.6.$diskid` ;
my $diskfree = `snmpget -r 2 $command_line_parammeters .1.3.6.1.2.1.25.2.3.1.6.$diskid` ;
my $diskfree2 = `echo "$diskfree" | gawk '{print \$4}'`;
$diskuse = ($disktot2 - $diskfree2) * 100 / $disktot2;
@ -230,19 +233,19 @@ if ($module eq "process") {
my $status = 0;
my $command_line_parammeters;
if ($version == 3) {
if ($version == "3") {
if ($auth_method eq 'authNoPriv') {
$command_line_parammeters = "-v 3 -u $user -a $auth_method -A $pass -l $security_level $host";
$command_line_parammeters = "-v $version -u $user -a $auth_method -A $pass -l $security_level $host";
}
elsif ($auth_method eq "noAuthNoPriv") {
$command_line_parammeters = "-v 3 -u $user -l $security_level $host";
$command_line_parammeters = "-v $version -u $user -l $security_level $host";
}
else {
$command_line_parammeters = "-v 3 -u $user -a $auth_method -A $pass -l $security_level -x $privacy_method -X $privacy_pass $host";
$command_line_parammeters = "-v $version -u $user -a $auth_method -A $pass -l $security_level -x $privacy_method -X $privacy_pass $host";
}
}
else {
$command_line_parammeters = "-v 2c -c $community $host";
$command_line_parammeters = "-v $version -c $community $host";
}
$status = `snmpwalk $command_line_parammeters 1.3.6.1.2.1.25.4.2.1.2 | grep "$process" | head -1 | wc -l`;
@ -257,19 +260,19 @@ if ($module eq "cpuload") {
my $cputotal = 0;
my $command_line_parammeters;
if ($version == 3) {
if ($version == "3") {
if ($auth_method eq 'authNoPriv') {
$command_line_parammeters = "-v 3 -u $user -a $auth_method -A $pass -l $security_level $host";
$command_line_parammeters = "-v $version -u $user -a $auth_method -A $pass -l $security_level $host";
}
elsif ($auth_method eq "noAuthNoPriv") {
$command_line_parammeters = "-v 3 -u $user -l $security_level $host";
$command_line_parammeters = "-v $version -u $user -l $security_level $host";
}
else {
$command_line_parammeters = "-v 3 -u $user -a $auth_method -A $pass -l $security_level -x $privacy_method -X $privacy_pass $host";
$command_line_parammeters = "-v $version -u $user -a $auth_method -A $pass -l $security_level -x $privacy_method -X $privacy_pass $host";
}
}
else {
$command_line_parammeters = "-v 1 -c $community $host";
$command_line_parammeters = "-v $version -c $community $host";
}
my $cpuload = `snmpwalk $command_line_parammeters .1.3.6.1.2.1.25.3.3.1.2 | gawk '{print \$4}' `;