Problems of virtual machine traffic statistics

the 'status' api call contains a field for each nic with 'netin' and 'netout' e.g.

Code:
qm status 100 --verbose

Code:
nics:
        tap100i0:
                netin: 115745307
                netout: 482164

note that this field resets when the vm is shutdown
 
the 'status' api call contains a field for each nic with 'netin' and 'netout' e.g.

Code:
qm status 100 --verbose

Code:
nics:
        tap100i0:
                netin: 115745307
                netout: 482164

note that this field resets when the vm is shutdown
Can we not reset it?
 
Can we not reset it?
You might want to build a queue with two values. One for longterm and one for last boot. In the last boot queue you always overwrite with the currently measured value. If the last measured value is zero or lower than whats stored in the last boot queue, add last boot to the longterm qeue and reset the last boot queue to zero.
Your grand total will then be the sum of the last boot and longterm value.
 

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!