From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <pve-devel-bounces@lists.proxmox.com>
Received: from firstgate.proxmox.com (firstgate.proxmox.com [IPv6:2a01:7e0:0:424::9])
	by lore.proxmox.com (Postfix) with ESMTPS id 0B7291FF380
	for <inbox@lore.proxmox.com>; Fri, 19 Apr 2024 18:27:36 +0200 (CEST)
Received: from firstgate.proxmox.com (localhost [127.0.0.1])
	by firstgate.proxmox.com (Proxmox) with ESMTP id 1F4BAEBF9;
	Fri, 19 Apr 2024 18:27:32 +0200 (CEST)
From: Alexander Zeidler <a.zeidler@proxmox.com>
To: pve-devel@lists.proxmox.com
Date: Fri, 19 Apr 2024 18:26:42 +0200
Message-Id: <20240419162642.260130-2-a.zeidler@proxmox.com>
X-Mailer: git-send-email 2.39.2
In-Reply-To: <20240419162642.260130-1-a.zeidler@proxmox.com>
References: <20240419162642.260130-1-a.zeidler@proxmox.com>
MIME-Version: 1.0
X-SPAM-LEVEL: Spam detection results:  0
 AWL 0.088 Adjusted score from AWL reputation of From: address
 BAYES_00                 -1.9 Bayes spam probability is 0 to 1%
 DMARC_MISSING             0.1 Missing DMARC policy
 KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment
 SPF_HELO_NONE           0.001 SPF: HELO does not publish an SPF Record
 SPF_PASS               -0.001 SPF: sender matches SPF record
Subject: [pve-devel] [PATCH v3 manager 2/2] report: add recent boot
 timestamps which may show fencing/crash events
X-BeenThere: pve-devel@lists.proxmox.com
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: Proxmox VE development discussion <pve-devel.lists.proxmox.com>
List-Unsubscribe: <https://lists.proxmox.com/cgi-bin/mailman/options/pve-devel>, 
 <mailto:pve-devel-request@lists.proxmox.com?subject=unsubscribe>
List-Archive: <http://lists.proxmox.com/pipermail/pve-devel/>
List-Post: <mailto:pve-devel@lists.proxmox.com>
List-Help: <mailto:pve-devel-request@lists.proxmox.com?subject=help>
List-Subscribe: <https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel>, 
 <mailto:pve-devel-request@lists.proxmox.com?subject=subscribe>
Reply-To: Proxmox VE development discussion <pve-devel@lists.proxmox.com>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Errors-To: pve-devel-bounces@lists.proxmox.com
Sender: "pve-devel" <pve-devel-bounces@lists.proxmox.com>

Successful boots which crashed somehow and sometime afterwards, will
show the same "until" value ("still running" or timestamp) as the next
following boot(s). The most recent boot from such a sequence of
duplicated "until" lines, has not been crashed or not yet.

Example output where only the boot from 16:25:41 crashed:
 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, it shows the booted/crashed/problematic kernel version.

`last` is also used since currently `journalctl --list-boots` can take
10 seconds or even longer on some systems, with no option to limit the
amount of reported boot lines.

Signed-off-by: Alexander Zeidler <a.zeidler@proxmox.com>
---
v3:
* place the cmd after pveversion due to priority reasons

v2: https://lists.proxmox.com/pipermail/pve-devel/2024-April/063286.html
* move away from dmesg base
* list also recent (5) boot timestamps with additional information

v1: https://lists.proxmox.com/pipermail/pve-devel/2024-March/062342.html


 PVE/Report.pm | 1 +
 1 file changed, 1 insertion(+)

diff --git a/PVE/Report.pm b/PVE/Report.pm
index 73f14744..9a8eaa4b 100644
--- a/PVE/Report.pm
+++ b/PVE/Report.pm
@@ -33,6 +33,7 @@ my $init_report_cmds = sub {
 		'date -R',
 		'cat /proc/cmdline',
 		'pveversion --verbose',
+		'last reboot -F -n5',
 		'cat /etc/hosts',
 		'pvesubscription get',
 		'cat /etc/apt/sources.list',
-- 
2.39.2



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