Wrong uptime on LXC Zabbix

Kyar

New Member
Sep 9, 2022
29
0
1
Hello

I have a problem with Zabbix and my LXC servers.

All works exeptly the boottime.

When I restart my Proxmox and LXC the first date is correct.

But if I have restart only a LXC server the boottime never change.

My proxmox date :

Code:
root@PROXMOX:~# date
lun. 06 févr. 2023 16:13:53 CET

My zabbix time :

Code:
root@ZABBIX:~# date
lun. 06 févr. 2023 16:14:57 CET
root@ZABBIX:~#

And my LXC server :

Code:
root@MESHCENTRAL:~# date
lun. 06 févr. 2023 16:15:17 CET

All other server works (ubuntu, raspbian) but only LXC don't works.

Anyone have one idea ?
 
Hello

I have a problem with Zabbix and my LXC servers.

All works exeptly the boottime.

When I restart my Proxmox and LXC the first date is correct.

But if I have restart only a LXC server the boottime never change.

My proxmox date :

Code:
root@PROXMOX:~# date
lun. 06 févr. 2023 16:13:53 CET

My zabbix time :

Code:
root@ZABBIX:~# date
lun. 06 févr. 2023 16:14:57 CET
root@ZABBIX:~#

And my LXC server :

Code:
root@MESHCENTRAL:~# date
lun. 06 févr. 2023 16:15:17 CET

All other server works (ubuntu, raspbian) but only LXC don't works.

Anyone have one idea ?
Hi,
appologies if I might misunderstand your question, but the output of date shows the current time as seen from the respective context. So what exactly is not correct? Are you referring to the uptime as seen in the LXC?
 
Hi,
appologies if I might misunderstand your question, but the output of date shows the current time as seen from the respective context. So what exactly is not correct? Are you referring to the uptime as seen in the LXC?

For example :


Code:
root@REVERSE-PROXY:~# who -b
         démarrage système 2023-02-06 17:54
root@REVERSE-PROXY:~# uptime
 17:56:41 up 2 min,  1 user,  load average: 1,61, 1,73, 1,95
root@REVERSE-PROXY:~#

And on my Zabbix :

Code:
REVERSE-PROXY
    
OS: boot time
    3m 48s    06/02/2023 15:29:58       
    Graphique   
    
REVERSE-PROXY
    
OS: time
    48s    06/02/2023 17:57:21    +00:01:00   
    Graphique   
    
REVERSE-PROXY
    
OS: uptime
    3m 48s    02:24:23    +00:02:38

The boottime never change only on LXC server (and uptime too)
 
I am still not sure i get your point, can you please post the output of uptime; pct enter <ID> uptime executed on the host and <ID> replaced by the ID of your Zabbix container.
 
I am still not sure i get your point, can you please post the output of uptime; pct enter <ID> uptime executed on the host and <ID> replaced by the ID of your Zabbix container.
Mhmm :


Code:
root@PROXMOX:~# uptime
 18:46:01 up  3:16,  1 user,  load average: 1,66, 1,75, 1,86
root@PROXMOX:~# pct enter 108 uptime
400 too many arguments
pct enter <vmid>

My zabbix is on a LXC container with 108 ID
I have error or I have make a mistake ?
 
I have error or I have make a mistake ?
Sorry, typo on my side: uptime; pct exec <ID> uptime is what i intended. so in your case uptime; pct exec 108 uptime
 
So,

Code:
root@PROXMOX:~# uptime; pct exec 108 uptime
 08:04:35 up 16:34,  1 user,  load average: 1,88, 1,75, 1,80
 08:04:36 up 16:33,  0 users,  load average: 1,88, 1,75, 1,80

For example :

Code:
root@MESHCENTRAL:~# who -b
         démarrage système 2023-02-06 18:13

System start at 18:13 on 2023-02-06 and on my Zabbix :

1675753632669.png

You can see the boot time is 15:29:58 and not 18:13

Code:
root@PROXMOX:~# uptime; pct exec 106 uptime
 08:08:29 up 16:38,  1 user,  load average: 2,01, 1,95, 1,87
 08:08:30 up 13:54,  0 users,  load average: 2,01, 1,95, 1,87

Do you understand my problem now ?
 
Last edited:
So,

Code:
root@PROXMOX:~# uptime; pct exec 108 uptime
 08:04:35 up 16:34,  1 user,  load average: 1,88, 1,75, 1,80
 08:04:36 up 16:33,  0 users,  load average: 1,88, 1,75, 1,80

For example :

Code:
root@MESHCENTRAL:~# who -b
         démarrage système 2023-02-06 18:13

System start at 18:13 on 2023-02-06 and on my Zabbix :

View attachment 46495

You can see the boot time is 15:29:58 and not 18:13

Code:
root@PROXMOX:~# uptime; pct exec 106 uptime
 08:08:29 up 16:38,  1 user,  load average: 2,01, 1,95, 1,87
 08:08:30 up 13:54,  0 users,  load average: 2,01, 1,95, 1,87

Do you understand my problem now ?
Okay I see, so how exactly did you reboot the Zabbix container? Does the container show the correct uptime after a pct reboot 108? What about after a pct shutdown 108 and pct start 108?
 
Hi i just realized the same issue, the LXC is reporting same uptime as the hypervisor. pct shutdown/start wont help.
 
  • Like
Reactions: tunasalad

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!