mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-29 08:45:12 +02:00
Add menuentry discovery
Former-commit-id: bc40f0bda89947a88a912484642aa3c89ded64f8
This commit is contained in:
parent
eb3adfb6fb
commit
08c6d782a4
@ -21,6 +21,21 @@ require_once 'include/functions_menu.php';
|
|||||||
$menu_godmode = [];
|
$menu_godmode = [];
|
||||||
$menu_godmode['class'] = 'godmode';
|
$menu_godmode['class'] = 'godmode';
|
||||||
|
|
||||||
|
|
||||||
|
if (check_acl($config['id_user'], 0, 'PM')) {
|
||||||
|
$sub = [];
|
||||||
|
$sub['godmode/servers/discovery']['text'] = __('Discover');
|
||||||
|
$sub['godmode/servers/discovery']['id'] = 'Discover';
|
||||||
|
$sub['godmode/servers/discovery']['subsecs'] = ['godmode/servers/discovery'];
|
||||||
|
|
||||||
|
// Add to menu.
|
||||||
|
$menu_godmode['discover']['text'] = __('Discovery');
|
||||||
|
$menu_godmode['discover']['sec2'] = 'godmode/servers/discovery';
|
||||||
|
$menu_godmode['discover']['id'] = 'god-discovery';
|
||||||
|
$menu_godmode['discover']['sub'] = $sub;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
$sub = [];
|
$sub = [];
|
||||||
if (check_acl($config['id_user'], 0, 'AW') || check_acl($config['id_user'], 0, 'AD')) {
|
if (check_acl($config['id_user'], 0, 'AW') || check_acl($config['id_user'], 0, 'AD')) {
|
||||||
$sub['godmode/agentes/modificar_agente']['text'] = __('Manage agents');
|
$sub['godmode/agentes/modificar_agente']['text'] = __('Manage agents');
|
||||||
@ -200,18 +215,12 @@ if (check_acl($config['id_user'], 0, 'AW') || check_acl($config['id_user'], 0, '
|
|||||||
$menu_godmode['gservers']['id'] = 'god-servers';
|
$menu_godmode['gservers']['id'] = 'god-servers';
|
||||||
|
|
||||||
$sub = [];
|
$sub = [];
|
||||||
if (check_acl($config['id_user'], 0, 'PM')) {
|
|
||||||
$sub['godmode/servers/discovery']['text'] = __('Discover');
|
|
||||||
$sub['godmode/servers/discovery']['id'] = 'Discover';
|
|
||||||
}
|
|
||||||
|
|
||||||
if (check_acl($config['id_user'], 0, 'AW')) {
|
if (check_acl($config['id_user'], 0, 'AW')) {
|
||||||
$sub['godmode/servers/modificar_server']['text'] = __('Manage servers');
|
$sub['godmode/servers/modificar_server']['text'] = __('Manage servers');
|
||||||
$sub['godmode/servers/modificar_server']['id'] = 'Manage servers';
|
$sub['godmode/servers/modificar_server']['id'] = 'Manage servers';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// This subtabs are only for Pandora Admin
|
// This subtabs are only for Pandora Admin
|
||||||
if (check_acl($config['id_user'], 0, 'PM')) {
|
if (check_acl($config['id_user'], 0, 'PM')) {
|
||||||
enterprise_hook('ha_cluster');
|
enterprise_hook('ha_cluster');
|
||||||
|
BIN
pandora_console/images/discovery-100.png
Normal file
BIN
pandora_console/images/discovery-100.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.4 KiB |
BIN
pandora_console/images/discovery_green-100.png
Normal file
BIN
pandora_console/images/discovery_green-100.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.5 KiB |
BIN
pandora_console/images/gm_discovery.menu.png
Normal file
BIN
pandora_console/images/gm_discovery.menu.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 311 B |
BIN
pandora_console/images/gm_discovery_green.menu.png
Normal file
BIN
pandora_console/images/gm_discovery_green.menu.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 381 B |
@ -167,6 +167,9 @@ li:hover ul {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Godmode images */
|
/* Godmode images */
|
||||||
|
#icon_god-discovery {
|
||||||
|
background: url(../../images/gm_discovery.menu.png) no-repeat 50% 50%;
|
||||||
|
}
|
||||||
#icon_god-resources {
|
#icon_god-resources {
|
||||||
background: url(../../images/gm_resources.menu.png) no-repeat 50% 50%;
|
background: url(../../images/gm_resources.menu.png) no-repeat 50% 50%;
|
||||||
}
|
}
|
||||||
|
@ -28,6 +28,7 @@ use IO::Socket::INET;
|
|||||||
use POSIX qw(strftime ceil);
|
use POSIX qw(strftime ceil);
|
||||||
use JSON qw(decode_json encode_json);
|
use JSON qw(decode_json encode_json);
|
||||||
use Encode qw(encode_utf8);
|
use Encode qw(encode_utf8);
|
||||||
|
use MIME::Base64;
|
||||||
|
|
||||||
# Default lib dir for RPM and DEB packages
|
# Default lib dir for RPM and DEB packages
|
||||||
use lib '/usr/lib/perl5';
|
use lib '/usr/lib/perl5';
|
||||||
@ -252,9 +253,20 @@ sub exec_recon_script ($$$) {
|
|||||||
$macros_parameters = $macros_parameters . ' "' . $m->{"value"} . '"';
|
$macros_parameters = $macros_parameters . ' "' . $m->{"value"} . '"';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
my $args = "$task->{'id_rt'} $task->{'id_group'} $task->{'create_incident'} $macros_parameters";
|
||||||
|
|
||||||
|
# Depending of the recon_script type (name) should be invoked
|
||||||
|
# in different ways:
|
||||||
|
if ($script->{'name'} =~ /Discovery.App/i) {
|
||||||
|
# Discovery Application recon script. Imported from heavy server plugins.
|
||||||
|
# Instantiate configuration file.
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
if (-x $command) {
|
if (-x $command) {
|
||||||
`$command $task->{'id_rt'} $task->{'id_group'} $task->{'create_incident'} $macros_parameters`;
|
`$command $args`;
|
||||||
} else {
|
} else {
|
||||||
logger ($pa_config, "Cannot execute recon task command $command.");
|
logger ($pa_config, "Cannot execute recon task command $command.");
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user