diff --git a/pandora_agents/unix/DEBIAN/control b/pandora_agents/unix/DEBIAN/control index 41321b7837..3c0d3b213b 100644 --- a/pandora_agents/unix/DEBIAN/control +++ b/pandora_agents/unix/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-agent-unix -Version: 7.0NG.735-190604 +Version: 7.0NG.735-190606 Architecture: all Priority: optional Section: admin diff --git a/pandora_agents/unix/DEBIAN/make_deb_package.sh b/pandora_agents/unix/DEBIAN/make_deb_package.sh index dcd6e1773d..5c5dc360d7 100644 --- a/pandora_agents/unix/DEBIAN/make_deb_package.sh +++ b/pandora_agents/unix/DEBIAN/make_deb_package.sh @@ -14,7 +14,7 @@ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -pandora_version="7.0NG.735-190604" +pandora_version="7.0NG.735-190606" echo "Test if you has the tools for to make the packages." whereis dpkg-deb | cut -d":" -f2 | grep dpkg-deb > /dev/null diff --git a/pandora_agents/unix/pandora_agent b/pandora_agents/unix/pandora_agent index 54f76969c7..715f9b732c 100755 --- a/pandora_agents/unix/pandora_agent +++ b/pandora_agents/unix/pandora_agent @@ -42,7 +42,7 @@ my $Sem = undef; my $ThreadSem = undef; use constant AGENT_VERSION => '7.0NG.735'; -use constant AGENT_BUILD => '190604'; +use constant AGENT_BUILD => '190606'; # Agent log default file size maximum and instances use constant DEFAULT_MAX_LOG_SIZE => 600000; @@ -3038,10 +3038,10 @@ while (1) { my @address_list; if( -x "/bin/ip" || -x "/sbin/ip" || -x "/usr/sbin/ip" ) { - @address_list = `ip addr show 2>$DevNull | sed -e '/127.0.0/d' -e '/[0-9]*\\.[0-9]*\\.[0-9]*/!d' -e 's/^[ \\t]*\\([^ \\t]*\\)[ \\t]*\\([^ \\t]*\\)[ \\t].*/\\2/' -e 's/\\/.*//'`; + @address_list = `ip addr show 2>$DevNull | sed -e '/127.0.0/d' -e '/\\([0-9][0-9]*\\.\\)\\{3\\}[0-9][0-9]*/!d' -e 's/^[ \\t]*\\([^ \\t]*\\)[ \\t]*\\([^ \\t]*\\)[ \\t].*/\\2/' -e 's/\\/.*//'`; } else { - @address_list = `ifconfig -a 2>$DevNull | sed -e '/127.0.0/d' -e '/[0-9]*\\.[0-9]*\\.[0-9]*/!d' -e 's/^[ \\t]*\\([^ \\t]*\\)[ \\t]*\\([^ \\t]*\\)[ \\t].*/\\2/' -e 's/.*://'`; + @address_list = `ifconfig -a 2>$DevNull | sed -e '/127.0.0/d' -e '/\\([0-9][0-9]*\\.\\)\\{3\\}[0-9][0-9]*/!d' -e 's/^[ \\t]*\\([^ \\t]*\\)[ \\t]*\\([^ \\t]*\\)[ \\t].*/\\2/' -e 's/.*://'`; } for (my $i = 0; $i <= $#address_list; $i++) { diff --git a/pandora_agents/unix/pandora_agent.redhat.spec b/pandora_agents/unix/pandora_agent.redhat.spec index 432fb23bcc..ccc4adaa93 100644 --- a/pandora_agents/unix/pandora_agent.redhat.spec +++ b/pandora_agents/unix/pandora_agent.redhat.spec @@ -3,7 +3,7 @@ # %define name pandorafms_agent_unix %define version 7.0NG.735 -%define release 190604 +%define release 190606 Summary: Pandora FMS Linux agent, PERL version Name: %{name} diff --git a/pandora_agents/unix/pandora_agent.spec b/pandora_agents/unix/pandora_agent.spec index b60141796d..250b1680e8 100644 --- a/pandora_agents/unix/pandora_agent.spec +++ b/pandora_agents/unix/pandora_agent.spec @@ -3,7 +3,7 @@ # %define name pandorafms_agent_unix %define version 7.0NG.735 -%define release 190604 +%define release 190606 Summary: Pandora FMS Linux agent, PERL version Name: %{name} diff --git a/pandora_agents/unix/pandora_agent_installer b/pandora_agents/unix/pandora_agent_installer index b8bae000eb..e3ded295d9 100755 --- a/pandora_agents/unix/pandora_agent_installer +++ b/pandora_agents/unix/pandora_agent_installer @@ -10,7 +10,7 @@ # ********************************************************************** PI_VERSION="7.0NG.735" -PI_BUILD="190604" +PI_BUILD="190606" OS_NAME=`uname -s` FORCE=0 diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi index 2755e2bdea..996467652e 100644 --- a/pandora_agents/win32/installer/pandora.mpi +++ b/pandora_agents/win32/installer/pandora.mpi @@ -186,7 +186,7 @@ UpgradeApplicationID {} Version -{190604} +{190606} ViewReadme {Yes} diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc index 0686c724f8..2ec76d3caa 100644 --- a/pandora_agents/win32/pandora.cc +++ b/pandora_agents/win32/pandora.cc @@ -30,7 +30,7 @@ using namespace Pandora; using namespace Pandora_Strutils; #define PATH_SIZE _MAX_PATH+1 -#define PANDORA_VERSION ("7.0NG.735(Build 190604)") +#define PANDORA_VERSION ("7.0NG.735(Build 190606)") string pandora_path; string pandora_dir; diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc index 8650b54e46..4fe3bfa1ab 100644 --- a/pandora_agents/win32/versioninfo.rc +++ b/pandora_agents/win32/versioninfo.rc @@ -11,7 +11,7 @@ BEGIN VALUE "LegalCopyright", "Artica ST" VALUE "OriginalFilename", "PandoraAgent.exe" VALUE "ProductName", "Pandora FMS Windows Agent" - VALUE "ProductVersion", "(7.0NG.735(Build 190604))" + VALUE "ProductVersion", "(7.0NG.735(Build 190606))" VALUE "FileVersion", "1.0.0.0" END END diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control index 6d045e7ee0..a9798d9ae7 100644 --- a/pandora_console/DEBIAN/control +++ b/pandora_console/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-console -Version: 7.0NG.735-190604 +Version: 7.0NG.735-190606 Architecture: all Priority: optional Section: admin diff --git a/pandora_console/DEBIAN/make_deb_package.sh b/pandora_console/DEBIAN/make_deb_package.sh index 13cc28aa57..9c9491ea28 100644 --- a/pandora_console/DEBIAN/make_deb_package.sh +++ b/pandora_console/DEBIAN/make_deb_package.sh @@ -14,7 +14,7 @@ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -pandora_version="7.0NG.735-190604" +pandora_version="7.0NG.735-190606" package_pear=0 package_pandora=1 diff --git a/pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql b/pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql index 4261fdf88b..2c9ff7e7de 100644 --- a/pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql +++ b/pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql @@ -1989,6 +1989,33 @@ CREATE TABLE IF NOT EXISTS `tnetwork_matrix` ( UNIQUE (`source`, `destination`, `utimestamp`) ) ENGINE = InnoDB DEFAULT CHARSET=utf8 ; +-- --------------------------------------------------------------------- +-- Table `user_task` +-- --------------------------------------------------------------------- +CREATE TABLE IF NOT EXISTS `tuser_task` ( + `id` int(20) unsigned NOT NULL auto_increment, + `function_name` varchar(80) NOT NULL default '', + `parameters` text NOT NULL default '', + `name` varchar(60) NOT NULL default '', + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +-- --------------------------------------------------------------------- +-- Table `user_task_scheduled` +-- --------------------------------------------------------------------- +CREATE TABLE IF NOT EXISTS `tuser_task_scheduled` ( + `id` int(20) unsigned NOT NULL auto_increment, + `id_usuario` varchar(60) NOT NULL default '0', + `id_user_task` int(20) unsigned NOT NULL default '0', + `args` TEXT NOT NULL, + `scheduled` enum('no','hourly','daily','weekly','monthly','yearly','custom') default 'no', + `last_run` int(20) unsigned default '0', + `custom_data` int(10) NULL default '0', + `flag_delete` tinyint(1) UNSIGNED NOT NULL default 0, + `id_grupo` int(10) unsigned NOT NULL default 0, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + -- ----------------------------------------------------- -- Table `tnotification_source` -- ----------------------------------------------------- diff --git a/pandora_console/images/groups_small_white/application_osx.png b/pandora_console/images/groups_small_white/application_osx.png new file mode 100644 index 0000000000..409d9742d2 Binary files /dev/null and b/pandora_console/images/groups_small_white/application_osx.png differ diff --git a/pandora_console/images/groups_small_white/application_osx_terminal.png b/pandora_console/images/groups_small_white/application_osx_terminal.png new file mode 100644 index 0000000000..3deb76aa34 Binary files /dev/null and b/pandora_console/images/groups_small_white/application_osx_terminal.png differ diff --git a/pandora_console/images/groups_small_white/applications.png b/pandora_console/images/groups_small_white/applications.png new file mode 100644 index 0000000000..362ed8b98d Binary files /dev/null and b/pandora_console/images/groups_small_white/applications.png differ diff --git a/pandora_console/images/groups_small_white/bricks.png b/pandora_console/images/groups_small_white/bricks.png new file mode 100644 index 0000000000..b68255b88b Binary files /dev/null and b/pandora_console/images/groups_small_white/bricks.png differ diff --git a/pandora_console/images/groups_small_white/chart_organisation.png b/pandora_console/images/groups_small_white/chart_organisation.png new file mode 100644 index 0000000000..d80fc4f65f Binary files /dev/null and b/pandora_console/images/groups_small_white/chart_organisation.png differ diff --git a/pandora_console/images/groups_small_white/clock.png b/pandora_console/images/groups_small_white/clock.png new file mode 100644 index 0000000000..dc16f55773 Binary files /dev/null and b/pandora_console/images/groups_small_white/clock.png differ diff --git a/pandora_console/images/groups_small_white/computer.png b/pandora_console/images/groups_small_white/computer.png new file mode 100644 index 0000000000..5eab00e255 Binary files /dev/null and b/pandora_console/images/groups_small_white/computer.png differ diff --git a/pandora_console/images/groups_small_white/database.png b/pandora_console/images/groups_small_white/database.png new file mode 100644 index 0000000000..397f3fa5d3 Binary files /dev/null and b/pandora_console/images/groups_small_white/database.png differ diff --git a/pandora_console/images/groups_small_white/database_gear.png b/pandora_console/images/groups_small_white/database_gear.png new file mode 100644 index 0000000000..72a6b63d0f Binary files /dev/null and b/pandora_console/images/groups_small_white/database_gear.png differ diff --git a/pandora_console/images/groups_small_white/drive_network.png b/pandora_console/images/groups_small_white/drive_network.png new file mode 100644 index 0000000000..4e1cd615c6 Binary files /dev/null and b/pandora_console/images/groups_small_white/drive_network.png differ diff --git a/pandora_console/images/groups_small_white/email.png b/pandora_console/images/groups_small_white/email.png new file mode 100644 index 0000000000..496991da88 Binary files /dev/null and b/pandora_console/images/groups_small_white/email.png differ diff --git a/pandora_console/images/groups_small_white/eye.png b/pandora_console/images/groups_small_white/eye.png new file mode 100644 index 0000000000..f5c8a4e940 Binary files /dev/null and b/pandora_console/images/groups_small_white/eye.png differ diff --git a/pandora_console/images/groups_small_white/firewall.png b/pandora_console/images/groups_small_white/firewall.png new file mode 100644 index 0000000000..261adbcb1e Binary files /dev/null and b/pandora_console/images/groups_small_white/firewall.png differ diff --git a/pandora_console/images/groups_small_white/heart.png b/pandora_console/images/groups_small_white/heart.png new file mode 100644 index 0000000000..6bfec0298a Binary files /dev/null and b/pandora_console/images/groups_small_white/heart.png differ diff --git a/pandora_console/images/groups_small_white/house.png b/pandora_console/images/groups_small_white/house.png new file mode 100644 index 0000000000..72ab42dd35 Binary files /dev/null and b/pandora_console/images/groups_small_white/house.png differ diff --git a/pandora_console/images/groups_small_white/images.png b/pandora_console/images/groups_small_white/images.png new file mode 100644 index 0000000000..195c7e222b Binary files /dev/null and b/pandora_console/images/groups_small_white/images.png differ diff --git a/pandora_console/images/groups_small_white/lightning.png b/pandora_console/images/groups_small_white/lightning.png new file mode 100644 index 0000000000..31a0670a68 Binary files /dev/null and b/pandora_console/images/groups_small_white/lightning.png differ diff --git a/pandora_console/images/groups_small_white/lock.png b/pandora_console/images/groups_small_white/lock.png new file mode 100644 index 0000000000..522ff71bd6 Binary files /dev/null and b/pandora_console/images/groups_small_white/lock.png differ diff --git a/pandora_console/images/groups_small_white/network.png b/pandora_console/images/groups_small_white/network.png new file mode 100644 index 0000000000..1a8573a729 Binary files /dev/null and b/pandora_console/images/groups_small_white/network.png differ diff --git a/pandora_console/images/groups_small_white/plugin.png b/pandora_console/images/groups_small_white/plugin.png new file mode 100644 index 0000000000..051ec05d6b Binary files /dev/null and b/pandora_console/images/groups_small_white/plugin.png differ diff --git a/pandora_console/images/groups_small_white/printer.png b/pandora_console/images/groups_small_white/printer.png new file mode 100644 index 0000000000..4187e87a00 Binary files /dev/null and b/pandora_console/images/groups_small_white/printer.png differ diff --git a/pandora_console/images/groups_small_white/server_database.png b/pandora_console/images/groups_small_white/server_database.png new file mode 100644 index 0000000000..864e3cb7cb Binary files /dev/null and b/pandora_console/images/groups_small_white/server_database.png differ diff --git a/pandora_console/images/groups_small_white/transmit.png b/pandora_console/images/groups_small_white/transmit.png new file mode 100644 index 0000000000..d27f5c377d Binary files /dev/null and b/pandora_console/images/groups_small_white/transmit.png differ diff --git a/pandora_console/images/groups_small_white/without_group.png b/pandora_console/images/groups_small_white/without_group.png new file mode 100644 index 0000000000..30915bd101 Binary files /dev/null and b/pandora_console/images/groups_small_white/without_group.png differ diff --git a/pandora_console/images/groups_small_white/world.png b/pandora_console/images/groups_small_white/world.png new file mode 100644 index 0000000000..dcfd04139b Binary files /dev/null and b/pandora_console/images/groups_small_white/world.png differ diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php index a91ee7173c..022278237a 100644 --- a/pandora_console/include/config_process.php +++ b/pandora_console/include/config_process.php @@ -20,7 +20,7 @@ /** * Pandora build version and version */ -$build_version = 'PC190604'; +$build_version = 'PC190606'; $pandora_version = 'v7.0NG.735'; // Do not overwrite default timezone set if defined. diff --git a/pandora_console/include/functions_graph.php b/pandora_console/include/functions_graph.php index 86de873965..cde59c52bb 100644 --- a/pandora_console/include/functions_graph.php +++ b/pandora_console/include/functions_graph.php @@ -289,7 +289,7 @@ function grafico_modulo_sparse_data( } } - if ($array_data === false || (!$params['graph_combined'] + if ($array_data === false && (!$params['graph_combined'] && !isset($array_data['sum1']['data'][0][1]) && !$params['baseline']) ) { return false; diff --git a/pandora_console/include/functions_snmp_browser.php b/pandora_console/include/functions_snmp_browser.php index d20daecb46..ca2b2d055b 100644 --- a/pandora_console/include/functions_snmp_browser.php +++ b/pandora_console/include/functions_snmp_browser.php @@ -261,138 +261,47 @@ function snmp_browser_get_tree( ) { global $config; - if ($target_ip == '') { - return __('Target IP cannot be blank.'); - } + $output = get_snmpwalk( + $target_ip, + $version, + $community, + $snmp3_auth_user, + $snmp3_security_level, + $snmp3_auth_method, + $snmp3_auth_pass, + $snmp3_privacy_method, + $snmp3_privacy_pass, + 0, + $starting_oid, + '', + $server_to_exec, + '', + '' + ); - // Call snmpwalk - if (empty($config['snmpwalk'])) { - switch (PHP_OS) { - case 'FreeBSD': - $snmpwalk_bin = '/usr/local/bin/snmpwalk'; - break; - - case 'NetBSD': - $snmpwalk_bin = '/usr/pkg/bin/snmpwalk'; - break; - - default: - $snmpwalk_bin = 'snmpwalk'; - break; - } - } else { - $snmpwalk_bin = $config['snmpwalk']; - } - - switch (PHP_OS) { - case 'WIN32': - case 'WINNT': - case 'Windows': - $error_redir_dir = 'NUL'; - break; - - default: - $error_redir_dir = '/dev/null'; - break; - } - - if ($server_to_exec != 0) { - $sql = sprintf('SELECT ip_address FROM tserver WHERE id_server = %d', $server_to_exec); - $server_data = db_get_row_sql($sql); - - if (enterprise_installed()) { - enterprise_include_once('include/functions_satellite.php'); - - $oid_tree = ['__LEAVES__' => []]; - if ($version == '3') { - switch ($snmp3_security_level) { - case 'authPriv': - $command = $snmpwalk_bin.' -m ALL -v 3 -u '.escapeshellarg($snmp3_auth_user).' -A '.escapeshellarg($snmp3_auth_pass).' -l '.escapeshellarg($snmp3_security_level).' -a '.escapeshellarg($snmp3_auth_method).' -x '.escapeshellarg($snmp3_privacy_method).' -X '.escapeshellarg($snmp3_privacy_pass).' '.escapeshellarg($target_ip).' '.escapeshellarg($starting_oid).' 2> '.$error_redir_dir; - break; - - case 'authNoPriv': - $command = $snmpwalk_bin.' -m ALL -v 3 -u '.escapeshellarg($snmp3_auth_user).' -A '.escapeshellarg($snmp3_auth_pass).' -l '.escapeshellarg($snmp3_security_level).' -a '.escapeshellarg($snmp3_auth_method).' '.escapeshellarg($target_ip).' '.escapeshellarg($starting_oid).' 2> '.$error_redir_dir; - break; - - case 'noAuthNoPriv': - $command = $snmpwalk_bin.' -m ALL -v 3 -u '.escapeshellarg($snmp3_auth_user).' -l '.escapeshellarg($snmp3_security_level).' '.escapeshellarg($target_ip).' '.escapeshellarg($starting_oid).' 2> '.$error_redir_dir; - break; - } - } else { - $command = $snmpwalk_bin.' -m ALL -M +'.escapeshellarg($config['homedir'].'/attachment/mibs').' -Cc -c '.escapeshellarg(io_safe_output($community)).' -v '.escapeshellarg($version).' '.escapeshellarg($target_ip).' '.escapeshellarg($starting_oid).' 2> '.$error_redir_dir; - } - - exec('ssh pandora_exec_proxy@'.$server_data['ip_address'].' "'.$command.'"', $output, $rc); - } else { - $oid_tree = ['__LEAVES__' => []]; - if ($version == '3') { - switch ($snmp3_security_level) { - case 'authPriv': - exec($snmpwalk_bin.' -m ALL -v 3 -u '.escapeshellarg($snmp3_auth_user).' -A '.escapeshellarg($snmp3_auth_pass).' -l '.escapeshellarg($snmp3_security_level).' -a '.escapeshellarg($snmp3_auth_method).' -x '.escapeshellarg($snmp3_privacy_method).' -X '.escapeshellarg($snmp3_privacy_pass).' '.escapeshellarg($target_ip).' '.escapeshellarg($starting_oid).' 2> '.$error_redir_dir, $output, $rc); - break; - - case 'authNoPriv': - exec($snmpwalk_bin.' -m ALL -v 3 -u '.escapeshellarg($snmp3_auth_user).' -A '.escapeshellarg($snmp3_auth_pass).' -l '.escapeshellarg($snmp3_security_level).' -a '.escapeshellarg($snmp3_auth_method).' '.escapeshellarg($target_ip).' '.escapeshellarg($starting_oid).' 2> '.$error_redir_dir, $output, $rc); - break; - - case 'noAuthNoPriv': - exec($snmpwalk_bin.' -m ALL -v 3 -u '.escapeshellarg($snmp3_auth_user).' -l '.escapeshellarg($snmp3_security_level).' '.escapeshellarg($target_ip).' '.escapeshellarg($starting_oid).' 2> '.$error_redir_dir, $output, $rc); - break; - } - } else { - exec($snmpwalk_bin.' -m ALL -M +'.escapeshellarg($config['homedir'].'/attachment/mibs').' -Cc -c '.escapeshellarg(io_safe_output($community)).' -v '.escapeshellarg($version).' '.escapeshellarg($target_ip).' '.escapeshellarg($starting_oid).' 2> '.$error_redir_dir, $output, $rc); - } - } - } else { - $oid_tree = ['__LEAVES__' => []]; - if ($version == '3') { - switch ($snmp3_security_level) { - case 'authPriv': - exec($snmpwalk_bin.' -m ALL -v 3 -u '.escapeshellarg($snmp3_auth_user).' -A '.escapeshellarg($snmp3_auth_pass).' -l '.escapeshellarg($snmp3_security_level).' -a '.escapeshellarg($snmp3_auth_method).' -x '.escapeshellarg($snmp3_privacy_method).' -X '.escapeshellarg($snmp3_privacy_pass).' '.escapeshellarg($target_ip).' '.escapeshellarg($starting_oid).' 2> '.$error_redir_dir, $output, $rc); - break; - - case 'authNoPriv': - exec($snmpwalk_bin.' -m ALL -v 3 -u '.escapeshellarg($snmp3_auth_user).' -A '.escapeshellarg($snmp3_auth_pass).' -l '.escapeshellarg($snmp3_security_level).' -a '.escapeshellarg($snmp3_auth_method).' '.escapeshellarg($target_ip).' '.escapeshellarg($starting_oid).' 2> '.$error_redir_dir, $output, $rc); - break; - - case 'noAuthNoPriv': - exec($snmpwalk_bin.' -m ALL -v 3 -u '.escapeshellarg($snmp3_auth_user).' -l '.escapeshellarg($snmp3_security_level).' '.escapeshellarg($target_ip).' '.escapeshellarg($starting_oid).' 2> '.$error_redir_dir, $output, $rc); - break; - } - } else { - exec($snmpwalk_bin.' -m ALL -M +'.escapeshellarg($config['homedir'].'/attachment/mibs').' -Cc -c '.escapeshellarg(io_safe_output($community)).' -v '.escapeshellarg($version).' '.escapeshellarg($target_ip).' '.escapeshellarg($starting_oid).' 2> '.$error_redir_dir, $output, $rc); - } - } - - foreach ($output as $line) { - // Separate the OID from the value - $full_oid = explode('=', $line); - if (! isset($full_oid[1])) { - continue; - } - - $oid = trim($full_oid[0]); - $value = trim($full_oid[1]); - - // Parse the OID + // Build the tree. + $oid_tree = ['__LEAVES__' => []]; + foreach ($output as $oid => $value) { + // Parse the OID. + $oid_len = strlen($oid); $group = 0; $sub_oid = ''; $ptr = &$oid_tree['__LEAVES__']; - for ($i = 0; $i < strlen($oid); $i++) { + for ($i = 0; $i < $oid_len; $i++) { // "X.Y.Z" if ($oid[$i] == '"') { $group = ($group ^ 1); } - // Move to the next element of the OID + // Move to the next element of the OID. if ($group == 0 && ($oid[$i] == '.' || ($oid[$i] == ':' && $oid[($i + 1)] == ':'))) { - // Skip the next : + // Skip the next ":". if ($oid[$i] == ':') { $i++; } - // Starting dot + // Starting dot. if ($sub_oid == '') { continue; } @@ -410,7 +319,7 @@ function snmp_browser_get_tree( } } - // The last element will contain the full OID + // The last element will contain the full OID. $ptr[$sub_oid] = [ '__OID__' => $oid, '__VALUE__' => $value, @@ -459,83 +368,27 @@ function snmp_browser_get_oid( return; } + $output = get_snmpwalk( + $target_ip, + $version, + $community, + $snmp3_auth_user, + $snmp3_security_level, + $snmp3_auth_method, + $snmp3_auth_pass, + $snmp3_privacy_method, + $snmp3_privacy_pass, + 0, + $target_oid, + '', + $server_to_exec, + '', + '-On' + ); + $oid_data['oid'] = $target_oid; - if (empty($config['snmpget'])) { - switch (PHP_OS) { - case 'FreeBSD': - $snmpget_bin = '/usr/local/bin/snmpget'; - break; - - case 'NetBSD': - $snmpget_bin = '/usr/pkg/bin/snmpget'; - break; - - default: - $snmpget_bin = 'snmpget'; - break; - } - } else { - $snmpget_bin = $config['snmpget']; - } - - switch (PHP_OS) { - case 'WIN32': - case 'WINNT': - case 'Windows': - $error_redir_dir = 'NUL'; - break; - - default: - $error_redir_dir = '/dev/null'; - break; - } - - if ($server_to_exec != 0) { - $sql = sprintf( - 'SELECT ip_address FROM tserver WHERE id_server = %d', - $server_to_exec - ); - $server_data = db_get_row_sql($sql); - - if ($version == '3') { - $command = $snmpget_bin.' -m ALL -v 3 -u '.escapeshellarg($snmp3_auth_user).' -A '.escapeshellarg($snmp3_auth_pass).' -l '.escapeshellarg($snmp3_security_level).' -a '.escapeshellarg($snmp3_auth_method).' -x '.escapeshellarg($snmp3_privacy_method).' -X '.escapeshellarg($snmp3_privacy_pass).' '.escapeshellarg($target_ip).' '.escapeshellarg($target_oid).' 2> '.$error_redir_dir; - } else { - $command = $snmpget_bin.' -m ALL -M +'.escapeshellarg($config['homedir'].'/attachment/mibs').' -On -c '.escapeshellarg(io_safe_output($community)).' -v '.escapeshellarg($version).' '.escapeshellarg($target_ip).' '.escapeshellarg($target_oid).' 2> '.$error_redir_dir; - } - - exec( - 'ssh pandora_exec_proxy@'.$server_data['ip_address'].' "'.$command.'"', - $output, - $rc - ); - } else { - if ($version == '3') { - exec( - $snmpget_bin.' -m ALL -v 3 -u '.escapeshellarg($snmp3_auth_user).' -A '.escapeshellarg($snmp3_auth_pass).' -l '.escapeshellarg($snmp3_security_level).' -a '.escapeshellarg($snmp3_auth_method).' -x '.escapeshellarg($snmp3_privacy_method).' -X '.escapeshellarg($snmp3_privacy_pass).' '.escapeshellarg($target_ip).' '.escapeshellarg($target_oid).' 2> '.$error_redir_dir, - $output, - $rc - ); - } else { - exec( - $snmpget_bin.' -m ALL -M +'.escapeshellarg($config['homedir'].'/attachment/mibs').' -On -c '.escapeshellarg(io_safe_output($community)).' -v '.escapeshellarg($version).' '.escapeshellarg($target_ip).' '.escapeshellarg($target_oid).' 2> '.$error_redir_dir, - $output, - $rc - ); - } - } - - if ($rc != 0) { - return $oid_data; - } - - foreach ($output as $line) { - // Separate the OID from the value. - $full_oid = explode('=', $line); - if (! isset($full_oid[1])) { - break; - } - - $oid = trim($full_oid[0]); + foreach ($output as $oid => $value) { + $oid = trim($oid); $oid_data['numeric_oid'] = $oid; // Translate the OID. @@ -594,16 +447,19 @@ function snmp_browser_get_oid( $oid_data['description'] = $custom_data['description']; } - $full_value = explode(':', trim($full_oid[1])); + $full_value = explode(':', trim($value)); if (! isset($full_value[1])) { - $oid_data['value'] = trim($full_oid[1]); + $oid_data['value'] = trim($value); } else { $oid_data['type'] = trim($full_value[0]); $oid_data['value'] = trim($full_value[1]); } - return $oid_data; + // There should only be one OID. + break; } + + return $oid_data; } diff --git a/pandora_console/include/functions_ui.php b/pandora_console/include/functions_ui.php index 59b76ba00f..c81148b9c9 100755 --- a/pandora_console/include/functions_ui.php +++ b/pandora_console/include/functions_ui.php @@ -4364,7 +4364,7 @@ function ui_print_agent_autocomplete_input($parameters) function '.$javascript_on_blur_function_name.'() { input_value = $("#'.$input_id.'").val(); - if (input_value.length == 0) { + if (input_value.length < 2) { if (('.((int) $print_hidden_input_idagent).') || ('.((int) $use_hidden_input_idagent).')) { $("#'.$hidden_input_idagent_id.'").val(0); @@ -4415,7 +4415,7 @@ function ui_print_agent_autocomplete_input($parameters) url: action="'.$javascript_ajax_page.'", dataType: "json", success: function (data) { - if (data.length == 0) { + if (data.length < 2) { //Set icon $("#'.$input_id.'") .css("background", diff --git a/pandora_console/include/styles/pandora.css b/pandora_console/include/styles/pandora.css index b4fa370521..126f5c02a7 100644 --- a/pandora_console/include/styles/pandora.css +++ b/pandora_console/include/styles/pandora.css @@ -6096,3 +6096,30 @@ div#status_pie { .white_table_no_border { border: none !important; } + +/* + * --------------------------------------------------------------------- + * - SERVICES TABLE VIEW + * --------------------------------------------------------------------- + */ +#table_services { + display: grid; + grid-gap: 20px; + grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); + grid-template-rows: 1fr; + margin-bottom: 30px; +} + +.table_services_item_link { + font-size: 16px; + display: grid; + min-height: 80px; + box-sizing: border-box; + padding: 10px 10px 10px 0; +} + +.table_services_item { + display: grid; + align-items: center; + grid-template-columns: 50px auto; +} diff --git a/pandora_console/install.php b/pandora_console/install.php index 074e1e2960..3be39a4b63 100644 --- a/pandora_console/install.php +++ b/pandora_console/install.php @@ -129,7 +129,7 @@