pandorafms/pandora_console/godmode/menu.php

277 lines
13 KiB
PHP
Raw Normal View History

<?php
// Pandora FMS - the Free monitoring system
// ========================================
2008-06-13 Sancho Lerena <slerena@gmail.com> * index.php: Added pure (Fullscreen). HTML code cleanup and user session. * pandoradb.sql: talert_snmp: Added priority field. * pandoradb_data.sql: Changes default values in talerta. tconfig_os, tgrupo and some links. * header.php: Fixed some user session management. * logon_ok.php: New design for welcome screen, odometer is over. * menu.php, godmode/menu.php: Some ACL improvements. * agent_disk_conf_editor.php: Minor fix in view link. * configurar_agente.php, agent_manager.php: Added parent combo and better ACL checks. New remote configuration control for get timestamp info of config file. * modify_alert.php: Changes to use new internal Mail alert. * config.php: Some items moved to config_process. (font, attachment and default style). * functions.php: Added form_agent_combo(), form_event_type_combo(), form_priority() and return_priority() functions. * functions_db.php: Added smal_event_table() to render a variable table with latest events (filtered). * pandora.css. Added pure and priority colors. * estado_alertas.php: Fixed ACL problems. * stado_generalagente.php: Graph of modules now represents modules that has generated events. Old graph is not used anymore. Also display parent. * estado_grupo.php: Border of boxes is now thicker. * tactical.php: New screen, almost all code changed. Odometer is not used anymore, added some new items, like module LAG meter, module sanity, and other general metrics. * ver_agente.php: Now renders also event for each agent view. Alert manual validation generate a new event. * events.php: New event system. 90% new code. A LOT of new features, including full screen, coloured (by priority) and filters by six fields. * snmp_alert.php: Added support for alert priority. * operation/users/user.php: No longer a user with UM privileges could see any other user. * render_view.php: Added fullscreen support for visual maps. * fgraph.php: Added support for session checking in graphs (at least!). New graphics for events (some changed it's function like events by group), and feature added to progress GD implementation. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@860 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2008-06-13 18:59:54 +02:00
// Copyright (c) 2004-2008 Sancho Lerena, slerena@gmail.com
// Main PHP/SQL code development and project architecture and management
// Copyright (c) 2004-2007 Raul Mateos Martin, raulofpandora@gmail.com
// CSS and some PHP additions
// Copyright (c) 2006 Jose Navarro <contacto@indiseg.net>
// Additions to Pandora FMS 1.2 graph code
// Copyright (c) 2005-2007 Artica Soluciones Tecnologicas, info@artica.es
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU 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.
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
if (comprueba_login() == 0){
$id_user = $_SESSION["id_usuario"];
if ( (give_acl($id_user, 0, "LM")==1) OR (give_acl($id_user, 0, "AW")==1 ) OR (give_acl($id_user, 0, "PM")==1) OR (give_acl($id_user, 0, "DM")==1) OR (give_acl($id_user, 0, "UM")==1 )){
?>
<div class="tit bg3">:: <?php echo $lang_label["godmode_header"] ?> ::</div>
<div class="menug" id="god">
<?PHP
if ((give_acl($id_user, 0, "AW")==1)){
if (isset($_GET["sec2"]) && ($_GET["sec2"] == "godmode/agentes/modificar_agente" || $_GET["sec2"] == "godmode/agentes/configurar_agente")){
echo '<div id="god1s">';
}
else
echo '<div id="god1">';
echo '<ul class="mn"><li><a href="index.php?sec=gagente&amp;sec2=godmode/agentes/modificar_agente" class="mn">'.$lang_label["manage_agents"].'</a></li></ul></div>';
if (isset($_GET["sec"]) && $_GET["sec"] == "gagente"){
if (isset($_GET["sec2"]) && $_GET["sec2"] == "godmode/agentes/manage_config"){
echo "<div class='arrowgs'>";
}
2008-06-16 Sancho Lerena <slerena@gmail.com> * pandoradb_data.sql: Updated some new config tokens (graph colors), updated group default names and icons, * manage_config_remote.php, godmode/menu.php: Added new config to manage/copy remote config from one agent to other(s). * agent_manager.php: When create a new agent, cannot select group "ALL". * agent_template.php: Fixed a weird bug that creates two tagente_estado records when using a module template. * alert_manager_editor.php: Fixed ACL problem assigning combined alert components. Better management of NOP in combined alerts (Automated NOP when create the first component. Added NAND, NXOR y NOR). * manage_config.php: Solved some bugs copying configuration with new modules (Added support for new module types). Added filter for group and fixed ACL problems. Code cleanup and better layout. * module_manager_editor_prediction.php: ACL checks added. * config_process.php, setup.php: Support to choose color graphs. * functions.php: Fixed typo and removed N/A for alerts with min/max = 0 * functions_db.php: Fixed another typo in give_disabled_group(), and added feature to list_group() combo to render or now group "ALL". * estado_generalagente.php: Added network push button for whole agent. * tactical.php: Some minor layout improvement. * ver_agente.php: Network FLAG change request for whole group, and fixed manual validation on combined alerts. * events.php: Event description don't show with " ' "characters. Fixed. * fgraph.php: graph_event_module() restored (was missing in last commit), added user-defined color support. * stat_win.php: Added support to choose another date for graph. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@866 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2008-06-16 20:09:56 +02:00
else
echo "<div class='arrowg'>";
echo "<ul class='mn'><li><a href='index.php?sec=gagente&amp;sec2=godmode/agentes/manage_config' class='mn'>".lang_string ("manage_config")."</a></li></ul></div>";
2008-06-16 Sancho Lerena <slerena@gmail.com> * pandoradb_data.sql: Updated some new config tokens (graph colors), updated group default names and icons, * manage_config_remote.php, godmode/menu.php: Added new config to manage/copy remote config from one agent to other(s). * agent_manager.php: When create a new agent, cannot select group "ALL". * agent_template.php: Fixed a weird bug that creates two tagente_estado records when using a module template. * alert_manager_editor.php: Fixed ACL problem assigning combined alert components. Better management of NOP in combined alerts (Automated NOP when create the first component. Added NAND, NXOR y NOR). * manage_config.php: Solved some bugs copying configuration with new modules (Added support for new module types). Added filter for group and fixed ACL problems. Code cleanup and better layout. * module_manager_editor_prediction.php: ACL checks added. * config_process.php, setup.php: Support to choose color graphs. * functions.php: Fixed typo and removed N/A for alerts with min/max = 0 * functions_db.php: Fixed another typo in give_disabled_group(), and added feature to list_group() combo to render or now group "ALL". * estado_generalagente.php: Added network push button for whole agent. * tactical.php: Some minor layout improvement. * ver_agente.php: Network FLAG change request for whole group, and fixed manual validation on combined alerts. * events.php: Event description don't show with " ' "characters. Fixed. * fgraph.php: graph_event_module() restored (was missing in last commit), added user-defined color support. * stat_win.php: Added support to choose another date for graph. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@866 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2008-06-16 20:09:56 +02:00
if (isset($_GET["sec2"]) && $_GET["sec2"] == "godmode/agentes/manage_config_remote"){
echo "<div class='arrowgs'>";
}
else
echo "<div class='arrowg'>";
echo "<ul class='mn'><li><a href='index.php?sec=gagente&amp;sec2=godmode/agentes/manage_config_remote' class='mn'>".lang_string ("Duplicate config")."</a></li></ul></div>";
2008-06-13 Sancho Lerena <slerena@gmail.com> * index.php: Added pure (Fullscreen). HTML code cleanup and user session. * pandoradb.sql: talert_snmp: Added priority field. * pandoradb_data.sql: Changes default values in talerta. tconfig_os, tgrupo and some links. * header.php: Fixed some user session management. * logon_ok.php: New design for welcome screen, odometer is over. * menu.php, godmode/menu.php: Some ACL improvements. * agent_disk_conf_editor.php: Minor fix in view link. * configurar_agente.php, agent_manager.php: Added parent combo and better ACL checks. New remote configuration control for get timestamp info of config file. * modify_alert.php: Changes to use new internal Mail alert. * config.php: Some items moved to config_process. (font, attachment and default style). * functions.php: Added form_agent_combo(), form_event_type_combo(), form_priority() and return_priority() functions. * functions_db.php: Added smal_event_table() to render a variable table with latest events (filtered). * pandora.css. Added pure and priority colors. * estado_alertas.php: Fixed ACL problems. * stado_generalagente.php: Graph of modules now represents modules that has generated events. Old graph is not used anymore. Also display parent. * estado_grupo.php: Border of boxes is now thicker. * tactical.php: New screen, almost all code changed. Odometer is not used anymore, added some new items, like module LAG meter, module sanity, and other general metrics. * ver_agente.php: Now renders also event for each agent view. Alert manual validation generate a new event. * events.php: New event system. 90% new code. A LOT of new features, including full screen, coloured (by priority) and filters by six fields. * snmp_alert.php: Added support for alert priority. * operation/users/user.php: No longer a user with UM privileges could see any other user. * render_view.php: Added fullscreen support for visual maps. * fgraph.php: Added support for session checking in graphs (at least!). New graphics for events (some changed it's function like events by group), and feature added to progress GD implementation. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@860 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2008-06-13 18:59:54 +02:00
// Manage groups
if ((give_acl($id_user, 0, "PM")==1)){
if (isset($_GET["sec2"]) && ($_GET["sec2"] == "godmode/groups/group_list" || $_GET["sec2"] == "godmode/groups/configure_group")){
echo "<div class='arrowgs'>";
}
else
echo "<div class='arrowg'>";
echo "<ul class='mn'><li><a href='index.php?sec=gagente&amp;sec2=godmode/groups/group_list' class='mn'>".$lang_label["manage_groups"]."</a></li></ul></div>";
}
}
}
if ((give_acl($id_user, 0, "PM")==1)){
if (isset($_GET["sec"]) && ($_GET["sec"] == "gmodules"))
echo '<div id="god_module_sel">';
else
echo '<div id="god_module">';
echo '<ul class="mn"><li><a href="index.php?sec=gmodules&sec2=godmode/modules/module_list" class="mn">'.$lang_label["manage_modules"].'</a></li></ul></div>';
if (isset($_GET["sec"]) && $_GET["sec"] == "gmodules"){
if (isset($_GET["sec2"]) && $_GET["sec2"] == "godmode/modules/manage_nc_groups" || $_GET["sec2"] == "godmode/modules/manage_nc_groups_form")
echo "<div class='arrowgs'>";
else
echo "<div class='arrowg'>";
echo "<ul class='mn'><li><a href='index.php?sec=gmodules&sec2=godmode/modules/manage_nc_groups' class='mn'>".$lang_label["nc_groups"]."</a></li></ul></div>";
}
if (isset($_GET["sec"]) && $_GET["sec"] == "gmodules"){
if (isset($_GET["sec2"]) && ( $_GET["sec2"] == "godmode/modules/manage_network_components" || $_GET["sec2"] == "godmode/modules/manage_network_components_form") )
echo "<div class='arrowgs'>";
else
echo "<div class='arrowg'>";
echo "<ul class='mn'><li><a href='index.php?sec=gmodules&sec2=godmode/modules/manage_network_components' class='mn'>".$lang_label["network_components"]."</a></li></ul></div>";
}
// Network Profiles
if (isset($_GET["sec"]) && $_GET["sec"] == "gmodules"){
if (isset($_GET["sec2"]) && ($_GET["sec2"] == "godmode/modules/manage_network_templates" || $_GET["sec2"] == "godmode/modules/manage_network_templates_form" ))
echo "<div class='arrowgs'>";
else
echo "<div class='arrowg'>";
echo "<ul class='mn'><li><a href='index.php?sec=gmodules&sec2=godmode/modules/manage_network_templates' class='mn'>".$lang_label["network_templates"]."</a></li></ul></div>";
}
}
if ((give_acl($id_user, 0, "LM")==1)){
if (isset($_GET["sec2"]) && ($_GET["sec2"] == "godmode/alerts/modify_alert" || $_GET["sec2"] == "godmode/alerts/configure_alert")){
echo '<div id="god2s">';
}
else
echo '<div id="god2">';
echo '<ul class="mn"><li><a href="index.php?sec=galertas&amp;sec2=godmode/alerts/modify_alert" class="mn">'.$lang_label["manage_alerts"].'</a></li></ul></div>';
if (isset($_GET["sec"]) && $_GET["sec"] == "galertas"){
if (isset($_GET["sec2"]) && $_GET["sec2"] == "godmode/alerts/plugin"){
echo "<div class='arrowgs'>";
}
else echo "<div class='arrowg'>";
echo "<ul class='mn'><li><a href='index.php?sec=galertas&sec2=godmode/alerts/plugin' class='mn'>".lang_string("Manage plugins")."</a></li></ul></div>";
}
}
if ((give_acl($id_user, 0, "UM")==1)){
if (isset($_GET["sec2"]) && ($_GET["sec2"] == "godmode/users/user_list" || $_GET["sec2"] == "godmode/users/configure_user")){
echo '<div id="god3s">';
}
else echo '<div id="god3">';
echo '<ul class="mn"><li><a href="index.php?sec=gusuarios&amp;sec2=godmode/users/user_list" class="mn">'.$lang_label["manage_users"].'</a></li></ul></div>';
}
// Reporting
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2008-06-13 Sancho Lerena <slerena@gmail.com> * index.php: Added pure (Fullscreen). HTML code cleanup and user session. * pandoradb.sql: talert_snmp: Added priority field. * pandoradb_data.sql: Changes default values in talerta. tconfig_os, tgrupo and some links. * header.php: Fixed some user session management. * logon_ok.php: New design for welcome screen, odometer is over. * menu.php, godmode/menu.php: Some ACL improvements. * agent_disk_conf_editor.php: Minor fix in view link. * configurar_agente.php, agent_manager.php: Added parent combo and better ACL checks. New remote configuration control for get timestamp info of config file. * modify_alert.php: Changes to use new internal Mail alert. * config.php: Some items moved to config_process. (font, attachment and default style). * functions.php: Added form_agent_combo(), form_event_type_combo(), form_priority() and return_priority() functions. * functions_db.php: Added smal_event_table() to render a variable table with latest events (filtered). * pandora.css. Added pure and priority colors. * estado_alertas.php: Fixed ACL problems. * stado_generalagente.php: Graph of modules now represents modules that has generated events. Old graph is not used anymore. Also display parent. * estado_grupo.php: Border of boxes is now thicker. * tactical.php: New screen, almost all code changed. Odometer is not used anymore, added some new items, like module LAG meter, module sanity, and other general metrics. * ver_agente.php: Now renders also event for each agent view. Alert manual validation generate a new event. * events.php: New event system. 90% new code. A LOT of new features, including full screen, coloured (by priority) and filters by six fields. * snmp_alert.php: Added support for alert priority. * operation/users/user.php: No longer a user with UM privileges could see any other user. * render_view.php: Added fullscreen support for visual maps. * fgraph.php: Added support for session checking in graphs (at least!). New graphics for events (some changed it's function like events by group), and feature added to progress GD implementation. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@860 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2008-06-13 18:59:54 +02:00
if ((give_acl($id_user, 0, "PM")==1)){
echo '<div id="god51">';
echo '<ul class="mn"><li><a href="index.php?sec=greporting&sec2=godmode/reporting/reporting_builder" class="mn">'. $lang_label["manage_reporting"].'</a></li></ul></div>';
// Custom report builder
if (isset($_GET["sec"]) && $_GET["sec"] == "greporting"){
if (isset($_GET["sec2"]) && $_GET["sec2"] == "godmode/reporting/reporting_builder"){
echo "<div class='arrowgs'>";
} else {
echo "<div class='arrowg'>";
}
echo "<ul class='mn'><li><a href='index.php?sec=greporting&sec2=godmode/reporting/reporting_builder' class='mn'>".$lang_label["report_builder"]."</a></li></ul></div>";
}
// Custom graph builder
if (isset($_GET["sec"]) && $_GET["sec"] == "greporting"){
if (isset($_GET["sec2"]) && $_GET["sec2"] == "godmode/reporting/graph_builder"){
echo "<div class='arrowgs'>";
} else {
echo "<div class='arrowg'>";
}
echo "<ul class='mn'><li><a href='index.php?sec=greporting&sec2=godmode/reporting/graph_builder' class='mn'>".$lang_label["graph_builder"]."</a></li></ul></div>";
}
// Custom map builder
if (isset($_GET["sec"]) && $_GET["sec"] == "greporting"){
if (isset($_GET["sec2"]) && $_GET["sec2"] == "godmode/reporting/map_builder"){
echo "<div class='arrowgs'>";
} else {
echo "<div class='arrowg'>";
}
echo "<ul class='mn'><li><a href='index.php?sec=greporting&sec2=godmode/reporting/map_builder' class='mn'>".$lang_label["map_builder"]."</a></li></ul></div>";
}
}
// Manage profiles
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
if ( (give_acl($id_user, 0, "PM")==1)){
if (isset($_GET["sec2"]) && $_GET["sec2"] == "godmode/profiles/profile_list"){
echo '<div id="god4s">';
}
else echo '<div id="god4">';
echo '<ul class="mn"><li><a href="index.php?sec=gperfiles&amp;sec2=godmode/profiles/profile_list" class="mn">'.$lang_label["manage_profiles"].'</a></li></ul></div>';
// SERVERS
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
if (isset($_GET["sec2"]) && $_GET["sec2"] == "godmode/servers/modificar_server"){
echo '<div id="god5s">';
} else
echo '<div id="god5">';
echo '<ul class="mn"><li><a href="index.php?sec=gservers&amp;sec2=godmode/servers/modificar_server" class="mn">'.$lang_label["manage_servers"].'</a></li></ul></div>';
if (isset($_GET["sec"]) && $_GET["sec"] == "gservers"){
if (isset($_GET["sec2"]) && $_GET["sec2"] == "godmode/servers/manage_recontask"|| $_GET["sec2"] == "godmode/servers/manage_recontask_form"){
echo "<div class='arrowgs'>";
} else
echo "<div class='arrowg'>";
echo "<ul class='mn'><li><a href='index.php?sec=gservers&sec2=godmode/servers/manage_recontask' class='mn'>".$lang_label["manage_recontask"]."</a></li></ul></div>";
}
// AUDIT
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
if (isset($_GET["sec2"]) && $_GET["sec2"] == "godmode/admin_access_logs"){
echo '<div id="god6s">';
}
else echo '<div id="god6">';
echo '<ul class="mn"><li><a href="index.php?sec=glog&amp;sec2=godmode/admin_access_logs" class="mn">'.$lang_label["system_audit"].'</a></li></ul></div>';
// Main SETUP
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
if (isset($_GET["sec2"]) && $_GET["sec2"] == "godmode/setup/setup"){
echo '<div id="god7s">';
}
else echo '<div id="god7">';
echo '<ul class="mn"><li><a href="index.php?sec=gsetup&amp;sec2=godmode/setup/setup" class="mn">'.$lang_label["setup_screen"].'</a></li></ul></div>';
if (isset($_GET["sec"]) && $_GET["sec"] == "gsetup"){
if (isset($_GET["sec2"]) && $_GET["sec2"] == "godmode/setup/links"){
echo "<div class='arrowgs'>";
}
else echo "<div class='arrowg'>";
echo "<ul class='mn'><li><a href='index.php?sec=gsetup&amp;sec2=godmode/setup/links' class='mn'>".$lang_label["setup_links"]."</a></li></ul></div>";
}
if (isset($_GET["sec"]) && $_GET["sec"] == "gsetup"){
if (isset($_GET["sec2"]) && $_GET["sec2"] == "godmode/setup/news"){
echo "<div class='arrowgs'>";
}
else echo "<div class='arrowg'>";
echo "<ul class='mn'><li><a href='index.php?sec=gsetup&amp;sec2=godmode/setup/news' class='mn'>".$lang_label["site_news"]."</a></li></ul></div>";
}
}
if ((give_acl($id_user, 0, "DM")==1)){
if (isset($_GET["sec2"]) && $_GET["sec2"] == "godmode/db/db_main"){
echo '<div id="god8s">';
} else
echo '<div id="god8">';
echo '<ul class="mn">';
if (isset($_GET["sec"]) && $_GET["sec"] == "gdbman" &&
isset($_GET["sec2"]) && $_GET["sec2"] != "godmode/db/db_main"){
echo '<li>';
} else {
echo '<li class="bb0">';
}
echo '<a href="index.php?sec=gdbman&amp;sec2=godmode/db/db_main" class="mn">'.$lang_label["db_maintenance"].'</a></li></ul></div>';
if (isset($_GET["sec"]) && $_GET["sec"] == "gdbman"){
if (isset($_GET["sec2"]) && ($_GET["sec2"] == "godmode/db/db_info" || $_GET["sec2"] == "godmode/db/db_info_data")){
echo "<div class='arrowgs'>";
} else
echo "<div class='arrowg'>";
echo "<ul class='mn'><li><a href='index.php?sec=gdbman&amp;sec2=godmode/db/db_info' class='mn'>".$lang_label["db_info"]."</a></li></ul></div>";
if (isset($_GET["sec2"]) && $_GET["sec2"] == "godmode/db/db_purge"){
echo "<div class='arrowgs'>";
} else
echo "<div class='arrowg'>";
echo "<ul class='mn'><li><a href='index.php?sec=gdbman&amp;sec2=godmode/db/db_purge' class='mn'>".$lang_label["db_purge"]."</a></li></ul></div>";
if (isset($_GET["sec2"]) && $_GET["sec2"] == "godmode/db/db_refine"){
echo "<div class='arrowgs'>";
} else
echo "<div class='arrowg'>";
echo "<ul class='mn'><li><a href='index.php?sec=gdbman&amp;sec2=godmode/db/db_refine' class='mn'>".$lang_label["db_refine"]."</a></li></ul></div>";
if (isset($_GET["sec2"]) && $_GET["sec2"] == "godmode/db/db_audit"){
echo "<div class='arrowgs'>";
} else
echo "<div class='arrowg'>";
echo "<ul class='mn'><li><a href='index.php?sec=gdbman&amp;sec2=godmode/db/db_audit' class='mn'>".$lang_label["db_audit"]."</a></li></ul></div>";
if (isset($_GET["sec2"]) && $_GET["sec2"] == "godmode/db/db_event"){
echo "<div id='arrowgls'>";
} else
echo "<div id='arrowgl'>";
echo "<ul class='mn'><li class='bb0'><a href='index.php?sec=gdbman&amp;sec2=godmode/db/db_event' class='mn'>".$lang_label["db_event"]."</a></li></ul></div>";
}
}
?>
</div>
<?php
} // end verify access to this menu
}
?>