ipmitool sel get is not showing hour in the timestamp details
Affects | Status | Importance | Assigned to | Milestone | ||
---|---|---|---|---|---|---|
ipmitool (Ubuntu) | Status tracked in Questing | |||||
Focal |
Invalid
|
Undecided
|
Unassigned | |||
Jammy |
Invalid
|
Undecided
|
Unassigned | |||
Noble |
Fix Released
|
Undecided
|
Andreas Hasenack | |||
Oracular |
Fix Released
|
Undecided
|
Andreas Hasenack | |||
Plucky |
Fix Released
|
Undecided
|
Andreas Hasenack | |||
Questing |
Fix Released
|
Medium
|
Andreas Hasenack |
Bug Description
[ Impact ]
ipmitool is incorrectly parsing the timestamp of event fields, showing two dates instead of a date and a time. It's important to get the correct timestamp of events, and the current situation limits this information to purely a day, instead of a proper timestamp.
[ Test Plan ]
The test plan involves getting an event and checking if the timestamp contains a date and a time, instead of just a date shown twice. There are several ways to do this, but they all need a working BMC listening to IPMI commands.
For the test plan, we will deploy 24.04 on a bare metal machine which has a BMC that ipmitool can query via localhost, without credentials. And then for the testing, use a LXD container for each ubuntu release under test, and run ipmitool inside that LXC.
Here are the steps.
# Deploy ubuntu 24.04 on a bare metal machine with a working BMC
# setup LXD
sudo lxd init --auto
# For each ubuntu release under test, run the following commands. Here we will show it for noble, but iterate using oracular and plucky:
lxc launch ubuntu-
# this will passthrough the IPMI device from the host to the container
lxc config device add $release-test ipmi unix-char path=/dev/ipmi0
# enter the container to run the ipmitool command that will show the bug
lxc exec $release-test -- bash -c "apt update; apt install ipmitool -y"
lxc exec $release-test -- ipmitool sel get 1
# With the bug, the output of the ipmitool command above will show a timestamp with two dates, instead of one date and one time:
Timestamp : 02/25/12 02/25/12
# With the fix, that timestamp will show a date and a time:
Timestamp : 02/25/12 00:41:13 UTC
[ Where problems could occur ]
There might exist scripts and tools out there that parse the Timestamp field, and are by now relying on the bug. In other words, they are expecting both tokens from the Timestamp field to be dates. Unfortunately that output is incorrect, and this SRU is fixing that, thus changing the behavior to be correct. If other tools rely on the bug, they will have to be changed.
If there are other places with timestamps that use the same code that is now fixed, they will also change.
The fix could also expose bugs that were not there before, since now a data value is being parsed and printed as time.
[ Other Info ]
Not at this time.
[ Original Description ]
Hello,
when running impitool sel get <event id>,
the timestamp information is showing twice the date, but not the hour
fr3d@safact:
SEL Record ID : 028a
Record Type : 02
Timestamp : 04/16/2025 04/16/2025
Generator ID : 0020
EvM Revision : 04
Sensor Type : Unknown
Sensor Number : 00
Event Type : Sensor-specific Discrete
Event Direction : Assertion Event
Event Data : 030000
Description :
Using ipmi-sel / free-ipmi, the hour is reported in the nice way
fr3d@safact:
ID | Date | Time | Name | Type | Event
650 | Apr-16-2025 | 23:58:03 | Sensor #0 | OEM Reserved | Event Offset = 03h
(note: this is the same event 0x28a = 650)
Still using free-ipmi, in debug mode we can see the 32b timetsamp:
10.197.177.97: [ 19h] = checksum2[ 8b]
10.197.177.97: =======
10.197.177.97: SEL Event Record
10.197.177.97: =======
10.197.177.97: [ 28Ah] = record_id[16b]
10.197.177.97: [ 2h] = record_type[ 8b]
10.197.177.97: [ 6800440Bh] = timestamp[32b]
10.197.177.97: [ 0h] = generator_
10.197.177.97: [ 10h] = generator_id.id[ 7b]
10.197.177.97: [ 0h] = ipmb_device_lun[ 2b]
10.197.177.97: [ 0h] = reserved[ 2b]
10.197.177.97: [ 0h] = channel_number[ 4b]
10.197.177.97: [ 4h] = event_message_
10.197.177.97: [ C3h] = sensor_type[ 8b]
10.197.177.97: [ 0h] = sensor_number[ 8b]
10.197.177.97: [ 6Fh] = event_type_code[ 7b]
10.197.177.97: [ 0h] = event_dir[ 1b]
10.197.177.97: [ 3h] = offset_
10.197.177.97: [ 0h] = event_data3_flag[ 2b]
10.197.177.97: [ 0h] = event_data2_flag[ 2b]
10.197.177.97: [ 0h] = event_data2[ 8b]
10.197.177.97: [ 0h] = event_data3[ 8b]
10.197.177.97: =======
10.197.177.97: IPMI 1.5 Reserve SEL Request
10.197.177.97: =======
10.197.177.97: RMCP Header:
Then, using ipmitool with -vvv flag, we can see the righttime stamp has been reported by the BMC
Looking up SEL entry 0x28a
>> Sending IPMI command payload
>> netfn : 0x0a
>> command : 0x43
>> data : 0x00 0x00 0x8a 0x02 0x00 0xff
BUILDING A v2 COMMAND
Local RqAddr 0x20 transit 0:0 target 0x20:0 bridgePossible 1
>> Initialization vector (16 bytes)
9a 01 24 2a 62 43 84 3b ae 2d 64 04 34 71 32 74
authcode input (48 bytes)
06 c0 80 0e 5e 9d 0c 00 00 00 20 00 9a 01 24 2a
62 43 84 3b ae 2d 64 04 34 71 32 74 5c ee 34 ac
0e f8 83 ca 27 56 99 07 72 21 83 f1 ff ff 02 07
authcode output (16 bytes)
2a b7 99 68 b5 d5 e4 31 c0 3b a0 87 a1 10 48 b4
<< IPMI Response Session Header
<< Authtype : RMCP+
<< Payload type : IPMI (0)
<< Session ID : 0xa0a2a3a4
<< Sequence : 0x00000006
<< IPMI Msg/Payload Length : 48
<< IPMI Response Message Header
<< Rq Addr : 81
<< NetFn : 0b
<< Rq LUN : 0
<< Rs Addr : 20
<< Rq Seq : 0a
<< Rs Lun : 0
<< Command : 43
<< Compl Code : 0x00
SEL Entry: 8a02020b4400682
=> in the SEL Entry, the timestamp is "0b440068" (=> 0x6800440b as it is a 32b integer)
So the issue is not related to IPMI data (both free-ipmi and ipmitool got the right timestamp)
but it seems to be a display issue in ipmitool
Note: in an old stackoverflow thread, we can see ipmitool output with Hour in the event timestamp
https:/
machine:/ # ipmitool sel get 0x2c
SEL Record ID : 002c
Record Type : 02
Timestamp : 02/13/2012 17:49:21
Generator ID : 0021
EvM Revision : 04
Sensor Type : Voltage
Sensor Number : 60
Event Type : Threshold
Event Direction : Assertion Event
Event Data : 02ffff
Description : Lower Critical going low
Thanks
--
Fred
ProblemType: Bug
DistroRelease: Ubuntu 24.04
Package: ipmitool 1.8.19-
ProcVersionSign
Uname: Linux 6.8.0-57-generic x86_64
ApportVersion: 2.28.1-0ubuntu3.5
Architecture: amd64
CasperMD5CheckR
CloudArchitecture: x86_64
CloudID: none
CloudName: none
CloudPlatform: none
CloudSubPlatform: config
Date: Thu Apr 17 09:36:35 2025
InstallationDate: Installed on 2022-04-26 (1087 days ago)
InstallationMedia: Ubuntu-Server 22.04 LTS "Jammy Jellyfish" - Release amd64 (20220421)
ProcEnviron:
LANG=en_US.UTF-8
PATH=(custom, no user)
SHELL=/bin/bash
TERM=xterm
XDG_RUNTIME_
SourcePackage: ipmitool
UpgradeStatus: Upgraded to noble on 2024-10-23 (176 days ago)
Related branches
- git-ubuntu bot: Approve
- Lena Voytek (community): Approve
- Canonical Server Reporter: Pending requested
-
Diff: 89 lines (+67/-0)3 files modifieddebian/changelog (+7/-0)
debian/patches/fix-date-time-output-of-timestamps.patch (+59/-0)
debian/patches/series (+1/-0)
- git-ubuntu bot: Approve
- Lena Voytek (community): Approve
- Canonical Server Reporter: Pending requested
-
Diff: 89 lines (+67/-0)3 files modifieddebian/changelog (+7/-0)
debian/patches/fix-date-time-output-of-timestamps.patch (+59/-0)
debian/patches/series (+1/-0)
- git-ubuntu bot: Approve
- Lena Voytek (community): Approve
- Canonical Server Reporter: Pending requested
-
Diff: 89 lines (+67/-0)3 files modifieddebian/changelog (+7/-0)
debian/patches/fix-date-time-output-of-timestamps.patch (+59/-0)
debian/patches/series (+1/-0)
- git-ubuntu bot: Approve
- Athos Ribeiro (community): Approve
- Canonical Server Reporter: Pending requested
-
Diff: 89 lines (+67/-0)3 files modifieddebian/changelog (+7/-0)
debian/patches/fix-date-time-output-of-timestamps.patch (+59/-0)
debian/patches/series (+1/-0)
description: | updated |
description: | updated |
description: | updated |
description: | updated |
description: | updated |
description: | updated |
tags: |
added: verification-done removed: verification-needed |
I suspect this could be the fix: https:/ /codeberg. org/IPMITool/ ipmitool/ commit/ 01c572b91103572 6526b9bfe685031 f2bf925130
I applied it to ipmitool in noble, and uploaded to this ppa:
https:/ /launchpad. net/~ahasenack/ +archive/ ubuntu/ ipmitool- 2107550
Frederic, when the builds finish, would you mind giving that patched package a try, and see if it fixes the problem?