* Started work on Striker's notification recipient management page. Cleaned up the variable names in the mail_server management function.
* Added recipients -> recipient_units column to the sql schema.
Signed-off-by: Digimer <digimer@alteeve.ca>
ThisreturnsthedatabaseUUID(usuallythehost's UUID) from C<< anvil.conf >> based on matching the C<< database::<uuid>::host >> to the local machine'shostnameoroneoftheactiveIPaddressesonthehost.
my $mail_server_uuid = defined $anvil->data->{cgi}{mail_server_uuid}{value} ? $anvil->data->{cgi}{mail_server_uuid}{value} : "";
my $say_outgoing_mail_server = defined $anvil->data->{cgi}{outgoing_mail_server}{value} ? $anvil->data->{cgi}{outgoing_mail_server}{value} : "";
my $say_login_name = defined $anvil->data->{cgi}{login_name}{value} ? $anvil->data->{cgi}{login_name}{value} : "";
my $say_login_password = defined $anvil->data->{cgi}{login_password}{value} ? $anvil->data->{cgi}{login_password}{value} : "";
my $say_connection_security = defined $anvil->data->{cgi}{connection_security}{value} ? $anvil->data->{cgi}{connection_security}{value} : "ifn_link1";
my $say_authentication_method = defined $anvil->data->{cgi}{authentication_method}{value} ? $anvil->data->{cgi}{authentication_method}{value} : "normal_password";
my $say_port = defined $anvil->data->{cgi}{port}{value} ? $anvil->data->{cgi}{port}{value} : "143";
my $say_helo_domain = defined $anvil->data->{cgi}{helo_domain}{value} ? $anvil->data->{cgi}{helo_domain}{value} : "";
my $say_back = defined $anvil->data->{cgi}{back}{value} ? $anvil->data->{cgi}{back}{value} : "";
my $say_save = defined $anvil->data->{cgi}{save}{value} ? $anvil->data->{cgi}{save}{value} : "";
my $say_delete = defined $anvil->data->{cgi}{'delete'}{value} ? $anvil->data->{cgi}{'delete'}{value} : "";
my $say_confirm = defined $anvil->data->{cgi}{confirm}{value} ? $anvil->data->{cgi}{confirm}{value} : "";
my $mail_server_uuid = defined $anvil->data->{cgi}{mail_server_uuid}{value} ? $anvil->data->{cgi}{mail_server_uuid}{value} : "";
my $outgoing_mail_server = defined $anvil->data->{cgi}{outgoing_mail_server}{value} ? $anvil->data->{cgi}{outgoing_mail_server}{value} : "";
my $login_name = defined $anvil->data->{cgi}{login_name}{value} ? $anvil->data->{cgi}{login_name}{value} : "";
my $login_password = defined $anvil->data->{cgi}{login_password}{value} ? $anvil->data->{cgi}{login_password}{value} : "";
my $connection_security = defined $anvil->data->{cgi}{connection_security}{value} ? $anvil->data->{cgi}{connection_security}{value} : "ifn_link1";
my $authentication_method = defined $anvil->data->{cgi}{authentication_method}{value} ? $anvil->data->{cgi}{authentication_method}{value} : "normal_password";
my $port = defined $anvil->data->{cgi}{port}{value} ? $anvil->data->{cgi}{port}{value} : "143";
my $helo_domain = defined $anvil->data->{cgi}{helo_domain}{value} ? $anvil->data->{cgi}{helo_domain}{value} : "";
my $back = defined $anvil->data->{cgi}{back}{value} ? $anvil->data->{cgi}{back}{value} : "";
my $save = defined $anvil->data->{cgi}{save}{value} ? $anvil->data->{cgi}{save}{value} : "";
my $delete = defined $anvil->data->{cgi}{'delete'}{value} ? $anvil->data->{cgi}{'delete'}{value} : "";
my $confirm = defined $anvil->data->{cgi}{confirm}{value} ? $anvil->data->{cgi}{confirm}{value} : "";
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => {
anvil_descriptiontextnotnull,-- This is a short, one-line (usually) description of this particular Anvil!. It is displayed in the Anvil! selection list.
anvil_passwordtextnotnull,-- This is the 'ricci' or 'hacluster' user password. It is also used to access nodes that don't have a specific password set.
anvil_passwordtextnotnull,-- This is the 'hacluster' user password. It is also used to access nodes that don't have a specific password set.
modified_datetimestampwithtimezonenotnull
);
ALTERTABLEanvilsOWNERTOadmin;
@ -446,8 +446,9 @@ CREATE TABLE recipients (
recipient_uuiduuidnotnullprimarykey,
recipient_nametextnotnull,-- This is the recipient's name
recipient_emailtextnotnull,-- This is the recipient's email address or the file name, depending.
recipient_languagetext,-- If set, this is the language the user wants to receive alerts in. If not set, the default language is used.
recipient_new_levelintegernotnull,-- This is the alert level to use when automatically adding watch links to new systems. '0' tells us to ignore new systems.
recipient_languagetextnotnull,-- If set, this is the language the user wants to receive alerts in. If not set, the default language is used.
recipient_unitstextnotnull,-- This can be set to 'imperial' if the user prefers temperatures in °F
recipient_new_levelintegernotnull,-- This is the alert level to use when automatically adding watch links to new systems. '0' tells us to ignore new systems, 1 is critical, 2 is warning, and 3 is notice
@ -260,6 +260,7 @@ About to try to download aproximately: [#!variable!packages!#] packages needed t
<keyname="message_0153">Local repository</key>
<keyname="message_0154">Mail Server Configuration</key>
<keyname="message_0155">When alert emails are sent, they are stored locally and then forwarded to a mail server. This is where you can configure the mail server that alerts are forwarded to for delivery to recipients.</key>
@ -1194,6 +1195,7 @@ Failure! The return code: [#!variable!return_code!#] was received ('0' was expec
<!-- Success messages shown to the user -->
<keyname="ok_0001">Saved the mail server information successfully!</key>
<keyname="ok_0002">The mail server: [#!variable!mail_server!#] has been deleted.</key>
<keyname="ok_0003">The alert recipient: [#!variable!recipient_email!#] has been deleted.</key>
<!-- Warnings -->
<keyname="warning_0001">The IP address will change. You will need to reconnect after applying these changes.</key>
@ -1345,6 +1347,7 @@ Failed to generate an RSA public key for the user: [#!variable!user!#]. The outp
<keyname="error_0105">The file: [#!variable!file!#] was not found.</key>
<keyname="error_0106"><![CDATA[The method Network->find_matches() was given the hash key: [#!variable!key!#], but it does not reference a hash. Are any IPs associated with this target?]]></key>
<keyname="error_0107">Failed to reconnect after reconfiguring the network, exiting.</key>
<keyname="error_0108">The 'recipient_new_level': [#!variable!recipient_new_level!#] is invalid. It should be '0', '1', '2', or '3'.</key>
<!-- These are units, words and so on used when displaying information. -->
@ -66,3 +66,21 @@ see 'words.xml' for more information on how this file is structured.
NOTE: This file MUST be the same as the agent itself, with the file extension '.xml'.
NOTE: To avoid namespace collisions, it is STRONGLY recommended that all string keys start with your agent
name! Ie: 'scan_network_X'.
== Alert Levels ==
NOTE: Alert levels are separate from log levels!
Alerts trigger emails to recipients who are interested in monitoring a system. Alerts levels indicate severity and are set as one of three numeric valus;
* 1 (critical)
Critical alerts. These are alerts that almost certainly indicate an issue with the system that has are likely will cause a service interruption. (ie: node was fenced, emergency shut down, etc)
* 2 (warning)
Warning alerts. These are alerts that likely require the attention of an administrator, but have not caused a service interruption. (ie: power loss/load shed, over/under voltage, fan failure, network link failure, etc)
* 3 (notice)
Notice alerts. These are generally low priority alerts that do not need attention, but might be indicators of developing problems. (ie: UPSes transfering to batteries, server migration/shut down/boot up, etc)