2008-10-22 Evi Vanoost <vanooste@rcbi.rochester.edu>

* operation/snmpconsole/snmp_view.php: Feature request #2166257

        * pandoradb.sql: Feature request #2166257

	* bin/pandora_snmpconsole: Feature request #2166257

git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1189 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
guruevi 2008-10-22 15:05:15 +00:00
parent 33ed2daacb
commit 317e42821b
5 changed files with 55 additions and 4 deletions

View File

@ -14,6 +14,12 @@
godmode/servers/modificar_server.php: Updated translation
infrastructure.
2008-10-22 Evi Vanoost <vanooste@rcbi.rochester.edu>
* operation/snmpconsole/snmp_view.php: Feature request #2166257
* pandoradb.sql: Feature request #2166257
2008-10-22 Evi Vanoost <vanooste@rcbi.rochester.edu>
* operation/snmpconsole/snmp_view.php: Style update and uses new

View File

@ -106,7 +106,9 @@ echo '<img src="images/pixel_green.png" width="20" height="20" /> - '.__('Valida
echo '<br />';
echo '<img src="images/pixel_red.png" width="20" height="20" /> - '.__('Not validated event');
echo '</td><td class="f9" style="padding-left: 30px;">';
echo '<img src="images/pixel_yellow.png" width="20" height="20" /> - '.__('Alert fired');
echo '<img src="images/pixel_yellow.png" width="40" height="20" /> - '.__('Alert fired');
echo '<br />';
echo '<img src="images/pixel_gray.png" width="40" height="20" /> - '.__('Alert not fired');
echo '</td><td class="f9" style="padding-left: 30px;">';
echo '<img src="images/ok.png" /> - '.__('Validate event');
echo '<br />';
@ -128,21 +130,38 @@ $table->class = "databox";
$table->head = array ();
$table->size = array ();
$table->data = array ();
$table->align = array ();
$table->head[0] = __('Status');
$table->align[0] = "center";
$table->head[1] = __('SNMP Agent');
$table->align[1] = "center";
$table->head[2] = __('OID');
$table->align[2] = "center";
$table->head[3] = __('Value');
$table->align[3] = "center";
$table->head[4] = __('Custom');
$table->align[4] = "center";
$table->head[5] = __('User ID');
$table->align[5] = "center";
$table->head[6] = __('Timestamp');
$table->size[6] = 130;
$table->align[6] = "center";
$table->head[7] = __('Alert');
$table->align[7] = "center";
$table->head[8] = __('Action');
$table->align[8] = "center";
$table->head[9] = print_checkbox_extended ("allbox", 1, false, false, "javascript:CheckAll();", 'class="chk" title="'.__('All').'"', true);
$table->align[9] = "center";
// Skip offset records
foreach ($traps as $trap) {
@ -209,9 +228,30 @@ foreach ($traps as $trap) {
//Alert fired
if (!empty ($trap["alerted"])) {
$data[7] = '<img src="images/pixel_yellow.png" width="40" height="18" border="0" title="'.__('Alert fired').'" />';
$idx = count ($table->data);
switch ($trap["priority"]) {
case 0:
$table->rowclass[$idx] = "datos_blue";
break;
case 1:
$table->rowclass[$idx] = "datos_grey";
break;
case 2:
$table->rowclass[$idx] = "datos_green";
break;
case 3:
$table->rowclass[$idx] = "datos_yellow";
break;
case 4:
$table->rowclass[$idx] = "datos_red";
break;
default:
$table->rowclass[$idx] = "datos_grey";
}
$data[7] = '<img src="images/pixel_yellow.png" width="40" height="20" border="0" title="'.__('Alert fired').'" />';
} else {
$data[7] = '--';
$data[7] = '<img src="images/pixel_gray.png" width="40" height="20" border="0" title="'.__('Alert not fired').'" />';
}
//Actions

View File

@ -535,6 +535,7 @@ CREATE TABLE IF NOT EXISTS `ttrap` (
`status` smallint(6) NOT NULL default '0',
`id_usuario` varchar(150) default '',
`timestamp` datetime NOT NULL default '0000-00-00 00:00:00',
`priority` tinyint(4) unsigned NOT NULL default '2',
PRIMARY KEY (`id_trap`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

View File

@ -1,3 +1,7 @@
2008-10-22 Evi Vanoost <vanooste@rcbi.rochester.edu>
* bin/pandora_snmpconsole: Feature request #2166257
2008-10-20 Esteban Sanchez <estebans@artica.es>
* lib/PandoraFMS/DB.pm: Fixed a strange bug that was causing to

View File

@ -289,7 +289,7 @@ sub calcula_alerta_snmp {
# Due DBI doesnt return ID of a new inserted item, we now need to find ourselves
# this is a crap :(
my $query_idag3 = "update ttrap set alerted = 1 where timestamp = '$timestamp' and source = '$trap_agente'";
my $query_idag3 = "update ttrap set alerted = 1, priority = $alert_priority where timestamp = '$timestamp' and source = '$trap_agente'";
$dbh->do($query_idag3);
} else { # Alert is in valid timegap but has too many alerts or too many little