Merge pull request #255 from ClusterLabs/anvil-tools-dev

* Updated System->check_ram_use() to set the maximum RAM based on the…
main
Digimer 2 years ago committed by GitHub
commit 753ea7518f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 5
      Anvil/Tools.pm
  2. 23
      Anvil/Tools/System.pm
  3. 92
      share/words.xml
  4. 4
      tools/Makefile.am
  5. 924
      tools/anvil-manage-alerts

@ -906,6 +906,11 @@ sub _set_defaults
privacy => {
strong => 0,
},
ram_limits => {
striker => 3221225472, # 3 GiB
node => 1073741824, # 1 GiB
dr => 2147483648, # 2 GiB
},
# On actual RHEL systems, this will be used to ensure that given repos are enabled on given
# machines types. Obviously, this requires that the host has been subscribed.
rhel => {

@ -684,12 +684,33 @@ sub check_ram_use
$anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => $debug, key => "log_0125", variables => { method => "System->check_ram_use()" }});
my $program = defined $parameter->{program} ? $parameter->{program} : "";
my $max_ram = defined $parameter->{max_ram} ? $parameter->{max_ram} : 1073741824;
my $max_ram = defined $parameter->{max_ram} ? $parameter->{max_ram} : 0;
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => $debug, list => {
program => $program,
max_ram => $max_ram,
}});
# If we weren't told what the max RAM is, set it from defaults
if (not $max_ram)
{
my $host_type = $anvil->Get->host_type({debug => $debug});
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => $debug, list => { host_type => $host_type }});
# We'll set '1073741824' (1 GiB) as max default. Then adjust if we have a device type.
$max_ram = 1073741824;
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => $debug, list => {
max_ram => $anvil->Convert->add_commas({number => $max_ram})." (".$anvil->Convert->bytes_to_human_readable({'bytes' => $max_ram}).")",
}});
if (exists $anvil->data->{sys}{ram_limits}{$host_type})
{
$max_ram = $anvil->data->{sys}{ram_limits}{$host_type};
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => $debug, list => {
max_ram => $anvil->Convert->add_commas({number => $max_ram})." (".$anvil->Convert->bytes_to_human_readable({'bytes' => $max_ram}).")",
}});
}
}
# Find the PID(s) of the program.
my $problem = 0;
my $ram_used = 0;

@ -534,18 +534,25 @@ The definition data passed in was:
<key name="error_0377">[ Error ] - The '--type' must be 'host' or 'dr'. Was given: [#!variable!type!#].</key>
<key name="error_0378">[ Error ] - The UUID: [#!variable!uuid!#] is not a valid UUID.</key>
<key name="error_0379">[ Error ] - Neither '--host-ip-address' or '--target' were used to define who we are trying to connect to.</key>
<key name="error_0380">[ Error ] - The UUID: [#!variable!uuid!#] passed in by the switch: [#!variable!switch!#] appears to be invalid.</key>
<key name="error_0381">[ Error ] - The domain or IP: [#!variable!name!#] passed in by the switch: [#!variable!switch!#] appears to be invalid.</key>
<key name="error_0382">[ Error ] - The alert level: [#!variable!level!#] passed in by the switch: [#!variable!switch!#] appears to be invalid. Valid values are '1', '2', '3' or '4'. These represent;
1 = "critical" alerts only
2 = "warning" and critical alerts
3 = "notice", warning and critical alerts
4 = "info"; All alerts. This generates almost constant alerts!
</key>
<key name="error_0383">[ Error ] - The TCP port: [#!variable!port!#] passed in by the switch: [#!variable!switch!#] appears to be invalid. TCP ports must be integers between 1 and 65535.</key>
<key name="error_0380">[ Error ] - The UUID: [#!variable!uuid!#] passed in by the switch: [--#!variable!switch!#] appears to be invalid.</key>
<key name="error_0381">[ Error ] - The domain or IP: [#!variable!name!#] passed in by the switch: [--#!variable!switch!#] appears to be invalid.</key>
<key name="error_0382">[ Error ] - The alert level: [#!variable!level!#] passed in by the switch: [--#!variable!switch!#] appears to be invalid. Valid values are '0', '1', '2', '3' or '4'. These represent;
* 1 = "critical" alerts only
* 2 = "warning" and critical alerts
* 3 = "notice", warning and critical alerts
* 4 = "info"; All alerts. This generates almost constant alerts!</key>
<key name="error_0383">[ Error ] - The TCP port: [#!variable!port!#] passed in by the switch: [--#!variable!switch!#] appears to be invalid. TCP ports must be integers between 1 and 65535.</key>
<key name="error_0384">[ Error ] - The mail server security: [#!variable!security!#] appears to be invalid. Valid options are 'none', 'starttls' or 'tls-ssl'.</key>
<key name="error_0385">[ Error ] - The mail server authentication: [#!variable!auth!#] appears to be invalid. Valid options are 'none', 'plain-text', or 'encrypted'.</key>
<key name="error_0385">[ Error ] - The mail server authentication: [#!variable!auth!#] appears to be invalid. Valid options are:
* none = Normal Password
* encrypted = Encrypted Password
* kerberos = Kerberos GSSAPI
* ntlm = NTLM
* tls = TLS
* oauth2 = oauth2</key>
<key name="error_0386">[ Error ] - The email address: [#!variable!email!#] appears to be invalid.</key>
<key name="error_0387">[ Error ] - The switch: [--#!variable!switch!#] is required, but not provided.</key>
<key name="error_0388">[ Error ] - The mail server UUID: [#!variable!uuid!#] was not found.</key>
<!-- Files templates -->
<!-- NOTE: Translating these files requires an understanding of which lines are translatable -->
@ -2689,6 +2696,71 @@ Available options;
# configuration option. It will be removed in a future release.
# Please consider disabling it now.</key>
<key name="message_0293">Migration Network</key>
<key name="message_0294">Are you sure you want to create the new mail server:
* Address: ...... [#!variable!new_address!#]
* TCP port: ..... [#!variable!new_port!#]
* User name: .... [#!variable!new_username!#]
* Password: ..... [#!variable!new_password!#]
* Authentication: [#!variable!new_authentication!#]
* Security: ..... [#!variable!new_security!#]
* HELO domain: .. [#!variable!new_helo_domain!#]
Proceed? [y/N]
</key>
<key name="message_0295">Are you sure you want to change the mail server thusly:
* Address: ...... [#!variable!old_address!#] -> [#!variable!new_address!#]
* TCP port: ..... [#!variable!old_port!#] -> [#!variable!new_port!#]
* User name: .... [#!variable!old_username!#] -> [#!variable!new_username!#]
* Password: ..... [#!variable!old_password!#] -> [#!variable!new_password!#]
* Authentication: [#!variable!old_authentication!#] -> [#!variable!new_authentication!#]
* Security: ..... [#!variable!old_security!#] -> [#!variable!new_security!#]
* HELO domain: .. [#!variable!old_helo_domain!#] -> [#!variable!new_helo_domain!#]
Proceed? [y/N]
</key>
<key name="message_0296">Are you sure you want to delete the mail server:
* Address: ...... [#!variable!old_address!#]
* TCP port: ..... [#!variable!old_port!#]
* User name: .... [#!variable!old_username!#]
* Password: ..... [#!variable!old_password!#]
* Authentication: [#!variable!old_authentication!#]
* Security: ..... [#!variable!old_security!#]
* HELO domain: .. [#!variable!old_helo_domain!#]
Proceed? [y/N]
</key>
<key name="message_0297">The new mail server was created with the UUID: [#!variable!uuid!#].</key>
<key name="message_0298">The mail server has been updated.</key>
<key name="message_0299">The mail server has been deleted.</key>
<key name="message_0300">Are you sure you want to create the alert recipient:
* Name: ... [#!variable!new_name!#]
* E-Mail: . [#!variable!new_email!#]
* Language: [#!variable!new_language!#]
* Level: .. [#!variable!new_level!#]
Proceed? [y/N]
</key>
<key name="message_0301">Are you sure you want to change the alert recipient thusly:
* Name: ... [#!variable!old_name!#] -> [#!variable!new_name!#]
* E-Mail: . [#!variable!old_email!#] -> [#!variable!new_email!#]
* Language: [#!variable!old_language!#] -> [#!variable!new_language!#]
* Level: .. [#!variable!old_level!#] -> [#!variable!new_level!#]
Proceed? [y/N]
</key>
<key name="message_0302">Are you sure you want to delete the alert recipient:
* Name: ... [#!variable!old_name!#]
* E-Mail: . [#!variable!old_email!#]
* Language: [#!variable!old_language!#]
* Level: .. [#!variable!old_level!#]
Proceed? [y/N]
</key>
<!-- Translate names (protocols, etc) -->
<key name="name_0001">Normal Password</key> <!-- none in mail-server -->
<key name="name_0002">Enctrypted Password</key> <!-- encrypted in mail-server -->
<key name="name_0003">Kerberos GSSAPI</key> <!-- kerberos in mail-server -->
<key name="name_0004">NTLM</key> <!-- ntlm in mail-server -->
<key name="name_0005">TLS Certificate</key> <!-- tls in mail-server -->
<key name="name_0006">OAuth2</key> <!-- oauth2 in mail-server -->
<key name="name_0007">None</key> <!-- none in mail-server -->
<key name="name_0008">STARTTLS</key> <!-- starttls in mail-server -->
<key name="name_0009">TLS/SSL</key> <!-- tls-ssl in mail-server -->
<!-- Success messages shown to the user -->
<key name="ok_0001">Saved the mail server information successfully!</key>

@ -17,6 +17,7 @@ dist_sbin_SCRIPTS = \
anvil-get-server-screenshot \
anvil-join-anvil \
anvil-maintenance-mode \
anvil-manage-alerts \
anvil-manage-dr \
anvil-manage-files \
anvil-manage-firewall \
@ -25,6 +26,7 @@ dist_sbin_SCRIPTS = \
anvil-manage-power \
anvil-manage-server \
anvil-migrate-server \
anvil-network-profiler \
anvil-parse-fence-agents \
anvil-provision-server \
anvil-rename-server \
@ -70,3 +72,5 @@ dist_fence_SCRIPTS = \
sharedir = ${datarootdir}/anvil
dist_share_DATA = striker-auto-initialize-all.example
# -rwxr-xr-x. 1 digimer digimer 34K Feb 1 2020 tool-fio-tester

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save