Tracking Center from command line

tuxevil

Member
Jul 5, 2021
19
0
6
42
Hi everyone, Im using PMG in a production enviroment since january, and im really happy with it.
Now im trying to improve (automate if posible) my daily workflow, about monitoring the tracking center, looking for quarentine mails and most important, rejected mails.
I have found several spoofing attemps, and I have being adding each IP to my firewall's source ip blacklist manually every time. But i would like to automate it somehow.
My first step would be to get the info, in the command line, not using the webui, that requires me to interact with it.

I found the pmgsh command, but there is little to no documentation about the options, and even checking by myself each option, I couldnt find where to look for the tracking center info.

Can someone give me a hint, where to start?

Thanks
 
if i do get /nodes/{node}/tracker
i get all the mails of the last 24h
but when i do get /nodes/{node}/tracker -starttime 3 or whatever number
i get a 200 OK [ ] in response
what im doing wrong?
i wanted to see all the mails from the last 3 days
 
Last edited:
'starttime' is a unix epoch, not the number of days.

setting it to '3' sets the starttime to '00:00:03 01.01.1970'
the default 'endtime' is the starttime +1 day

so for the last 3 days, you have to use the unix epoch of 3 days ago. e.g. the unix epoch of 7:36 29.03.2022 (CET) is '1648532160'
 
'starttime' is a unix epoch, not the number of days.

setting it to '3' sets the starttime to '00:00:03 01.01.1970'
the default 'endtime' is the starttime +1 day

so for the last 3 days, you have to use the unix epoch of 3 days ago. e.g. the unix epoch of 7:36 29.03.2022 (CET) is '1648532160'
Oh, ok, thanks for clarifing it