2009-11-31 Sancho Lerena <slerena@artica.es>
* include/functions_reporting.php: SLA readjust to be used in SLA view. * include/config_process.php, * include/functions_config.php: Added support for custom_logo option. * include/help/en/help_agent_access.php, include/help/en/help_custom_logo.php: New help topics. * include/functions_agents.php: Replaced audit_db with pandora_audit(). * include/functions_db.php: pandora_audit() will replace audit_db(). * operation/agentes/sla_view.php: now show render ok modules with min_critical defined and uses to calculate automatically a SLA based on it's critical definition. * operation/messages/message.php: Message view was not working!. Fixed * Some new images added: images/people_2.png images/MiniLogoArtica.jpg images/pandora_header_logo_enterprise.png images/custom_logo images/custom_logo/sourceforge.png images/custom_logo/artica_logo.png images/custom_logo/pandora_logo_head.png images/pandora_header_logo.png images/people_1.png: * general/header.php: Changes to add new custom logo feature and replace logos with a image instead text. * godmode/setup/setup_visuals.php: now is possible to choose a custom logo to be displayed in header. *operation/agentes/ver_agente.php, * godmode/agentes/configurar_agente.php: Tabs do not have text at sides. This avoid problems in other languages different than english with long text strings. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@2148 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
|
@ -1,3 +1,44 @@
|
|||
2009-11-31 Sancho Lerena <slerena@artica.es>
|
||||
|
||||
* include/functions_reporting.php: SLA readjust to be used in SLA view.
|
||||
|
||||
* include/config_process.php,
|
||||
* include/functions_config.php: Added support for custom_logo option.
|
||||
|
||||
* include/help/en/help_agent_access.php,
|
||||
include/help/en/help_custom_logo.php: New help topics.
|
||||
|
||||
* include/functions_agents.php: Replaced audit_db with pandora_audit().
|
||||
|
||||
* include/functions_db.php: pandora_audit() will replace audit_db().
|
||||
|
||||
* operation/agentes/sla_view.php: now show render ok modules with min_critical
|
||||
defined and uses to calculate automatically a SLA based on it's critical
|
||||
definition.
|
||||
|
||||
* operation/messages/message.php: Message view was not working!. Fixed
|
||||
|
||||
* Some new images added:
|
||||
images/people_2.png
|
||||
images/MiniLogoArtica.jpg
|
||||
images/pandora_header_logo_enterprise.png
|
||||
images/custom_logo
|
||||
images/custom_logo/sourceforge.png
|
||||
images/custom_logo/artica_logo.png
|
||||
images/custom_logo/pandora_logo_head.png
|
||||
images/pandora_header_logo.png
|
||||
images/people_1.png:
|
||||
|
||||
* general/header.php: Changes to add new custom logo feature and replace
|
||||
logos with a image instead text.
|
||||
|
||||
* godmode/setup/setup_visuals.php: now is possible to choose a custom logo
|
||||
to be displayed in header.
|
||||
|
||||
*operation/agentes/ver_agente.php,
|
||||
* godmode/agentes/configurar_agente.php: Tabs do not have text at sides. This
|
||||
avoid problems in other languages different than english with long text strings.
|
||||
|
||||
2009-11-30 Miguel de Dios <miguel.dedios@artica.es>
|
||||
|
||||
* include/functions_agents.php: added new parameter for order the result of
|
||||
|
|
|
@ -17,7 +17,8 @@ require_once ("include/functions_messages.php");
|
|||
?>
|
||||
<table width="100%" cellpadding="0" cellspacing="0" style="margin:0px; padding:0px;" border="0">
|
||||
<tr>
|
||||
<td rowspan=2><div id="pandora_logo_header"></div></td>
|
||||
<td rowspan=2>
|
||||
<?php echo "<img height=60 width=139 src='images/custom_logo/".$config["custom_logo"]."'></td>"; ?>
|
||||
<td width="20%">
|
||||
<img src="images/user_<?php if (is_user_admin ($config["id_user"]) == 1) echo 'suit'; else echo 'green'; ?>.png" class="bot" alt="user" />
|
||||
<a href="index.php?sec=usuarios&sec2=operation/users/user_edit" class="white"><?php echo __('You are');?> [<b><?php echo $config["id_user"];?></b>]</a>
|
||||
|
@ -91,14 +92,13 @@ require_once ("include/functions_messages.php");
|
|||
echo '</span>';
|
||||
}
|
||||
echo "</td>";
|
||||
echo "<td width='25%' rowspan=2>";
|
||||
echo "<td width='20%' rowspan=2>";
|
||||
echo "<a href='index.php?sec=main'>";
|
||||
echo "<div id='head_r'><span id='logo_text1'>Pandora</span> <span id='logo_text2'>FMS</span></div>";
|
||||
if (file_exists (ENTERPRISE_DIR."/load_enterprise.php"))
|
||||
echo '<div id="logo_text3">Enterprise</div>';
|
||||
else
|
||||
echo '<div id="logo_text3">OpenSource</div>';
|
||||
echo "</A>";
|
||||
if (file_exists ($ENTERPRISE_DIR."/load_enterprise.php")){
|
||||
echo "<img border=0 src='images/pandora_header_logo.png'>";
|
||||
} else {
|
||||
echo "<img border=0 src='images/pandora_header_logo_enterprise.png'>";
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
|
|
|
@ -192,40 +192,35 @@ if ($id_agente) {
|
|||
echo '<div id="menu_tab_frame"><div id="menu_tab_left"><ul class="mn">';
|
||||
echo '<li class="nomn"><a href="index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&id_agente='.$id_agente.'">';
|
||||
print_image ("images/setup.png", false, $img_style);
|
||||
echo ' '.mb_substr(get_agent_name ($id_agente), 0, 15) .'</a>';
|
||||
echo ' '.mb_substr(get_agent_name ($id_agente), 0, 21) .'</a>';
|
||||
echo "</li></ul></div>";
|
||||
|
||||
echo '<div id="menu_tab"><ul class="mn"><li class="nomn">';
|
||||
echo '<a href="index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente='.$id_agente.'">';
|
||||
print_image ("images/zoom.png", false, $img_style);
|
||||
echo ' '.__('View').'</a></li>';
|
||||
echo "<img src='images/zoom.png' class=top title='".__('View')."'> </a></li>";
|
||||
|
||||
echo '<li class="'.($tab == "main" ? 'nomn_high' : 'nomn').'">';
|
||||
echo '<a href="index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&tab=main&id_agente='.$id_agente.'">';
|
||||
print_image ("images/cog.png", false, $img_style);
|
||||
echo ' '.__('Setup').'</a></li>';
|
||||
echo "<img src='images/cog.png' class='top' title='".__('Setup')."'> </a></li>";
|
||||
|
||||
echo '<li class="'.($tab == "module" ? 'nomn_high' : 'nomn').'">';
|
||||
echo '<a href="index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&tab=module&id_agente='.$id_agente.'">';
|
||||
print_image ("images/lightbulb.png", false, $img_style);
|
||||
echo ' '.__('Modules').'</a></li>';
|
||||
echo "<img src='images/lightbulb.png' class='top' title='".__('Modules')."'> </a></li>";
|
||||
|
||||
echo '<li class="'.($tab == "alert" ? 'nomn_high' : 'nomn').'">';
|
||||
echo '<a href="index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&tab=alert&id_agente='.$id_agente.'">';
|
||||
print_image ("images/bell.png", false, $img_style);
|
||||
echo ' '.__('Alerts').'</a></li>';
|
||||
echo "<img src='images/bell.png' class='top' title='".__('Alerts')."'> </a></li>";
|
||||
|
||||
|
||||
echo '<li class="'.($tab == "template" ? 'nomn_high' : 'nomn').'">';
|
||||
echo '<a href="index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&tab=template&id_agente='.$id_agente.'">';
|
||||
print_image ("images/network.png", false, $img_style);
|
||||
echo ' '.__('Templates').'</a></li>';
|
||||
echo "<img src='images/network.png' class='top' title='".__('Module templates')."'> </a></li>";
|
||||
|
||||
enterprise_hook ('inventory_tab');
|
||||
|
||||
echo '<li class="nomn">';
|
||||
echo '<a href="index.php?sec=gagente&sec2=godmode/agentes/modificar_agente&ag_group='.$group.'">';
|
||||
print_image ("images/agents_group.png", false, $img_style);
|
||||
echo ' '.__('Group').'</a></li>';
|
||||
echo "<img src='images/agents_group.png' class='top' title='".__('Group')."'> </a></li>";
|
||||
|
||||
echo "</ul></div></div>";
|
||||
|
||||
|
|
|
@ -80,7 +80,7 @@ $table->data[9][1] = print_select ($iconsets, 'status_images_set', $config["stat
|
|||
$table->data[10][0] = __('Font path');
|
||||
$table->data[10][1] = print_input_text ('fontpath', $config["fontpath"], '', 50, 255, true);
|
||||
|
||||
$table->data[11][0] = __('Use agent access graph');
|
||||
$table->data[11][0] = __('Use agent access graph'). print_help_icon("agent_access", true);
|
||||
$table->data[11][1] = __('Yes').' '.print_radio_button ('agentaccess', 1, '', $config["agentaccess"], true).' ';
|
||||
$table->data[11][1] .= __('No').' '.print_radio_button ('agentaccess', 0, '', $config["agentaccess"], true);
|
||||
|
||||
|
@ -88,6 +88,9 @@ $table->data[12][0] = __('Flash charts');
|
|||
$table->data[12][1] = __('Yes').' '.print_radio_button ('flash_charts', 1, '', $config["flash_charts"], true).' ';
|
||||
$table->data[12][1] .= __('No').' '.print_radio_button ('flash_charts', 0, '', $config["flash_charts"], true);
|
||||
|
||||
$table->data[13][0] = __('Custom logo') . print_help_icon("custom_logo", true);
|
||||
$table->data[13][1] = print_select (list_files ('images/custom_logo', "png", 1, 0), 'custom_logo', $config["custom_logo"], '', '', '', true);
|
||||
|
||||
|
||||
echo '<form id="form_setup" method="post">';
|
||||
print_input_hidden ('update_config', 1);
|
||||
|
|
After Width: | Height: | Size: 3.0 KiB |
After Width: | Height: | Size: 8.0 KiB |
After Width: | Height: | Size: 4.1 KiB |
After Width: | Height: | Size: 3.6 KiB |
After Width: | Height: | Size: 3.2 KiB |
After Width: | Height: | Size: 9.1 KiB |
After Width: | Height: | Size: 7.6 KiB |
|
@ -26,7 +26,7 @@ $build_version = 'PC091127';
|
|||
$pandora_version = 'v3.0RC3-dev';
|
||||
|
||||
/* Help to debug problems. Override global PHP configuration */
|
||||
error_reporting(E_ERROR);
|
||||
error_reporting(E_ALL);
|
||||
ini_set("display_errors", 0);
|
||||
ini_set("error_log", $config["homedir"]."/pandora_console.log");
|
||||
|
||||
|
@ -57,6 +57,9 @@ process_config ();
|
|||
require_once ('streams.php');
|
||||
require_once ('gettext.php');
|
||||
|
||||
global $REMOTE_ADDR;
|
||||
|
||||
$config["remote_addr"] = $_SERVER['REMOTE_ADDR'];
|
||||
|
||||
// Set user language if provided, overriding System language
|
||||
if (isset ($config['id_user'])){
|
||||
|
|
|
@ -91,8 +91,7 @@ function create_agent ($name, $id_group, $interval, $ip_address, $values = false
|
|||
|
||||
process_sql_commit ();
|
||||
|
||||
audit_db ($config['id_user'], $REMOTE_ADDR, "Agent management",
|
||||
"New agent '$name' created");
|
||||
pandora_audit ("Agent management", "New agent '$name' created");
|
||||
|
||||
return $id_agent;
|
||||
}
|
||||
|
|
|
@ -161,6 +161,8 @@ function update_config () {
|
|||
update_config_value ('flash_charts', (bool) get_parameter ('flash_charts', $config["flash_charts"]));
|
||||
update_config_value ('attachment_store', (string) get_parameter ('attachment_store', $config["attachment_store"]));
|
||||
update_config_value ('list_ACL_IPs_for_API', (string) get_parameter('list_ACL_IPs_for_API', implode("\n", $config['list_ACL_IPs_for_API'])));
|
||||
|
||||
update_config_value ('custom_logo', (string) get_parameter ('custom_logo', $config["custom_logo"]));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -303,6 +305,10 @@ function process_config () {
|
|||
update_config_value ( 'flash_charts', true);
|
||||
}
|
||||
|
||||
if (!isset ($config["custom_logo"])){
|
||||
update_config_value ('custom_logo', 'pandora_logo_head.png');
|
||||
}
|
||||
|
||||
/* Finally, check if any value was overwritten in a form */
|
||||
update_config ();
|
||||
}
|
||||
|
|
|
@ -184,7 +184,7 @@ function safe_acl_group ($id_user, $id_groups, $access) {
|
|||
|
||||
|
||||
/**
|
||||
* Adds an audit log entry.
|
||||
* Adds an audit log entry (DEPRECATED!)
|
||||
*
|
||||
* @param string $id User id
|
||||
* @param string $ip Client IP
|
||||
|
@ -198,6 +198,26 @@ function audit_db ($id, $ip, $accion, $descripcion){
|
|||
process_sql ($sql);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Adds an audit log entry (new function in 3.0)
|
||||
*
|
||||
* @param string $accion Action description
|
||||
* @param string $descripcion Long action description
|
||||
*/
|
||||
function pandora_audit ($accion, $descripcion){
|
||||
global $config;
|
||||
$ip = $config["remote_addr"];
|
||||
$id = $config["id_user"];
|
||||
|
||||
$accion = safe_input($accion);
|
||||
$descripcion = safe_input($descripcion);
|
||||
$sql = sprintf ("INSERT INTO tsesion (ID_usuario, accion, fecha, IP_origen,descripcion, utimestamp) VALUES ('%s','%s',NOW(),'%s','%s',UNIX_TIMESTAMP(NOW()))",$id,$accion,$ip,$descripcion);
|
||||
process_sql ($sql);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Log in a user into Pandora.
|
||||
*
|
||||
|
|
|
@ -44,7 +44,7 @@ function get_agentmodule_sla ($id_agentmodule, $period = 0, $min_value = 1, $max
|
|||
$date = get_system_time ();
|
||||
}
|
||||
|
||||
if (empty ($period)) {
|
||||
if ((empty ($period)) OR ($period == 0)) {
|
||||
global $config;
|
||||
$period = $config["sla_period"];
|
||||
}
|
||||
|
|
|
@ -43,4 +43,6 @@ function get_css_themes () {
|
|||
return $retval;
|
||||
}
|
||||
|
||||
|
||||
|
||||
?>
|
||||
|
|
|
@ -0,0 +1,9 @@
|
|||
<?php
|
||||
/**
|
||||
* @package Include/help/en
|
||||
*/
|
||||
?>
|
||||
<h1>Agent access</h1>
|
||||
|
||||
Agent access graphs render access "contacts" per hour in a graph with a 24hr (daily) scale. This is used to know the contact frecuency of each agent. This could be useful to detect bottlenecks and agent break down. This could be time-consuming and if you're low on resources, this option could be deactivated in main application setup.
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
<?php
|
||||
/**
|
||||
* @package Include/help/en
|
||||
*/
|
||||
?>
|
||||
<h1>Custom logo (Branding)</h1>
|
||||
|
||||
This option is used to display your own logo in the Pandora FMS header. You can use any kind of graphic in PNG format. There is a fixed height/widthfor any image displayed here of 60x139 pixels.
|
||||
<br><br>
|
||||
Upload your custom branding logo, using the file manager to /images/custom_logo directory.
|
||||
|
|
@ -75,7 +75,13 @@ foreach ($modules as $module_id => $module) {
|
|||
$data = array ();
|
||||
$data[0] = print_moduletype_icon ($module["id_tipo_modulo"], true);
|
||||
$data[1] = print_string_substr ($module["nombre"], 25, true);
|
||||
$data[2] = format_numeric (get_agentmodule_sla ($module_id, $config["sla_period"], 1)).'%';
|
||||
if ($module["min_critical"] != 0){
|
||||
$sla_min = $module["min_critical"];
|
||||
$data[2] = format_numeric (get_agentmodule_sla ($module_id, $config["sla_period"], $sla_min));
|
||||
$data[2] = 100 - $data[2]. "%";
|
||||
} else {
|
||||
$data[2] = format_numeric (get_agentmodule_sla ($module_id, $config["sla_period"], 1)).'%';
|
||||
}
|
||||
|
||||
//TODO: Make this work for all new status
|
||||
$status = get_agentmodule_status ($module_id);
|
||||
|
|
|
@ -193,7 +193,7 @@ if (isset($_GET["flag_agent"])){
|
|||
|
||||
echo "<div id='menu_tab_frame_view'>";
|
||||
echo "<div id='menu_tab_left'><ul class='mn'><li class='view'>
|
||||
<a href='index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente=$id_agente'><img src='images/bricks.png' class='top' border=0> ".substr(get_agent_name($id_agente),0,21)."</a>";
|
||||
<a href='index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente=$id_agente'><img src='images/bricks.png' class='top' border=0> ".mb_substr(get_agent_name($id_agente),0,21)."</a>";
|
||||
echo "</li>";
|
||||
echo "</ul></div>";
|
||||
$tab = get_parameter ("tab", "main");
|
||||
|
@ -205,7 +205,7 @@ if (give_acl ($config['id_user'],$id_grupo, "AW")) {
|
|||
echo "<li class='nomn'>";
|
||||
}
|
||||
// Manage agent
|
||||
echo "<a href='index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&id_agente=$id_agente'><img src='images/setup.png' width='16' class='top' border=0> ".__('Manage')." </a>";
|
||||
echo "<a href='index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&id_agente=$id_agente'><img src='images/setup.png' width='16' class='top' border=0 title='".__('Manage')."'> </a>";
|
||||
echo "</li>";
|
||||
}
|
||||
|
||||
|
@ -215,7 +215,7 @@ if ($tab == "main") {
|
|||
} else {
|
||||
echo "<li class='nomn'>";
|
||||
}
|
||||
echo "<a href='index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente=$id_agente'><img src='images/monitor.png' class='top' border=0> ".__('Main')." </a>";
|
||||
echo "<a href='index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente=$id_agente'><img src='images/monitor.png' class='top' border=0 title='".__('Main')."'> </a>";
|
||||
echo "</li>";
|
||||
|
||||
// Data
|
||||
|
@ -224,7 +224,7 @@ if (($tab == "data") OR ($tab == "data_view")) {
|
|||
} else {
|
||||
echo "<li class='nomn'>";
|
||||
}
|
||||
echo "<a href='index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente=$id_agente&tab=data'><img src='images/lightbulb.png' class='top' border=0> ".__('Data')." </a>";
|
||||
echo "<a href='index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente=$id_agente&tab=data'><img src='images/lightbulb.png' class='top' border=0 title='".__('Data')."'> </a>";
|
||||
echo "</li>";
|
||||
|
||||
// Alerts
|
||||
|
@ -233,7 +233,7 @@ if ($tab == "alert") {
|
|||
} else {
|
||||
echo "<li class='nomn'>";
|
||||
}
|
||||
echo "<a href='index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente=$id_agente&tab=alert'><img src='images/bell.png' class='top' border=0> ".__('Alerts')." </a>";
|
||||
echo "<a href='index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente=$id_agente&tab=alert'><img src='images/bell.png' class='top' border=0 title='".__('Alerts')."'> </a>";
|
||||
echo "</li>";
|
||||
|
||||
// Go to SLA view
|
||||
|
@ -242,15 +242,13 @@ if ($tab == "sla") {
|
|||
} else {
|
||||
echo "<li class='nomn'>";
|
||||
}
|
||||
echo "<a href='index.php?sec=estado&sec2=operation/agentes/ver_agente&tab=sla&id_agente=$id_agente'><img src='images/images.png' class='top' border=0> ".__('S.L.A.')." </a>";
|
||||
echo "<a href='index.php?sec=estado&sec2=operation/agentes/ver_agente&tab=sla&id_agente=$id_agente'><img src='images/images.png' class='top' border=0 title='".__('S.L.A.')."'> </a>";
|
||||
echo "</li>";
|
||||
|
||||
// Group tab
|
||||
echo "<li class='nomn'>";
|
||||
echo "<a href='index.php?sec=estado&sec2=operation/agentes/estado_agente&group_id=$id_grupo'>";
|
||||
echo "<img src='images/agents_group.png' class='top' border=0> ";
|
||||
echo __("Group");
|
||||
echo "</a></li>";
|
||||
echo "<img src='images/agents_group.png' class='top' border=0 title='". __("Group"). "'> </a></li>";
|
||||
|
||||
// Inventory
|
||||
enterprise_hook ('inventory_tab');
|
||||
|
|
|
@ -22,8 +22,8 @@ require_once ("include/functions_messages.php");
|
|||
//First Queries - also inits the variables so it can be passed along
|
||||
$dest_user = get_parameter ("dest_user");
|
||||
$dest_group = get_parameter ("dest_group");
|
||||
$subject = urldecode (get_parameter ("subject"));
|
||||
$message = urldecode (get_parameter ("message"));
|
||||
$subject = get_parameter ("subject");
|
||||
$message = get_parameter ("mensaje");
|
||||
|
||||
if (isset ($_POST["delete_message"])) {
|
||||
$id = (int) get_parameter_post ("delete_message");
|
||||
|
@ -116,8 +116,13 @@ if (isset ($_GET["new_msg"])) { //create message
|
|||
<td class="datos2" valign="top"><b>'.$message["subject"].'</b></td></tr>';
|
||||
|
||||
// text
|
||||
|
||||
$order = array("\r\n", "\n", "\r");
|
||||
$replace = '<br />';
|
||||
$parsed_message = str_replace($order, $replace, $message["message"]);
|
||||
|
||||
echo '<tr><td class="datos" valign="top">'.__('Message').':</td>
|
||||
<td class="datos"><pre>'.$message["message"].'</pre></td></tr></table>';
|
||||
<td class="datos">'.$parsed_message.'</td></tr></table>';
|
||||
|
||||
//Prevent RE: RE: RE:
|
||||
if (strstr ($message["subject"], "RE:")) {
|
||||
|
@ -125,7 +130,8 @@ if (isset ($_GET["new_msg"])) { //create message
|
|||
} else {
|
||||
$new_subj = "RE: ".$message["subject"];
|
||||
}
|
||||
|
||||
|
||||
|
||||
//Start the message much like an e-mail reply
|
||||
$new_msg = "\n\n\nOn ".date ($config["date_format"], $message["timestamp"]).' '.get_user_fullname ($message["sender"]).' '.__('wrote').":\n\n".$message["message"];
|
||||
|
||||
|
|