2009-01-12 Esteban Sanchez <estebans@artica.es>
* include/javascript/pandora_alerts.js: Added to repository. Javascript functions for alerts. * pandoradb_data.sql: Added missing field in a talert_commands row. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1333 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
parent
fcdc478bac
commit
bc87b82700
|
@ -1,3 +1,10 @@
|
||||||
|
2009-01-12 Esteban Sanchez <estebans@artica.es>
|
||||||
|
|
||||||
|
* include/javascript/pandora_alerts.js: Added to repository.
|
||||||
|
Javascript functions for alerts.
|
||||||
|
|
||||||
|
* pandoradb_data.sql: Added missing field in a talert_commands row.
|
||||||
|
|
||||||
2009-01-12 Esteban Sanchez <estebans@artica.es>
|
2009-01-12 Esteban Sanchez <estebans@artica.es>
|
||||||
|
|
||||||
* include/functions_alerts.php: Removed debug output. Show no SQL
|
* include/functions_alerts.php: Removed debug output. Show no SQL
|
||||||
|
|
|
@ -0,0 +1,21 @@
|
||||||
|
var original_command = "";
|
||||||
|
|
||||||
|
function parse_alert_command (command) {
|
||||||
|
value = $("#text-field1").attr ("value");
|
||||||
|
re = /_FIELD1_/gi;
|
||||||
|
command = command.replace (re, "\""+value+"\"");
|
||||||
|
|
||||||
|
value = $("#text-field2").attr ("value");
|
||||||
|
re = /_FIELD2_/gi;
|
||||||
|
command = command.replace (re, "\""+value+"\"");
|
||||||
|
|
||||||
|
value = $("#text-field3").attr ("value");
|
||||||
|
re = /_FIELD3_/gi;
|
||||||
|
command = command.replace (re, "\""+value+"\"");
|
||||||
|
|
||||||
|
return command;
|
||||||
|
}
|
||||||
|
|
||||||
|
function render_command_preview () {
|
||||||
|
$("#textarea_command_preview").text (parse_alert_command (original_command));
|
||||||
|
}
|
|
@ -35,7 +35,7 @@ INSERT INTO `talert_commands` VALUES (5,'Pandora FMS Alertlog','echo _timestamp_
|
||||||
INSERT INTO `talert_commands` VALUES (6,'SNMP Trap','/usr/bin/snmptrap -v 1 -c trap_public 192.168.0.4 1.1.1.1.1.1.1.1 _agent_ _field1_','Send a SNMPTRAP to 192.168.0.4. Please review config and adapt to your needs, this is only a sample, not functional itself.', 0);
|
INSERT INTO `talert_commands` VALUES (6,'SNMP Trap','/usr/bin/snmptrap -v 1 -c trap_public 192.168.0.4 1.1.1.1.1.1.1.1 _agent_ _field1_','Send a SNMPTRAP to 192.168.0.4. Please review config and adapt to your needs, this is only a sample, not functional itself.', 0);
|
||||||
INSERT INTO `talert_commands` VALUES (7,'Syslog','logger -p daemon.alert Pandora Alert _agent_ _data_ _field1_ _field2_','Uses field1 and field2 to generate Syslog alert in facility daemon with "alert" level.', 0);
|
INSERT INTO `talert_commands` VALUES (7,'Syslog','logger -p daemon.alert Pandora Alert _agent_ _data_ _field1_ _field2_','Uses field1 and field2 to generate Syslog alert in facility daemon with "alert" level.', 0);
|
||||||
INSERT INTO `talert_commands` VALUES (8,'Sound Alert','/usr/bin/play /usr/share/sounds/alarm.wav','', 0);
|
INSERT INTO `talert_commands` VALUES (8,'Sound Alert','/usr/bin/play /usr/share/sounds/alarm.wav','', 0);
|
||||||
INSERT INTO `talert_commands` VALUES (9,'Jabber Alert','echo _field3_ | sendxmpp -r _field1_ --chatroom _field2_','Send jabber alert to chat room in a predefined server (configure first .sendxmpprc file). Uses field3 as text message, field1 as useralias for source message, and field2 for chatroom name');
|
INSERT INTO `talert_commands` VALUES (9,'Jabber Alert','echo _field3_ | sendxmpp -r _field1_ --chatroom _field2_','Send jabber alert to chat room in a predefined server (configure first .sendxmpprc file). Uses field3 as text message, field1 as useralias for source message, and field2 for chatroom name', 0);
|
||||||
|
|
||||||
|
|
||||||
--
|
--
|
||||||
|
|
Loading…
Reference in New Issue