Export statistics data

Discussion in 'Mail Gateway: Installation and configuration' started by Sommer, Aug 3, 2018.

  1. Sommer

    Sommer Member

    Joined:
    Jun 7, 2018
    Messages:
    42
    Likes Received:
    3
    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
     
  2. Sommer

    Sommer Member

    Joined:
    Jun 7, 2018
    Messages:
    42
    Likes Received:
    3
    Anyone?
     
  3. dcsapak

    dcsapak Proxmox Staff Member
    Staff Member

    Joined:
    Feb 1, 2016
    Messages:
    2,390
    Likes Received:
    212
  4. Sommer

    Sommer Member

    Joined:
    Jun 7, 2018
    Messages:
    42
    Likes Received:
    3
  5. dcsapak

    dcsapak Proxmox Staff Member
    Staff Member

    Joined:
    Feb 1, 2016
    Messages:
    2,390
    Likes Received:
    212
    what do you mean? can you give an example?
     
  6. Sommer

    Sommer Member

    Joined:
    Jun 7, 2018
    Messages:
    42
    Likes Received:
    3
    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.
     

    Attached Files:

  7. dcsapak

    dcsapak Proxmox Staff Member
    Staff Member

    Joined:
    Feb 1, 2016
    Messages:
    2,390
    Likes Received:
    212
    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.
     
  8. Sommer

    Sommer Member

    Joined:
    Jun 7, 2018
    Messages:
    42
    Likes Received:
    3
    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.
     
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice