On Mon, 2024-03-25 at 08:52 +0100, Thomas Lamprecht wrote:
> > > > On 22/03/2024 14:59, Alexander Zeidler wrote:
> > > > > > > > While using `/proc/cmdline` would already provide an initial 
> > > > > > > > info for
> > > > > > > > debugging passthrough and similar, the use of `dmesg` is an 
> > > > > > > > easy way
> > > > > > > > to get the boot date as an absolute value for free (additional 
> > > > > > > > to the
> > > > > > > > relative value in `uptime` from `top`).
> > > > > > > > 
> > > > > > > > Signed-off-by: Alexander Zeidler <a.zeid...@proxmox.com>
> > > > > > > > ---
> > > > > > > >  PVE/Report.pm | 1 +
> > > > > > > >  1 file changed, 1 insertion(+)
> > > > > > > > 
> > > > > > > > diff --git a/PVE/Report.pm b/PVE/Report.pm
> > > > > > > > index 53ffdcbb..d4191769 100644
> > > > > > > > --- a/PVE/Report.pm
> > > > > > > > +++ b/PVE/Report.pm
> > > > > > > > @@ -31,6 +31,7 @@ my $init_report_cmds = sub {
> > > > > > > >             cmds => [
> > > > > > > >                 'hostname',
> > > > > > > >                 'date -R',
> > > > > > > > +               'dmesg -T | head | grep Command',
> > > > 
> > > > Meh, I'd rather get the command line explicitly and the last boots

Alright!

> > > > using:
> > > > 
> > > > journalctl --list-boots

On slow servers / storage drives this execution can easily take 10 seconds
or longer. But there is an alternative that is quite fast and even shows
the booted kernel version:

# last reboot -F -n10
reboot system boot 6.5.11-7-pve Thu Apr 11 16:31:24 2024 still running
reboot system boot 6.5.11-7-pve Thu Apr 11 16:29:17 2024 - Thu Apr 11 16:31:12 
2024 (00:01)
reboot system boot 6.5.11-7-pve Thu Apr 11 16:25:41 2024 - Thu Apr 11 16:31:12 
2024 (00:05)
...

Furthermore, as simulated and visible above, a duplicated "until" field
hints that the earlier system boot (16:25:41) crashed unexpectedly (sometime
before the next boot at 16:29:17).

Limiting the output to 10 lines seems reasonable for most cases.

> > > > 
> > > > 
> > > > As here you get much more info, e.g. about (recent) frequent reboots.
> > > > 
> > > > Please remember to add this also to the PMG and PBS reports. 
> > > > 
> > > > > > > >                 'pveversion --verbose',
> > > > > > > >                 'cat /etc/hosts',
> > > > > > > >                 'pvesubscription get',
> > > > 




_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel

Reply via email to