30 lines
32 KiB
SQL
30 lines
32 KiB
SQL
START TRANSACTION;
|
|
|
|
ALTER TABLE `tmap` ADD COLUMN `refresh_time` INT UNSIGNED NOT NULL DEFAULT 0;
|
|
ALTER TABLE `tplanned_downtime` ADD COLUMN `cron_interval_from` VARCHAR(100) DEFAULT '';
|
|
ALTER TABLE `tplanned_downtime` ADD COLUMN `cron_interval_to` VARCHAR(100) DEFAULT '';
|
|
|
|
ALTER TABLE `tusuario` ADD COLUMN `allowed_ip_active` TINYINT DEFAULT 0;
|
|
ALTER TABLE `tusuario` ADD COLUMN `allowed_ip_list` TEXT;
|
|
|
|
ALTER TABLE `tplugin` ADD COLUMN `no_delete` TINYINT NOT NULL DEFAULT 0;
|
|
|
|
ALTER TABLE `tmodule_group` MODIFY COLUMN `id_mg` SMALLINT UNSIGNED NOT NULL AUTO_INCREMENT;
|
|
|
|
SET @id_config := (SELECT id_config FROM tconfig WHERE `token` = 'metaconsole_node_id' AND `value` IS NOT NULL ORDER BY id_config DESC LIMIT 1);
|
|
DELETE FROM tconfig WHERE `token` = 'metaconsole_node_id' AND (id_config < @id_config OR `value` IS NULL);
|
|
|
|
ALTER TABLE `tpolicies` ADD COLUMN `apply_to_secondary_groups` TINYINT NOT NULL DEFAULT 0;
|
|
|
|
INSERT INTO `talert_commands` (`name`, `command`, `description`, `internal`, `fields_descriptions`, `fields_values`) VALUES ('Send report by e-mail','Internal type','This command allows you to send a report by email.',1,'[\"Report\",\"e-mail address\",\"Subject\",\"Text\",\"Report type\",\"\",\"\",\"\",\"\",\"\"]','[\"_reports_\",\"\",\"\",\"_html_editor_\",\"xml,XML;pdf,PDF;json,JSON;csv,CSV\",\"\",\"\",\"\",\"\",\"\"]');
|
|
SET @send_report_command_id := LAST_INSERT_ID();
|
|
INSERT INTO `talert_actions` (`name`, `id_alert_command`, `field1`, `field2`, `field3`, `field4`, `field5`, `field6`, `field7`, `field8`, `field9`, `field10`, `id_group`, `action_threshold`, `field1_recovery`, `field2_recovery`, `field3_recovery`, `field4_recovery`, `field5_recovery`, `field6_recovery`, `field7_recovery`, `field8_recovery`, `field9_recovery`, `field10_recovery`) VALUES ('Send Report by e-mail',@send_report_command_id,'','yourmail@domain.es','','<div style="background-color: #eaf0f6; font-family: Arial, Helvetica, sans-serif; padding: 30px; margin: 0;"><table style="max-width: 560px; background-color: white; border-radius: 10px; padding: 10px 20px 40px;" cellspacing="0" cellpadding="0" align="center"><thead><tr><td style="padding: 0px 0px 5px;"><a href="https://pandorafms.com/en/" target="_blank"><img src="https://pandorafms.com/wp-content/uploads/2022/03/System-email-Pandora-FMS.png" width="206px"></a></td><td style="padding: 0px 0px 5px;"><p style="text-align: right; color: #223549; font-weight: bold; line-height: 36px; padding: 0px; font-size: 12px;">Automatic alert system</p></td></tr><tr><td style="padding: 0px 0px 5px;" colspan="2"><hr style="border: 1px solid #f5f5f5; width: 100%; margin: 0px;"></td></tr></thead><tbody><tr><td colspan="2"><img onerror="this.style.display=&quot;none&quot;;" src="_statusimage_" style="display: block; margin-left: auto; margin-right: auto; width: 105px; margin-top: 20px; padding: 0px;" width="105px"></td></tr><tr><td colspan="2"><p style="font-size: 24px; text-align: center; color: #223549; padding: 0px 10%; line-height: 34px; margin: 20px 0px;">We have bad news for you, something is on <span style="text-transform: uppercase; font-weight: 800;">_modulestatus_</span> status!</p><div><!--[if mso]><v:rect xmlns:v="urn:schemas-microsoft-com:vml" xmlns:w="urn:schemas-microsoft-com:office:word" href="#" style="height:33px;v-text-anchor:middle;width:100px;" stroke="f" fillcolor="#D84A38"><w:anchorlock/><center><![endif]--><a style="background-color: #223549; border: none; color: white; padding: 15px 30px; text-align: center; text-decoration: none; display: block; font-size: 16px; margin-left: auto; margin-right: auto; border-radius: 100px; max-width: 50%; margin-top: 0px; font-weight: bold;" href="_homeurl_">Go to Pandora FMS Console</a><!--[if mso]></center></v:rect><![endif]--></div></td></tr><tr><td colspan="2"><div style="background-color: #f6f6f6; border-radius: 10px; padding: 10px 20px; margin-top: 40px;"><p style="font-size: 18px; line-height: 30px; color: #223549;">Monitoring details</p><p style="font-size: 15px; color: #333333; font-weight: 800; line-height: 15px;">Data: <span style="font-weight: 400!important;">_data_ <em>(_modulestatus_)</em></span></p><p style="font-size: 15px; color: #333333; font-weight: 800; line-height: 15px;">Agent: <span style="font-weight: 400!important;">_agent_ <em>_address_</em></span></p><p style="font-size: 15px; color: #333333; font-weight: 800; line-height: 15px;">Module: <span style="font-weight: 400!important;">_module_ <em>_moduledescription_</em></span></p><p style="font-size: 15px; color: #333333; font-weight: 800; line-height: 15px;">Timestamp: <span style="font-weight: 400!important;">_timestamp_</span></p></div></td></tr><tr><td style="padding: 20px 0px;" colspan="2"><p style="font-size: 18px; line-height: 30px; color: #223549;">Report details</p><p style="font-size: 15px; color: #333333; font-weight: 800; line-height: 15px;">Generated:&nbsp;<span style="font-weight: 400!important;">_report_generated_date_<em><br></em></span></p><p style="font-size: 15px; color: #333333; font-weight: 800; line-height: 15px;">Report date:&nbsp;<span style="font-weight: 400!important;">_report_date_<em><br></em></span></p><p style="font-size: 15px; color: #333333; font-weight: 800; line-height: 15px;">Description:&nbsp;<span style="font-weight: 400!important;">_report_description_</span></p></td></tr></tbody></table><div style="text-align: center; margin-top: 10px;"><p style="font-size: 12px; text-decoration: none; font-weight: 400; color: #777;"><a style="font-size: 12px; text-decoration: none; font-weight: 400; color: #777;" href="https://pandorafms.com/en/contact/">Contact Us</a>&nbsp;&nbsp;|&nbsp;&nbsp;<a style="font-size: 12px; text-decoration: none; font-weight: 400; color: #777;" href="https://pandorafms.com/community/forums/forum/english/">Support</a>&nbsp;&nbsp;|&nbsp;&nbsp;<a style="font-size: 12px; text-decoration: none; font-weight: 400; color: #777;" href="https://pandorafms.com/manual/en/start">Docs</a></p></div></div>','','','','','','',0,0,'','','','<div style="background-color: #eaf0f6; font-family: Arial, Helvetica, sans-serif; padding: 30px; margin: 0;">
<table style="max-width: 560px; background-color: white; border-radius: 10px; padding: 10px 20px 40px;" cellspacing="0" cellpadding="0" align="center">
<thead>
<tr>
<td style="padding: 0px 0px 5px;"><a href="https://pandorafms.com/en/" target="_blank"><img src="https://pandorafms.com/wp-content/uploads/2022/03/System-email-Pandora-FMS.png" width="206px"></a></td>
<td style="padding: 0px 0px 5px;">
<p style="text-align: right; color: #223549; font-weight: bold; line-height: 36px; padding: 0px; font-size: 12px;">Automatic alert system</p>
</td>
</tr>
<tr>
<td style="padding: 0px 0px 5px;" colspan="2"><hr style="border: 1px solid #f5f5f5; width: 100%; margin: 0px;"></td>
</tr>
</thead>
<tbody>
<tr>
<td colspan="2"><img src="https://pandorafms.com/wp-content/uploads/2022/03/System-email-Good-news.png" style="display: block; margin-left: auto; margin-right: auto; width: 105px; margin-top: 20px; padding: 0px;" width="105px"></td>
</tr>
<tr>
<td colspan="2">
<p style="font-size: 24px; text-align: center; color: #223549; padding: 0px 10%; line-height: 34px; margin: 20px 0px;">We have good news for you, alert has been <span style="text-transform: uppercase; font-weight: 800;">recovered</span></p>
<div><!--[if mso]><v:rect xmlns:v="urn:schemas-microsoft-com:vml" xmlns:w="urn:schemas-microsoft-com:office:word" href="#" style="height:33px;v-text-anchor:middle;width:100px;" stroke="f" fillcolor="#D84A38"><w:anchorlock/><center><![endif]--><a style="background-color: #223549; border: none; color: white; padding: 15px 30px; text-align: center; text-decoration: none; display: block; font-size: 16px; margin-left: auto; margin-right: auto; border-radius: 100px; max-width: 50%; margin-top: 0px; font-weight: bold;" href="_homeurl_">Go to Pandora FMS Console</a><!--[if mso]></center></v:rect><![endif]--></div>
</td>
</tr>
<tr>
<td colspan="2">
<div style="background-color: #f6f6f6; border-radius: 10px; padding: 10px 20px; margin-top: 40px;">
<p style="font-size: 18px; line-height: 30px; color: #223549;">Monitoring details</p>
<p style="font-size: 15px; color: #333333; font-weight: 800; line-height: 15px;">Data: <span style="font-weight: 400!important;">_data_ <em>(_modulestatus_)</em></span></p>
<p style="font-size: 15px; color: #333333; font-weight: 800; line-height: 15px;">Agent: <span style="font-weight: 400!important;">_agent_ <em>_address_</em></span></p>
<p style="font-size: 15px; color: #333333; font-weight: 800; line-height: 15px;">Module: <span style="font-weight: 400!important;">_module_ <em>_moduledescription_</em></span></p>
<p style="font-size: 15px; color: #333333; font-weight: 800; line-height: 15px;">Timestamp: <span style="font-weight: 400!important;">_timestamp_</span></p>
</div>
</td>
</tr>
<tr>
<td style="padding: 20px 0px;" colspan="2">
<p style="font-size: 18px; line-height: 30px; color: #223549;">Report details</p>
<p style="font-size: 15px; color: #333333; font-weight: 800; line-height: 15px;">Generated:&nbsp;<span style="font-weight: 400!important;">_report_generated_date_<em><br></em></span></p>
<p style="font-size: 15px; color: #333333; font-weight: 800; line-height: 15px;">Report date:&nbsp;<span style="font-weight: 400!important;">_report_date_<em><br></em></span></p>
<p style="font-size: 15px; color: #333333; font-weight: 800; line-height: 15px;">Description:&nbsp;<span style="font-weight: 400!important;">_report_description_</span></p>
</td>
</tr>
</tbody>
</table>
<div style="text-align: center; margin-top: 10px;">
<p style="font-size: 12px; text-decoration: none; font-weight: 400; color: #777;"><a style="font-size: 12px; text-decoration: none; font-weight: 400; color: #777;" href="https://pandorafms.com/en/contact/">Contact Us</a>&nbsp;&nbsp;|&nbsp;&nbsp;<a style="font-size: 12px; text-decoration: none; font-weight: 400; color: #777;" href="https://pandorafms.com/community/forums/forum/english/">Support</a>&nbsp;&nbsp;|&nbsp;&nbsp;<a style="font-size: 12px; text-decoration: none; font-weight: 400; color: #777;" href="https://pandorafms.com/manual/en/start">Docs</a></p>
</div>
</div>','','','','','','');
|
|
|
|
INSERT INTO `talert_commands` (`name`, `command`, `description`, `internal`, `fields_descriptions`, `fields_values`) VALUES ('Send report by e-mail (from template)','Internal type','This command allows you to send a report generated from a template by email.',1,'[\"Template\",\"Regexp agent filter\",\"e-mail address\",\"Subject\",\"Text\",\"Report type\",\"\",\"\",\"\",\"\"]','[\"_report_templates_\",\"\",\"\",\"\",\"_html_editor_\",\"xml,XML;pdf,PDF;json,JSON;csv,CSV\",\"\",\"\",\"\",\"\"]');
|
|
SET @send_report_by_temp_command_id := LAST_INSERT_ID();
|
|
INSERT INTO `talert_actions` (`name`, `id_alert_command`, `field1`, `field2`, `field3`, `field4`, `field5`, `field6`, `field7`, `field8`, `field9`, `field10`, `id_group`, `action_threshold`, `field1_recovery`, `field2_recovery`, `field3_recovery`, `field4_recovery`, `field5_recovery`, `field6_recovery`, `field7_recovery`, `field8_recovery`, `field9_recovery`, `field10_recovery`) VALUES ('Send Report by e-mail (from template)',@send_report_by_temp_command_id,'','','yourmail@domain.es','','<div style="background-color: #eaf0f6; font-family: Arial, Helvetica, sans-serif; padding: 30px; margin: 0;"><table style="max-width: 560px; background-color: white; border-radius: 10px; padding: 10px 20px 40px;" cellspacing="0" cellpadding="0" align="center"><thead><tr><td style="padding: 0px 0px 5px;"><a href="https://pandorafms.com/en/" target="_blank"><img src="https://pandorafms.com/wp-content/uploads/2022/03/System-email-Pandora-FMS.png" width="206px"></a></td><td style="padding: 0px 0px 5px;"><p style="text-align: right; color: #223549; font-weight: bold; line-height: 36px; padding: 0px; font-size: 12px;">Automatic alert system</p></td></tr><tr><td style="padding: 0px 0px 5px;" colspan="2"><hr style="border: 1px solid #f5f5f5; width: 100%; margin: 0px;"></td></tr></thead><tbody><tr><td colspan="2"><img onerror="this.style.display=&quot;none&quot;;" src="_statusimage_" style="display: block; margin-left: auto; margin-right: auto; width: 105px; margin-top: 20px; padding: 0px;" width="105px"></td></tr><tr><td colspan="2"><p style="font-size: 24px; text-align: center; color: #223549; padding: 0px 10%; line-height: 34px; margin: 20px 0px;">We have bad news for you, something is on <span style="text-transform: uppercase; font-weight: 800;">_modulestatus_</span> status!</p><div><!--[if mso]><v:rect xmlns:v="urn:schemas-microsoft-com:vml" xmlns:w="urn:schemas-microsoft-com:office:word" href="#" style="height:33px;v-text-anchor:middle;width:100px;" stroke="f" fillcolor="#D84A38"><w:anchorlock/><center><![endif]--><a style="background-color: #223549; border: none; color: white; padding: 15px 30px; text-align: center; text-decoration: none; display: block; font-size: 16px; margin-left: auto; margin-right: auto; border-radius: 100px; max-width: 50%; margin-top: 0px; font-weight: bold;" href="_homeurl_">Go to Pandora FMS Console</a><!--[if mso]></center></v:rect><![endif]--></div></td></tr><tr><td colspan="2"><div style="background-color: #f6f6f6; border-radius: 10px; padding: 10px 20px; margin-top: 40px;"><p style="font-size: 18px; line-height: 30px; color: #223549;">Monitoring details</p><p style="font-size: 15px; color: #333333; font-weight: 800; line-height: 15px;">Data: <span style="font-weight: 400!important;">_data_ <em>(_modulestatus_)</em></span></p><p style="font-size: 15px; color: #333333; font-weight: 800; line-height: 15px;">Agent: <span style="font-weight: 400!important;">_agent_ <em>_address_</em></span></p><p style="font-size: 15px; color: #333333; font-weight: 800; line-height: 15px;">Module: <span style="font-weight: 400!important;">_module_ <em>_moduledescription_</em></span></p><p style="font-size: 15px; color: #333333; font-weight: 800; line-height: 15px;">Timestamp: <span style="font-weight: 400!important;">_timestamp_</span></p></div></td></tr><tr><td style="padding: 20px 0px;" colspan="2"><p style="font-size: 18px; line-height: 30px; color: #223549;">Report details</p><p style="font-size: 15px; color: #333333; font-weight: 800; line-height: 15px;">Generated:&nbsp;<span style="font-weight: 400!important;">_report_generated_date_<em><br></em></span></p><p style="font-size: 15px; color: #333333; font-weight: 800; line-height: 15px;">Report date:&nbsp;<span style="font-weight: 400!important;">_report_date_<em><br></em></span></p><p style="font-size: 15px; color: #333333; font-weight: 800; line-height: 15px;">Description:&nbsp;<span style="font-weight: 400!important;">_report_description_</span></p></td></tr></tbody></table><div style="text-align: center; margin-top: 10px;"><p style="font-size: 12px; text-decoration: none; font-weight: 400; color: #777;"><a style="font-size: 12px; text-decoration: none; font-weight: 400; color: #777;" href="https://pandorafms.com/en/contact/">Contact Us</a>&nbsp;&nbsp;|&nbsp;&nbsp;<a style="font-size: 12px; text-decoration: none; font-weight: 400; color: #777;" href="https://pandorafms.com/community/forums/forum/english/">Support</a>&nbsp;&nbsp;|&nbsp;&nbsp;<a style="font-size: 12px; text-decoration: none; font-weight: 400; color: #777;" href="https://pandorafms.com/manual/en/start">Docs</a></p></div></div>','','','','','',0,0,'','','','','<div style="background-color: #eaf0f6; font-family: Arial, Helvetica, sans-serif; padding: 30px; margin: 0;">
<table style="max-width: 560px; background-color: white; border-radius: 10px; padding: 10px 20px 40px;" cellspacing="0" cellpadding="0" align="center">
<thead>
<tr>
<td style="padding: 0px 0px 5px;"><a href="https://pandorafms.com/en/" target="_blank"><img src="https://pandorafms.com/wp-content/uploads/2022/03/System-email-Pandora-FMS.png" width="206px"></a></td>
<td style="padding: 0px 0px 5px;">
<p style="text-align: right; color: #223549; font-weight: bold; line-height: 36px; padding: 0px; font-size: 12px;">Automatic alert system</p>
</td>
</tr>
<tr>
<td style="padding: 0px 0px 5px;" colspan="2"><hr style="border: 1px solid #f5f5f5; width: 100%; margin: 0px;"></td>
</tr>
</thead>
<tbody>
<tr>
<td colspan="2"><img src="https://pandorafms.com/wp-content/uploads/2022/03/System-email-Good-news.png" style="display: block; margin-left: auto; margin-right: auto; width: 105px; margin-top: 20px; padding: 0px;" width="105px"></td>
</tr>
<tr>
<td colspan="2">
<p style="font-size: 24px; text-align: center; color: #223549; padding: 0px 10%; line-height: 34px; margin: 20px 0px;">We have good news for you, alert has been <span style="text-transform: uppercase; font-weight: 800;">recovered</span></p>
<div><!--[if mso]><v:rect xmlns:v="urn:schemas-microsoft-com:vml" xmlns:w="urn:schemas-microsoft-com:office:word" href="#" style="height:33px;v-text-anchor:middle;width:100px;" stroke="f" fillcolor="#D84A38"><w:anchorlock/><center><![endif]--><a style="background-color: #223549; border: none; color: white; padding: 15px 30px; text-align: center; text-decoration: none; display: block; font-size: 16px; margin-left: auto; margin-right: auto; border-radius: 100px; max-width: 50%; margin-top: 0px; font-weight: bold;" href="_homeurl_">Go to Pandora FMS Console</a><!--[if mso]></center></v:rect><![endif]--></div>
</td>
</tr>
<tr>
<td colspan="2">
<div style="background-color: #f6f6f6; border-radius: 10px; padding: 10px 20px; margin-top: 40px;">
<p style="font-size: 18px; line-height: 30px; color: #223549;">Monitoring details</p>
<p style="font-size: 15px; color: #333333; font-weight: 800; line-height: 15px;">Data: <span style="font-weight: 400!important;">_data_ <em>(_modulestatus_)</em></span></p>
<p style="font-size: 15px; color: #333333; font-weight: 800; line-height: 15px;">Agent: <span style="font-weight: 400!important;">_agent_ <em>_address_</em></span></p>
<p style="font-size: 15px; color: #333333; font-weight: 800; line-height: 15px;">Module: <span style="font-weight: 400!important;">_module_ <em>_moduledescription_</em></span></p>
<p style="font-size: 15px; color: #333333; font-weight: 800; line-height: 15px;">Timestamp: <span style="font-weight: 400!important;">_timestamp_</span></p>
</div>
</td>
</tr>
<tr>
<td style="padding: 20px 0px;" colspan="2">
<p style="font-size: 18px; line-height: 30px; color: #223549;">Report details</p>
<p style="font-size: 15px; color: #333333; font-weight: 800; line-height: 15px;">Generated:&nbsp;<span style="font-weight: 400!important;">_report_generated_date_<em><br></em></span></p>
<p style="font-size: 15px; color: #333333; font-weight: 800; line-height: 15px;">Report date:&nbsp;<span style="font-weight: 400!important;">_report_date_<em><br></em></span></p>
<p style="font-size: 15px; color: #333333; font-weight: 800; line-height: 15px;">Description:&nbsp;<span style="font-weight: 400!important;">_report_description_</span></p>
</td>
</tr>
</tbody>
</table>
<div style="text-align: center; margin-top: 10px;">
<p style="font-size: 12px; text-decoration: none; font-weight: 400; color: #777;"><a style="font-size: 12px; text-decoration: none; font-weight: 400; color: #777;" href="https://pandorafms.com/en/contact/">Contact Us</a>&nbsp;&nbsp;|&nbsp;&nbsp;<a style="font-size: 12px; text-decoration: none; font-weight: 400; color: #777;" href="https://pandorafms.com/community/forums/forum/english/">Support</a>&nbsp;&nbsp;|&nbsp;&nbsp;<a style="font-size: 12px; text-decoration: none; font-weight: 400; color: #777;" href="https://pandorafms.com/manual/en/start">Docs</a></p>
</div>
</div>','','','','','');
|
|
|
|
UPDATE `tplugin` set `no_delete` = 1 WHERE `name` IN ('IPMI Plugin', 'DNS Plugin', 'UDP port check', 'SMTP Check', 'MySQL Plugin', 'SNMP remote', 'Packet Loss', 'Wizard SNMP module', 'Wizard SNMP process', 'Wizard WMI module', 'Network bandwidth SNMP');
|
|
|
|
COMMIT;
|