Merge pull request #32 from ClusterLabs/scancore-debugging

Scancore debugging
main
digimer-bot 4 years ago committed by GitHub
commit 28060d5ecf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 6
      scancore-agents/scan-apc-ups/scan-apc-ups
  2. 14
      scancore-agents/scan-ipmitool/scan-ipmitool
  3. 1
      tools/Makefile.am
  4. 2
      tools/anvil-update-states
  5. 32
      tools/test.pl

@ -701,9 +701,9 @@ INSERT INTO
$ups_changed = 1; $ups_changed = 1;
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => { ups_changed => $ups_changed }}); $anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => { ups_changed => $ups_changed }});
### NOTE: This used to be 'warning' level, but it caused way too many ### NOTE: This used to be 'warning' level, but it caused way too many false
### false alarms. If a serious issue arises, the input voltage ### alarms. If a serious issue arises, the input voltage will trigger a
### will trigger a 'warning' level alert. ### 'warning' level alert.
### There are 10 possible states ### There are 10 possible states
# 0 - There is no information on when the UPS last transferred to battery. # 0 - There is no information on when the UPS last transferred to battery.
# 1 - The UPS has not transferred to battery power since the last time it booted. # 1 - The UPS has not transferred to battery power since the last time it booted.

@ -130,6 +130,7 @@ $anvil->data->{'scan-ipmitool'} = {
buffer => 2, buffer => 2,
weight => 1, weight => 1,
}, },
### TODO: Support wild-card sensor names.
# If the user wants to assign manual values for a given sensor, they can do # If the user wants to assign manual values for a given sensor, they can do
# so by creating an entry hear where the key is the IPMI-returned sensor # so by creating an entry hear where the key is the IPMI-returned sensor
# name. # name.
@ -178,6 +179,19 @@ $anvil->data->{'scan-ipmitool'} = {
'RAID Controller' => { 'RAID Controller' => {
jump => 15, jump => 15,
}, },
# On Dells, 'Temp{1..4}' change a lot, so we bump the jump.
'Temp1' => {
jump => 20,
},
'Temp2' => {
jump => 20,
},
'Temp3' => {
jump => 20,
},
'Temp4' => {
jump => 20,
},
}, },
# TODO: Remove this and have Striker pull the list of thermal sensors read in the # TODO: Remove this and have Striker pull the list of thermal sensors read in the
# last $timestamp. # last $timestamp.

@ -2,7 +2,6 @@ MAINTAINERCLEANFILES = Makefile.in
# XXX recheck after rebase! # XXX recheck after rebase!
EXTRA_DIST = \ EXTRA_DIST = \
test.pl \
watch_drbd watch_drbd
dist_sbin_SCRIPTS = \ dist_sbin_SCRIPTS = \

@ -884,7 +884,7 @@ ORDER BY
{ {
# Mark it as deleted. # Mark it as deleted.
my $query = "UPDATE network_interfaces SET network_interface_operational = 'DELETED' WHERE network_interface_uuid = ".$anvil->Database->quote($network_interface_uuid).";"; my $query = "UPDATE network_interfaces SET network_interface_operational = 'DELETED' WHERE network_interface_uuid = ".$anvil->Database->quote($network_interface_uuid).";";
$anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => 1, key => "log_0124", variables => { query => $query }}); $anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => 2, key => "log_0124", variables => { query => $query }});
$anvil->Database->write({query => $query, source => $THIS_FILE, line => __LINE__}); $anvil->Database->write({query => $query, source => $THIS_FILE, line => __LINE__});
} }

@ -1,32 +0,0 @@
#!/usr/bin/perl
#
use strict;
use warnings;
use Anvil::Tools;
use Data::Dumper;
my $THIS_FILE = ($0 =~ /^.*\/(.*)$/)[0];
my $running_directory = ($0 =~ /^(.*?)\/$THIS_FILE$/)[0];
if (($running_directory =~ /^\./) && ($ENV{PWD}))
{
$running_directory =~ s/^\./$ENV{PWD}/;
}
# Turn off buffering so that the pinwheel will display while waiting for the SSH call(s) to complete.
$| = 1;
my $anvil = Anvil::Tools->new();
$anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => 2, key => "log_0115", variables => { program => $THIS_FILE }});
# Read switches (target ([user@]host[:port]) and the file with the target's password.
$anvil->Get->switches;
# Connect to the database(s).
$anvil->Database->connect({debug => 3});
$anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => 2, key => "log_0132"});
my ($minor, $tcp_port) = $anvil->DRBD->get_next_resource({debug => 2});
print "Next free minor: [".$minor."], tcp port: [".$tcp_port."]\n";
$anvil->nice_exit({exit_code => 0});
Loading…
Cancel
Save