diff --git a/Anvil/Tools/Cluster.pm b/Anvil/Tools/Cluster.pm index d17c03fc..c3e6d586 100644 --- a/Anvil/Tools/Cluster.pm +++ b/Anvil/Tools/Cluster.pm @@ -353,6 +353,10 @@ sub add_server return_code => $return_code, }}); + # Log the contents of the PCS file + my $pcs_body = $anvil->Storage->read_file({debug => $debug, file => $pcs_file}); + $anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => $debug, list => { pcs_body => $pcs_body }}); + # Commit my $commit_command = $anvil->data->{path}{exe}{pcs}." cluster cib-push ".$pcs_file; $anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => $debug, list => { commit_command => $commit_command }}); @@ -1090,7 +1094,6 @@ sub check_stonith_config $check_ipmi_config = 0; $anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => $debug, list => { check_ipmi_config => $check_ipmi_config }}); } - } if ($check_ipmi_config) { @@ -4192,7 +4195,84 @@ sub parse_crm_mon $anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => $debug, list => { problem => $problem }}); foreach my $resource ($dom->findnodes('/pacemaker-result/resources/resource')) { - if ($resource->{resource_agent} eq "ocf::alteeve:server") + $anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => $debug, list => { resource => $resource }}); + if ($resource =~ /Log->variables({source => $THIS_FILE, line => __LINE__, level => $debug, list => { line => $line }}); + if (($line !~ /Log->variables({source => $THIS_FILE, line => __LINE__, level => $debug, list => { id => $id }}); + } + if ($line =~ /resource_agent="(.*?)"/) + { + $resource_agent = $1; + $anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => $debug, list => { resource_agent => $resource_agent }}); + + if ($resource_agent eq "ocf:alteeve:server") + { + $resource_key = "resource"; + $anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => $debug, list => { resource_key => $resource_key }}); + } + elsif ($resource_agent =~ /stonith:(.*)$/) + { + $stonith_name = $1; + $resource_key = "stonith"; + $anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => $debug, list => { + stonith_name => $stonith_name, + resource_key => $resource_key, + }}); + $anvil->data->{crm_mon}{parsed}{'pacemaker-result'}{resources}{$resource_key}{$id}{variables}{resource_agent} = $stonith_name; + $anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => $debug, list => { + "crm_mon::parsed::pacemaker-result::resources::${resource_key}::${id}::variables::resource_agent" => $anvil->data->{crm_mon}{parsed}{'pacemaker-result'}{resources}{$resource_key}{$id}{variables}{resource_agent}, + }}); + } + } + if (($id) && ($resource_agent)) + { + if ($line =~ /data->{crm_mon}{parsed}{'pacemaker-result'}{resources}{$resource_key}{$id}{host}{node_name} = ($line =~ /name="(.*?)"/)[0]; + $anvil->data->{crm_mon}{parsed}{'pacemaker-result'}{resources}{$resource_key}{$id}{host}{node_id} = ($line =~ /id="(.*?)"/)[0]; + $anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => $debug, list => { + "crm_mon::parsed::pacemaker-result::resources::${resource_key}::${id}::host::node_name" => $anvil->data->{crm_mon}{parsed}{'pacemaker-result'}{resources}{$resource_key}{$id}{host}{node_name}, + "crm_mon::parsed::pacemaker-result::resources::${resource_key}::${id}::host::node_id" => $anvil->data->{crm_mon}{parsed}{'pacemaker-result'}{resources}{$resource_key}{$id}{host}{node_id}, + }}); + } + else + { + foreach my $pair (split/ /, $line) + { + $anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => $debug, list => { pair => $pair }}); + if ($pair =~ /^(.*?)="(.*)"$/) + { + my $variable = $1; + my $value = $2; + $anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => $debug, list => { + 's1:variable' => $variable, + 's2:value' => $value, + }}); + next if $variable eq "id"; + next if $variable eq "resource_agent"; + + $anvil->data->{crm_mon}{parsed}{'pacemaker-result'}{resources}{$resource_key}{$id}{variables}{$variable} = $value; + $anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => $debug, list => { + "crm_mon::parsed::pacemaker-result::resources::${resource_key}::${id}::variables::${variable}" => $anvil->data->{crm_mon}{parsed}{'pacemaker-result'}{resources}{$resource_key}{$id}{variables}{$variable}, + }}); + } + } + } + } + } + } + elsif ($resource->{resource_agent} eq "ocf::alteeve:server") { my $id = $resource->{id}; $anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => $debug, list => { id => $id }}); @@ -4208,7 +4288,6 @@ sub parse_crm_mon { my $node_id = $node->{id}; my $node_name = $node->{name}; - my $cached = $node->{cached}; $anvil->data->{crm_mon}{parsed}{'pacemaker-result'}{resources}{resource}{$id}{host}{node_name} = $node->{name}; $anvil->data->{crm_mon}{parsed}{'pacemaker-result'}{resources}{resource}{$id}{host}{node_id} = $node->{id}; $anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => $debug, list => { @@ -4217,7 +4296,7 @@ sub parse_crm_mon }}); } } - if ($resource->{resource_agent} =~ /stonith:(.*)$/) + elsif ($resource->{resource_agent} =~ /stonith:(.*)$/) { my $fence_agent = $1; my $id = $resource->{id}; @@ -4237,7 +4316,6 @@ sub parse_crm_mon { my $node_id = $node->{id}; my $node_name = $node->{name}; - my $cached = $node->{cached}; $anvil->data->{crm_mon}{parsed}{'pacemaker-result'}{resources}{stonith}{$id}{host}{node_name} = $node->{name}; $anvil->data->{crm_mon}{parsed}{'pacemaker-result'}{resources}{stonith}{$id}{host}{node_id} = $node->{id}; $anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => $debug, list => { diff --git a/Anvil/Tools/Database.pm b/Anvil/Tools/Database.pm index 51e2b78d..0c206ec1 100644 --- a/Anvil/Tools/Database.pm +++ b/Anvil/Tools/Database.pm @@ -14043,7 +14043,7 @@ sub insert_or_update_states } foreach my $db_uuid (@{$db_uuids}) { - my $count = $anvil->Database->query({uuid => $db_uuid, query => $query, source => $THIS_FILE, line => __LINE__})->[0]->[0]; + my $count = $anvil->Database->query({debug => $debug, uuid => $db_uuid, query => $query, source => $THIS_FILE, line => __LINE__})->[0]->[0]; $anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => $debug, list => { 's2:db_uuid' => $db_uuid, 's2:count' => $count, diff --git a/Anvil/Tools/System.pm b/Anvil/Tools/System.pm index f7fe40f3..2942dfa6 100644 --- a/Anvil/Tools/System.pm +++ b/Anvil/Tools/System.pm @@ -2565,16 +2565,16 @@ LIMIT 1 }}); # See if the current password works. - my $lanplus = "no-yes"; - if (($manufacturer eq "HP") or ($manufacturer eq "Dell")) + my $lanplus = "yes-no"; + if ($manufacturer eq "Fujitsu") { - # These need LAN Plus - $lanplus = "yes-no" + # Fujitsu doesn't usually need lanplus + $lanplus = "no-yes" } $host_ipmi = $anvil->System->test_ipmi({ debug => $debug, ipmi_user => $user_name, - ipmi_password => $ipmi_password, + ipmi_password => $anvil->Log->is_secure($ipmi_password), ipmi_target => $ipmi_ip_address, lanplus => $lanplus, }); @@ -5000,7 +5000,7 @@ sub test_ipmi ($output, my $error, $return_code) = $anvil->Remote->call({ debug => $debug, secure => 1, - timeout => 2, + timeout => 20, shell_call => $shell_call, target => $target, password => $password, diff --git a/scancore-agents/scan-network/scan-network b/scancore-agents/scan-network/scan-network index 21c497d4..8f0cb45e 100755 --- a/scancore-agents/scan-network/scan-network +++ b/scancore-agents/scan-network/scan-network @@ -2553,6 +2553,9 @@ sub check_interfaces new_rx_bytes => $new_rx_bytes, }}); + # This is likely an unused interface, like a wireless adapter. + next if not $new_nm_name; + # Find the bridge, if any, and the bond UUID, if there's a bond name. if ($new_bond_name) { diff --git a/share/words.xml b/share/words.xml index aac5721a..4fcaf6b7 100644 --- a/share/words.xml +++ b/share/words.xml @@ -203,8 +203,8 @@ The error was: Failed to start the daemon: [#!variable!daemon!#] on the local system, unable to boot the server. Failed to start the daemon: [#!variable!daemon!#] on [#!variable!host!#], unable to boot the server. System->test_ipmi() was called with an invalid 'lanplus' parameter. It must be 'yes', 'no', 'yes-no' or 'no-yes'. Received: [#!variable!lanplus!#]. - All attempts to change the IPMI user: [#!variable!user_name!#] (number: [#!variable!user_number!#] failed. The last try's output (if any) was: [#!variable!output!#] (return code: [#!variable!return code!#]). - The system call: [#!variable!shell_call!#] failed with the return code: [#!variable!return code!#]. The output (if any) was; + All attempts to change the IPMI user: [#!variable!user_name!#] (number: [#!variable!user_number!#] failed. The last try's output (if any) was: [#!variable!output!#] (return code: [#!variable!return_code!#]). + The system call: [#!variable!shell_call!#] failed with the return code: [#!variable!return_code!#]. The output (if any) was; ==== #!variable!output!# ==== @@ -4191,6 +4191,7 @@ We will try to proceed anyway. [ Warning ] - The daemon: [#!variable!daemon!#] appears to have failed! Attempting to restart it now. [ Warning ] - The line: [#!variable!line!#] that was going to be added to the hosts file is invalid, removing it. [ Warning ] - Failed to convert: [#!variable!source_file!#] to: [#!variable!new_file!#] (format: [#!variable!format!#]! Return code was: [#!variable!return_code!#], expected '0'. + [ Warning ] - The fence method: [#!variable!method!#] already existed, proceeding. diff --git a/tools/anvil-join-anvil b/tools/anvil-join-anvil index 98a2a1d8..e44a6c2d 100755 --- a/tools/anvil-join-anvil +++ b/tools/anvil-join-anvil @@ -989,7 +989,7 @@ sub configure_pacemaker pcs_add_command => $pcs_add_command =~ /passw/ ? $anvil->Log->is_secure($pcs_add_command) : $pcs_add_command, }}); - # If there's an entry in the CIB, so if it's different somehow + # If there's an entry in the CIB, see if it's different somehow if (exists $anvil->data->{cib}{parsed}{data}{node}{$node_name}{fencing}{device}{$ipmi_stonith_name}) { foreach my $argument (sort {$a cmp $b} keys %{$anvil->data->{cib}{parsed}{data}{node}{$node_name}{fencing}{device}{$ipmi_stonith_name}{argument}}) @@ -1115,15 +1115,25 @@ sub configure_pacemaker }}); if ($return_code) { - # Something went wrong. - $anvil->Log->entry({source => $THIS_FILE, line => __LINE__, 'print' => 1, level => 0, priority => "err", key => "error_0138", variables => { - shell_call => $shell_call, - output => $output, - return_code => $return_code, - }}); - update_progress($anvil, 0, "error_0138,!!shell_call!".$shell_call."!!,!!output!".$output."!!,!!return_code!".$return_code."!!"); - sleep 2; - $anvil->nice_exit({exit_code => 6}); + # If this is because the method already exists, ignore the error. + if ($output =~ /already exists/i) + { + $anvil->Log->entry({source => $THIS_FILE, line => __LINE__, 'print' => 1, level => 1, priority => "alert", key => "warning_0174", variables => { + method => $ipmi_stonith_name, + }}); + } + else + { + # Something went wrong. + $anvil->Log->entry({source => $THIS_FILE, line => __LINE__, 'print' => 1, level => 0, priority => "err", key => "error_0138", variables => { + shell_call => $shell_call, + output => $output, + return_code => $return_code, + }}); + update_progress($anvil, 0, "error_0138,!!shell_call!".$shell_call."!!,!!output!".$output."!!,!!return_code!".$return_code."!!"); + sleep 2; + $anvil->nice_exit({exit_code => 6}); + } } $something_changed->{$node_name} = 1; diff --git a/tools/striker-collect-debug b/tools/striker-collect-debug index 03540691..a80f2065 100755 --- a/tools/striker-collect-debug +++ b/tools/striker-collect-debug @@ -595,6 +595,30 @@ sub collect_remote_data }); } + print "- Grabbing Anvil! config... "; + $anvil->Storage->rsync({ + debug => 2, + source => "root\@".$anvil->data->{peer}{$short_host_name}{access}{ip}.":/etc/anvil/anvil.conf*", + destination => $target_directory."/", + }); + $test_file = $target_directory."/anvil.conf"; + $anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => { test_file => $test_file }}); + if (-e $test_file) + { + print "Done.\n"; + } + else + { + print "Failed!\n"; + print "- For some reason, this file was not collected.\n"; + $anvil->Storage->write_file({ + file => $test_file, + body => $failed_body, + overwrite => 1, + backup => 0, + }); + } + # If this is a node, grab the shared files. if ($this_host_type eq "node") { @@ -794,6 +818,17 @@ sub collect_local_data }}); print "Done!\n"; + print "- Grabbing Anvil! config... "; + $shell_call = $anvil->data->{path}{exe}{cp}." /etc/anvil/anvil.conf ".$target_directory."/"; + $anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => { shell_call => $shell_call }}); + + ($output, $return_code) = $anvil->System->call({shell_call => $shell_call}); + $anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => { + output => $output, + return_code => $return_code, + }}); + print "Done!\n"; + print "- Grabbing Anvil! log... "; $shell_call = $anvil->data->{path}{exe}{cp}." /var/log/anvil.log ".$target_directory."/"; $anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => { shell_call => $shell_call }}); diff --git a/tools/striker-manage-peers b/tools/striker-manage-peers index 58dae0af..356f610c 100755 --- a/tools/striker-manage-peers +++ b/tools/striker-manage-peers @@ -544,7 +544,7 @@ sub process_entry # Flag a resync, connect, and configure, if needed. $anvil->data->{sys}{database}{resync_needed} = 1; $anvil->Database->connect({ - debug => 3, + debug => 2, check_for_resync => 1, check_if_configured => $host_uuid eq $anvil->Get->host_uuid ? 1 : 0, });