Export statistics data

Sommer

Member
Jun 7, 2018
47
6
8
35
Greetings,
Is there a way to export statistics data from PMG to csv file?
I need the kind of information like proxmox status report mail.
Maybe a sql query.
Thanks
 

Sommer

Member
Jun 7, 2018
47
6
8
35
what do you mean? can you give an example?
Sure. From cli, gets these results running -day 6 -month 8.
Code:
# pmgsh get statistics/mail -day 6 -month 8
200 OK
{
   "avptime" : 3.36122643455145,
   "bounces_in" : 676,
   "bounces_out" : 0,
   "bytes_in" : 1192195456,
   "bytes_out" : 1167700480,
   "count" : 26769,
   "count_in" : 21169,
   "count_out" : 5600,
   "glcount" : 0,
   "junk_in" : 12654,
   "junk_out" : 0,
   "pregreet_rejects" : 4353,
   "rbl_rejects" : 6052,
   "spamcount_in" : 2160,
   "spamcount_out" : 0,
   "spfcount" : 89,
   "viruscount_in" : 0,
   "viruscount_out" : 0
}

However, check screenshots for 2018 August 6. The numbers are not the same.
 

Attachments

  • stat1.jpg
    stat1.jpg
    70.2 KB · Views: 11
  • stat2.jpg
    stat2.jpg
    60.4 KB · Views: 10
  • stat3.jpg
    stat3.jpg
    48.2 KB · Views: 7

dcsapak

Proxmox Staff Member
Staff member
Feb 1, 2016
4,822
479
103
32
Vienna
there seems to be a bug, the 'day' parameter is currently ignored, i will try to send a patch for this

for now you can use 'starttime' and 'endtime' in combination with 'date -d "2018-08-06" +%s' etc.
 

Sommer

Member
Jun 7, 2018
47
6
8
35
there seems to be a bug, the 'day' parameter is currently ignored, i will try to send a patch for this

for now you can use 'starttime' and 'endtime' in combination with 'date -d "2018-08-06" +%s' etc.
Thank you, Dominik. I got yesterday results (2018-08-07) with pmgsh get statistics/mail -starttime 1533610800 -endtime 1533697200
I will wait for the fix.
Thanks again.
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE 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 your own in 60 seconds.

Buy now!