Export statistics data

Sommer

Member
Jun 7, 2018
47
8
8
39
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
 
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: 33
  • stat2.jpg
    stat2.jpg
    60.4 KB · Views: 27
  • stat3.jpg
    stat3.jpg
    48.2 KB · Views: 24
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.
 
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.