all lists on lists.proxmox.com
 help / color / mirror / Atom feed
From: Maximiliano Sandoval <m.sandoval@proxmox.com>
To: Thomas Lamprecht <t.lamprecht@proxmox.com>
Cc: pve-devel@lists.proxmox.com
Subject: Re: [PATCH manager] report: list recent reboot events and their kernel version
Date: Mon, 20 Jul 2026 15:33:24 +0200	[thread overview]
Message-ID: <s8ov7a923bv.fsf@toolbox> (raw)
In-Reply-To: <55625334-51ae-45d8-b365-91d85d1cc541@proxmox.com> (Thomas Lamprecht's message of "Mon, 20 Jul 2026 14:58:17 +0200")

Thomas Lamprecht <t.lamprecht@proxmox.com> writes:

> Am 20.07.26 um 14:38 schrieb Alexander Zeidler:
>> Based on the most recent reboot events, it is possible to determine
>> whether and when a crash, fencing, or reboot occurred and with which
>> kernel version the node booted.
>> 
>> Use `wtmpdb last` as a replacement for the well-known `last`, since
>> the latter became obsolete [0] with Debian Trixie / PVE 9.
>> 
>>  # wtmpdb last reboot --fulltimes --limit 5
>>  reboot   system boot  7.0.14-5-pve     Mon Jul 20 14:22:34 2026 - still running
>>  reboot   system boot  7.0.14-5-pve     Thu Jul 16 15:12:16 2026 - crash
>>  reboot   system boot  7.0.14-5-pve     Thu Jul 16 11:20:15 2026 - Thu Jul 16 15:10:46 2026  (03:50)
>>  reboot   system boot  7.0.14-5-pve     Wed Jul 15 13:39:34 2026 - crash
>>  reboot   system boot  7.0.14-2-pve     Wed Jul 15 07:39:18 2026 - Wed Jul 15 13:38:04 2026  (05:58)
>> 
>>  wtmpdb begins Wed Jul 15 07:39:18 2026
>> 
>> [0] https://www.debian.org/releases/trixie/release-notes/issues.html#the-last-lastb-and-lastlog-commands-have-been-replaced
>> 
>> Signed-off-by: Alexander Zeidler <a.zeidler@proxmox.com>
>> ---
>>  PVE/Report.pm | 1 +
>>  1 file changed, 1 insertion(+)
>> 
>> diff --git a/PVE/Report.pm b/PVE/Report.pm
>> index 29433d4a..6049c0bf 100644
>> --- a/PVE/Report.pm
>> +++ b/PVE/Report.pm
>> @@ -36,6 +36,7 @@ my $init_report_cmds = sub {
>>                  'hostname',
>>                  'date -R',
>>                  'cat /proc/cmdline',
>> +                'wtmpdb last reboot --fulltimes --limit 5',
>
> we nowhere depend on wtmpdb so it's not a given that it's installed.

OK, that is not ideal. Afaik only libpam-wtmpdb "Recommends" wtmpdb
(according to debtree).

> For just the boots we could use "journalctl --list-boots -n 5 -r".
> Depending on wtmpdb and writing yet another log file just for kernel version might
> be a bit overkill, given that the info is there in the journal, albeit it *is*
> annoying that we would have to manually parse them from the journal...

For the purposes of support we are more interested about the kernel
version used each boot. It would be interesting to have info about the
BOOT IDs or having the timestamp of the last entry for a give boot
though.

Another consideration of journalctl is that the boots might be rotated
away.

>>                  'pveversion --verbose',
>>                  'cat /etc/hosts',
>>                  'pvesubscription get',

-- 
Maximiliano




  reply	other threads:[~2026-07-20 13:34 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-20 12:33 [PATCH manager] report: list recent reboot events and their kernel version Alexander Zeidler
2026-07-20 12:58 ` Thomas Lamprecht
2026-07-20 13:33   ` Maximiliano Sandoval [this message]
2026-07-20 14:58     ` Alexander Zeidler
2026-07-20 15:41       ` Thomas Lamprecht
2026-07-20 13:16 ` Maximiliano Sandoval

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=s8ov7a923bv.fsf@toolbox \
    --to=m.sandoval@proxmox.com \
    --cc=pve-devel@lists.proxmox.com \
    --cc=t.lamprecht@proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal