Added anvil.conf to log collection.

Signed-off-by: digimer <mkelly@alteeve.ca>
main
digimer 9 months ago
parent 60759cd9aa
commit 76e66e6fa6
  1. 2
      Anvil/Tools/Database.pm
  2. 35
      tools/striker-collect-debug

@ -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,

@ -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 }});

Loading…
Cancel
Save