xcat2 / xcat-core

Code repo for xCAT core packages
Eclipse Public License 1.0
363 stars 171 forks source link

reventlog timestamps in UTC? #7208

Open kcgthb opened 2 years ago

kcgthb commented 2 years ago

Hi!

Just a quick question/verification regarding reventlog timestamps (for IPMI hosts): they don't seem to match the timestamps displayed in the IPMI SEL logs, but rather be converted in a different timezone (UTC?).

Here's the direct IPMI SEL entry (timestamps are in PST):

# ssh node1 ipmitool sel log | head -n1
  1 | Mon 21 Dec 2020 | 12:40:49 PM PST | Event Logging Disabled #0x72 | Log area reset/cleared | Asserted

and from reventlog:

# reventlog node1 | head -n1
node1: 12/21/2020 19:40:49 Event Logging Disabled, Log Area Reset/Cleared (SEL)

Is it expected? If so, would it be possible to specify the timezone in the timestamp output, or at least mention it in the documentation?

Thanks!

gurevichmark commented 2 years ago

It looks like reventlog (./xCAT-server/lib/xcat/plugins/ipmi.pm) command does some timestamp adjustment around line 5208 :

    #Here we set tfactor based on the delta between the BMC reported time and our
    #time.  The IPMI spec says the BMC should return seconds since 1970 in local
    #time, but the reality is the firmware pushing to the BMC has no context
    #to know, so here we guess and adjust all timestamps based on delta between
    #our now and the BMC's now
    $sessdata->{tfactor} = $returnd[4] << 24 | $returnd[3] << 16 | $returnd[2] << 8 | $returnd[1];
    if ($sessdata->{tfactor} > 0x20000000) {
        $sessdata->{tfactor} -= time();
    } else {
        $sessdata->{tfactor} = 0;
    }