mirror of
https://github.com/xcat2/xcat-core.git
synced 2025-05-29 17:23:08 +00:00
Add resolved=LED option to reventlog
This commit is contained in:
parent
b750ea34d4
commit
423a1c913d
@ -19,10 +19,17 @@ Name
|
||||
****************
|
||||
|
||||
|
||||
\ **reventlog**\ \ *noderange*\ {\ *number-of-entries*\ [\ **-s**\ ]|\ **all [-s] | clear**\ }
|
||||
\ **reventlog**\ \ *noderange*\ [\ *number-of-entries*\ [\ **-s**\ ]|\ **all [-s] | clear**\ ]
|
||||
|
||||
\ **reventlog**\ [\ **-h | -**\ **-help | -v | -**\ **-version**\ ]
|
||||
|
||||
OpenPOWER OpenBMC specific :
|
||||
============================
|
||||
|
||||
|
||||
\ **reventlog**\ \ *noderange*\ [\ **resolved=**\ {\ *id-list*\ |\ **LED**\ }]
|
||||
|
||||
|
||||
|
||||
*******************
|
||||
\ **Description**\
|
||||
@ -64,6 +71,12 @@ logs are stored on each servers service processor.
|
||||
|
||||
|
||||
|
||||
\ **resolved=**\ {\ *id-list*\ |\ **LED**\ }
|
||||
|
||||
Mark event log entries as resolved. Use comma separated list of entry ids to specify individual entries. Use \ **LED**\ to mark as resolved all event log entries that contribute to LED fault.
|
||||
|
||||
|
||||
|
||||
\ **-h | -**\ **-help**\
|
||||
|
||||
Print help.
|
||||
@ -83,7 +96,7 @@ logs are stored on each servers service processor.
|
||||
|
||||
|
||||
|
||||
1.
|
||||
1. List last 5 event log entries from node4 and node5
|
||||
|
||||
|
||||
.. code-block:: perl
|
||||
@ -110,7 +123,7 @@ logs are stored on each servers service processor.
|
||||
|
||||
|
||||
|
||||
2.
|
||||
2. Clear all event log entries from node4 and node5
|
||||
|
||||
|
||||
.. code-block:: perl
|
||||
@ -129,6 +142,27 @@ logs are stored on each servers service processor.
|
||||
|
||||
|
||||
|
||||
3. Mark as resolved all event log entries from node4 that contribute to LED fault
|
||||
|
||||
|
||||
.. code-block:: perl
|
||||
|
||||
reventlog node4 resolved=LED
|
||||
|
||||
|
||||
Output is similar to:
|
||||
|
||||
|
||||
.. code-block:: perl
|
||||
|
||||
Attempting to resolve the following log entries: LED...
|
||||
node4: Resolved 51.
|
||||
node4: Resolved 52.
|
||||
node4: Resolved 58.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
********
|
||||
SEE ALSO
|
||||
|
@ -90,6 +90,7 @@ my %usage = (
|
||||
rvitals noderange ",
|
||||
"reventlog" =>
|
||||
"Usage: reventlog <noderange> [all [-s]|clear|<number of entries to retrieve> [-s]] [-V|--verbose]
|
||||
reventlog <noderange> [resolved={<id list>|LED}]
|
||||
reventlog [-h|--help|-v|--version]",
|
||||
"rinv" =>
|
||||
"Usage:
|
||||
|
@ -4,10 +4,15 @@ B<reventlog> - retrieve or clear remote hardware event logs
|
||||
|
||||
=head1 B<Synopsis>
|
||||
|
||||
B<reventlog> I<noderange> {I<number-of-entries> [B<-s>]|B<all [-s]>|B<clear>}
|
||||
B<reventlog> I<noderange> [I<number-of-entries> [B<-s>]|B<all [-s]>|B<clear>]
|
||||
|
||||
B<reventlog> [B<-h>|B<--help>|B<-v>|B<--version>]
|
||||
|
||||
=head2 OpenPOWER OpenBMC specific :
|
||||
|
||||
B<reventlog> I<noderange> [B<resolved=>{I<id-list>|B<LED>}]
|
||||
|
||||
|
||||
=head1 B<Description>
|
||||
|
||||
B<reventlog> can display any number of remote hardware event log entries
|
||||
@ -34,6 +39,10 @@ To sort the entries from latest (always the last entry in event DB) to oldest (a
|
||||
|
||||
Clear event logs.
|
||||
|
||||
=item B<resolved=>{I<id-list>|B<LED>}
|
||||
|
||||
Mark event log entries as resolved. Use comma separated list of entry ids to specify individual entries. Use B<LED> to mark as resolved all event log entries that contribute to LED fault.
|
||||
|
||||
=item B<-h>|B<--help>
|
||||
|
||||
Print help.
|
||||
@ -50,6 +59,7 @@ Print version.
|
||||
=over 2
|
||||
|
||||
=item 1.
|
||||
List last 5 event log entries from node4 and node5
|
||||
|
||||
reventlog node4,node5 5
|
||||
|
||||
@ -67,6 +77,7 @@ Output is similar to:
|
||||
node5: SERVPROC I 09/06/00 15:21:29 System spn1 started a RS485 connection with us[00]
|
||||
|
||||
=item 2.
|
||||
Clear all event log entries from node4 and node5
|
||||
|
||||
reventlog node4,node5 clear
|
||||
|
||||
@ -75,6 +86,18 @@ Output is similar to:
|
||||
node4: clear
|
||||
node5: clear
|
||||
|
||||
=item 3.
|
||||
Mark as resolved all event log entries from node4 that contribute to LED fault
|
||||
|
||||
reventlog node4 resolved=LED
|
||||
|
||||
Output is similar to:
|
||||
|
||||
Attempting to resolve the following log entries: LED...
|
||||
node4: Resolved 51.
|
||||
node4: Resolved 52.
|
||||
node4: Resolved 58.
|
||||
|
||||
=back
|
||||
|
||||
=head1 SEE ALSO
|
||||
|
@ -211,6 +211,9 @@ my %status_info = (
|
||||
REVENTLOG_RESOLVED_RESPONSE => {
|
||||
process => \&reventlog_response,
|
||||
},
|
||||
REVENTLOG_RESOLVED_RESPONSE_LED => {
|
||||
process => \&reventlog_response,
|
||||
},
|
||||
|
||||
RFLASH_LIST_REQUEST => {
|
||||
method => "GET",
|
||||
@ -1084,7 +1087,7 @@ sub parse_args {
|
||||
|
||||
my $nodes_num = @$noderange;
|
||||
if (@$noderange > 1) {
|
||||
xCAT::SvrUtils::sendmsg("WARN: Resolving faults over a xCAT noderange is not recommended.", $callback);
|
||||
return ([ 1, "Resolving faults over a xCAT noderange is not recommended." ]);
|
||||
}
|
||||
|
||||
xCAT::SvrUtils::sendmsg("Attempting to resolve the following log entries: $value...", $callback);
|
||||
@ -1471,6 +1474,9 @@ sub parse_command_status {
|
||||
if ($subcommand eq "clear") {
|
||||
$next_status{LOGIN_RESPONSE} = "REVENTLOG_CLEAR_REQUEST";
|
||||
$next_status{REVENTLOG_CLEAR_REQUEST} = "REVENTLOG_CLEAR_RESPONSE";
|
||||
} elsif ($subcommand =~ /resolved=LED/) {
|
||||
$next_status{LOGIN_RESPONSE} = "REVENTLOG_REQUEST";
|
||||
$next_status{REVENTLOG_REQUEST} = "REVENTLOG_RESOLVED_RESPONSE_LED";
|
||||
} elsif ($subcommand =~ /resolved=(.+)/) {
|
||||
$next_status{LOGIN_RESPONSE} = "REVENTLOG_RESOLVED_REQUEST";
|
||||
$next_status{REVENTLOG_RESOLVED_REQUEST} = "REVENTLOG_RESOLVED_RESPONSE";
|
||||
@ -2932,6 +2938,31 @@ sub reventlog_response {
|
||||
$wait_node_num--;
|
||||
return;
|
||||
}
|
||||
} elsif ($node_info{$node}{cur_status} eq "REVENTLOG_RESOLVED_RESPONSE_LED") {
|
||||
# Scan all event log entries and build an array of all that have callout data
|
||||
my @entries;
|
||||
foreach my $key_url (keys %{$response_info->{data}}) {
|
||||
my %content = %{ ${ $response_info->{data} }{$key_url} };
|
||||
next unless ($content{Id});
|
||||
my $event_msg = is_callout_event_data(\%content);
|
||||
push(@entries, $event_msg) if ($event_msg); # Add array entry of log event id
|
||||
}
|
||||
|
||||
# If some entries with callout data, send them off to be resolved
|
||||
if (scalar(@entries) > 0) {
|
||||
$next_status{"REVENTLOG_RESOLVED_RESPONSE_LED"} = "REVENTLOG_RESOLVED_REQUEST";
|
||||
$next_status{"REVENTLOG_RESOLVED_REQUEST"} = "REVENTLOG_RESOLVED_RESPONSE";
|
||||
|
||||
my $init_entry = shift @entries;
|
||||
$status_info{REVENTLOG_RESOLVED_REQUEST}{init_url} =~ s/#ENTRY_ID#/$init_entry/g;
|
||||
push @{ $status_info{REVENTLOG_RESOLVED_RESPONSE}{remain_entries} }, @entries;
|
||||
}
|
||||
else {
|
||||
# Return if there are no entries with callout data
|
||||
xCAT::SvrUtils::sendmsg("There are no event log entries contributing to LED fault", $callback, $node);
|
||||
$wait_node_num--;
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
my $entry_string = $status_info{REVENTLOG_RESPONSE}{argv};
|
||||
my $content_info;
|
||||
@ -2967,6 +2998,33 @@ sub reventlog_response {
|
||||
|
||||
#-------------------------------------------------------
|
||||
|
||||
=head3 is_callout_event_data
|
||||
|
||||
Parse reventlog data and return entry ID if it has
|
||||
CALLOUT data
|
||||
Input:
|
||||
$content: data for single entry
|
||||
|
||||
=cut
|
||||
|
||||
#-------------------------------------------------------
|
||||
sub is_callout_event_data {
|
||||
my $content = shift;
|
||||
my $id_num = $$content{Id};
|
||||
|
||||
if ($$content{Message}) {
|
||||
if (defined $$content{AdditionalData} and $$content{AdditionalData}) {
|
||||
foreach my $addition (@{ $$content{AdditionalData} }) {
|
||||
if ($addition =~ /CALLOUT/) {
|
||||
return $id_num;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return "";
|
||||
}
|
||||
#-------------------------------------------------------
|
||||
|
||||
=head3 parse_event_data
|
||||
|
||||
Parse reventlog data
|
||||
|
Loading…
x
Reference in New Issue
Block a user