2012-04-23 16:21:54 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
//Pandora FMS- http://pandorafms.com
|
|
|
|
// ==================================================
|
|
|
|
// Copyright (c) 2005-2010 Artica Soluciones Tecnologicas
|
|
|
|
// Please see http://pandorafms.org for full contribution list
|
|
|
|
|
|
|
|
// This program is free software; you can redistribute it and/or
|
|
|
|
// modify it under the terms of the GNU Lesser General Public License
|
|
|
|
// as published by the Free Software Foundation; version 2
|
|
|
|
|
|
|
|
// This program is distributed in the hope that it will be useful,
|
|
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
// GNU General Public License for more details.
|
|
|
|
|
|
|
|
global $config;
|
|
|
|
|
|
|
|
// Login check
|
|
|
|
check_login ();
|
|
|
|
|
|
|
|
if (! check_acl ($config['id_user'], 0, "IR")) {
|
|
|
|
db_pandora_audit("ACL Violation",
|
|
|
|
"Trying to access report builder");
|
|
|
|
require ("general/noaccess.php");
|
|
|
|
exit;
|
|
|
|
}
|
|
|
|
|
|
|
|
$action = get_parameter('action');
|
|
|
|
|
2012-10-11 12:20:37 +02:00
|
|
|
//error_reporting(E_ALL);
|
|
|
|
//ini_set("display_errors", 1);
|
|
|
|
|
2012-04-23 16:21:54 +02:00
|
|
|
switch($action) {
|
|
|
|
case 'get_networkmap_summary':
|
|
|
|
$stats = get_parameter('stats', array());
|
|
|
|
$stats = json_decode(base64_decode($stats),true);
|
2012-10-09 17:51:33 +02:00
|
|
|
$metaconsole = (bool)get_parameter('metaconsole', false);
|
|
|
|
|
|
|
|
$hack_metaconsole = '';
|
|
|
|
if ($metaconsole) {
|
|
|
|
$hack_metaconsole = '../../';
|
|
|
|
}
|
2012-04-23 16:21:54 +02:00
|
|
|
|
|
|
|
$summary = '<br>';
|
|
|
|
|
2012-10-09 17:51:33 +02:00
|
|
|
if (isset($stats['policies'])) {
|
|
|
|
$summary .= count($stats['policies']) . " x " .
|
|
|
|
html_print_image($hack_metaconsole . 'images/policies.png',true) . ' '.
|
|
|
|
__('Policies') . "<br>";
|
2012-04-23 16:21:54 +02:00
|
|
|
}
|
|
|
|
|
2012-10-09 17:51:33 +02:00
|
|
|
if (isset($stats['groups'])) {
|
2012-04-23 16:21:54 +02:00
|
|
|
// TODO: GET STATUS OF THE GROUPS AND ADD IT TO SUMMARY
|
2012-10-09 17:51:33 +02:00
|
|
|
$summary .= count($stats['groups']) . " x " .
|
|
|
|
html_print_image($hack_metaconsole . 'images/group.png',true) . ' ' .
|
|
|
|
__('Groups') . "<br>";
|
2012-04-23 16:21:54 +02:00
|
|
|
}
|
|
|
|
|
2012-10-09 17:51:33 +02:00
|
|
|
if (isset($stats['agents'])) {
|
2015-03-27 14:32:31 +01:00
|
|
|
// TODO: GET STATUS OF THE AGENTS AND ADD IT TO SUMMARY
|
|
|
|
$summary .= count($stats['agents']) .
|
|
|
|
" x " . html_print_image($hack_metaconsole . 'images/bricks.png',true) .
|
|
|
|
' ' . __('Agents') . "<br>";
|
2012-04-23 16:21:54 +02:00
|
|
|
}
|
|
|
|
|
2012-10-09 17:51:33 +02:00
|
|
|
if (isset($stats['modules'])) {
|
2012-04-23 16:21:54 +02:00
|
|
|
// TODO: GET STATUS OF THE MODULES AND ADD IT TO SUMMARY
|
2015-03-27 14:32:31 +01:00
|
|
|
$summary .= count($stats['modules']) .
|
|
|
|
" x " . html_print_image($hack_metaconsole . 'images/brick.png',true) .
|
|
|
|
' ' . __('Modules') . "<br>";
|
2012-04-23 16:21:54 +02:00
|
|
|
}
|
|
|
|
|
2012-10-11 12:20:37 +02:00
|
|
|
echo '<h3>'.__('Map summary').'</h3><strong>'.$summary.'</strong>';
|
|
|
|
break;
|
|
|
|
case 'get_networkmap_summary_pandora_server':
|
|
|
|
$id_server = (int)get_parameter('id_server', 0);
|
|
|
|
$stats = get_parameter('stats', array());
|
|
|
|
$stats = json_decode(base64_decode($stats),true);
|
|
|
|
$metaconsole = (bool)get_parameter('metaconsole', false);
|
|
|
|
|
|
|
|
$hack_metaconsole = '';
|
|
|
|
if ($metaconsole) {
|
|
|
|
$hack_metaconsole = '../../';
|
|
|
|
}
|
|
|
|
|
|
|
|
$summary = '<br>';
|
|
|
|
|
|
|
|
if (isset($stats['agents'])) {
|
2015-03-27 14:32:31 +01:00
|
|
|
$summary .= count($stats['agents']) .
|
|
|
|
" x " . html_print_image($hack_metaconsole . 'images/bricks.png',true) .
|
|
|
|
' ' . __('Agents') . "<br>";
|
2012-10-11 12:20:37 +02:00
|
|
|
}
|
2012-04-23 16:21:54 +02:00
|
|
|
echo '<h3>'.__('Map summary').'</h3><strong>'.$summary.'</strong>';
|
|
|
|
break;
|
|
|
|
}
|
2012-10-11 12:20:37 +02:00
|
|
|
?>
|