Tracking Center not in sync

kyles2013

New Member
Jul 29, 2018
9
0
1
25
\r is a line return I believe? I have gone ahead and deleted everything from the script and manually typed it out and it still references the same error.
head: invalid number of lines: ‘1\r’
I ran dos2unix on the file and the /r is now no longer in the file and the tracking center is now showing messages from all nodes!!! Thank you Sommer for all your help!
 
Jan 21, 2017
292
38
33
31
Berlin
I am interested to put the script on Github. Others can access it and we can track changes and possible different option to use it.
Automated setup scripts is also possible by hosting it there.
 

Sommer

Member
Jun 7, 2018
47
6
8
34
I am interested to put the script on Github. Others can access it and we can track changes and possible different option to use it.
Automated setup scripts is also possible by hosting it there.
You have my blessing ;)
 

Juliano Silva

Member
Oct 15, 2017
182
2
23
36
I woke up with a better solution.
Instead of copying logs from one server to another, messing up the files, I created my "own" pmg-log-tracker.

First you need to rename /usr/bin/pmg-log-tracker to something else, example pmg-log-tracker-default, on server Master and Node.

Then create /usr/bin/pmg-log-tracker script
Code:
/usr/bin/pmg-log-tracker-default "$@" | head -n -1
ssh root@serverNODE /usr/bin/pmg-log-tracker-default "$@" | sed '/^#/ d'
"$@" is to pass all arguments to script
-v -l 2000 -s 1531882800 -e 1531969200 -n -g -f gmail.com
head -n -1 is to remove last line of first search results
STATUS: aborted by limit (too many hits)
sed '/^#/ d' is to remove the header parameters of second search results
# LogReader: 19220
# Query options
# Start: 2018-07-18 00:00:00 (1531872000)
# END: 2018-07-18 16:20:45 (1531930845)
# End Query Options
These filters are needed because PERL script that processes results failed with that unexpected characters.
Does it work for the latest version?
 

Juliano Silva

Member
Oct 15, 2017
182
2
23
36
I woke up with a better solution.
Instead of copying logs from one server to another, messing up the files, I created my "own" pmg-log-tracker.

First you need to rename /usr/bin/pmg-log-tracker to something else, example pmg-log-tracker-default, on server Master and Node.

Then create /usr/bin/pmg-log-tracker script
Code:
/usr/bin/pmg-log-tracker-default "$@" | head -n -1
ssh root@serverNODE /usr/bin/pmg-log-tracker-default "$@" | sed '/^#/ d'
"$@" is to pass all arguments to script
-v -l 2000 -s 1531882800 -e 1531969200 -n -g -f gmail.com
head -n -1 is to remove last line of first search results
STATUS: aborted by limit (too many hits)
sed '/^#/ d' is to remove the header parameters of second search results
# LogReader: 19220
# Query options
# Start: 2018-07-18 00:00:00 (1531872000)
# END: 2018-07-18 16:20:45 (1531930845)
# End Query Options
These filters are needed because PERL script that processes results failed with that unexpected characters.
How does it work for 2 nodes?

/usr/bin/pmg-log-tracker-default "$@" | head -n -1
ssh root@serverNODE -1 /usr/bin/pmg-log-tracker-default "$@" | sed '/^#/ d'
ssh root@serverNODE-2 /usr/bin/pmg-log-tracker-default "$@" | sed '/^#/ d'
 

Sommer

Member
Jun 7, 2018
47
6
8
34
How does it work for 2 nodes?

/usr/bin/pmg-log-tracker-default "$@" | head -n -1
ssh root@serverNODE -1 /usr/bin/pmg-log-tracker-default "$@" | sed '/^#/ d'
ssh root@serverNODE-2 /usr/bin/pmg-log-tracker-default "$@" | sed '/^#/ d'
Exactly
 

JoshuaSign

New Member
Oct 5, 2019
3
0
1
19
Many thanks for this solution, it works !

I just add parameters to ssh :
-o ConnectTimeout=2 -o ConnectionAttempts=1
it avoid latency in tracker if a node is down.
 

dallenk

New Member
Dec 19, 2019
7
1
3
44
Hello, I've read this about 15 times but I just can't wrap my mind around the scripts.. I am testing three nodes in a cluster and I thought centralized tracking would have been part of it, but learned it wasn't.

Do I put a duplicate copy of the script on all servers, or the master only?? or modify each script to point to the other two?
I think i need to rename pmg-log-tracker to pmg-log-tracker-default on all systems.

the create the script on each node like:

master - (in /usr/bin/pmg-log-tracker)
Code:
/usr/bin/pmg-log-tracker-default "$@" | head -n -1
ssh root@serverNODE_1 /usr/bin/pmg-log-tracker-default "$@" | sed '/^#/ d'
ssh root@serverNODE_2 /usr/bin/pmg-log-tracker-default "$@" | sed '/^#/ d'
node_1 - (in /usr/bin/pmg-log-tracker)
Code:
/usr/bin/pmg-log-tracker-default "$@" | head -n -1
ssh root@serverMASTER /usr/bin/pmg-log-tracker-default "$@" | sed '/^#/ d'
ssh root@serverNODE_2 /usr/bin/pmg-log-tracker-default "$@" | sed '/^#/ d'
node_2 - (in /usr/bin/pmg-log-tracker)
Code:
/usr/bin/pmg-log-tracker-default "$@" | head -n -1
ssh root@serverMASTER /usr/bin/pmg-log-tracker-default "$@" | sed '/^#/ d'
ssh root@serverNODE_1 /usr/bin/pmg-log-tracker-default "$@" | sed '/^#/ d'
If I add an additional node later, I just add NODE_3 to each of the original, and on NODE_3
Code:
/usr/bin/pmg-log-tracker-default "$@" | head -n -1
ssh root@serverMASTER /usr/bin/pmg-log-tracker-default "$@" | sed '/^#/ d'
ssh root@serverNODE_1 /usr/bin/pmg-log-tracker-default "$@" | sed '/^#/ d'
ssh root@serverNODE_2 /usr/bin/pmg-log-tracker-default "$@" | sed '/^#/ d'

is that correct?

Thanks!
 

JamesStockwell

New Member
Apr 1, 2020
6
1
3
27
To say i have just installed a 3 node cluster and added the script to do tracking across all nodes.
I had to run the below commands in an SSH session on each of the servers (connecting to each of the others) which prompted an SSH Thumbprint accept option in each of the sessions. Once I had done that it all worked without any problems. It wasn't showing me an error on the page before this, it just wouldn't work...

ssh root@serverMASTER /usr/bin/pmg-log-tracker-default -l 1
 

JamesStockwell

New Member
Apr 1, 2020
6
1
3
27
Hello, I've read this about 15 times but I just can't wrap my mind around the scripts.. I am testing three nodes in a cluster and I thought centralized tracking would have been part of it, but learned it wasn't.

Do I put a duplicate copy of the script on all servers, or the master only?? or modify each script to point to the other two?
I think i need to rename pmg-log-tracker to pmg-log-tracker-default on all systems.

the create the script on each node like:

master - (in /usr/bin/pmg-log-tracker)
Code:
/usr/bin/pmg-log-tracker-default "$@" | head -n -1
ssh root@serverNODE_1 /usr/bin/pmg-log-tracker-default "$@" | sed '/^#/ d'
ssh root@serverNODE_2 /usr/bin/pmg-log-tracker-default "$@" | sed '/^#/ d'
node_1 - (in /usr/bin/pmg-log-tracker)
Code:
/usr/bin/pmg-log-tracker-default "$@" | head -n -1
ssh root@serverMASTER /usr/bin/pmg-log-tracker-default "$@" | sed '/^#/ d'
ssh root@serverNODE_2 /usr/bin/pmg-log-tracker-default "$@" | sed '/^#/ d'
node_2 - (in /usr/bin/pmg-log-tracker)
Code:
/usr/bin/pmg-log-tracker-default "$@" | head -n -1
ssh root@serverMASTER /usr/bin/pmg-log-tracker-default "$@" | sed '/^#/ d'
ssh root@serverNODE_1 /usr/bin/pmg-log-tracker-default "$@" | sed '/^#/ d'
If I add an additional node later, I just add NODE_3 to each of the original, and on NODE_3
Code:
/usr/bin/pmg-log-tracker-default "$@" | head -n -1
ssh root@serverMASTER /usr/bin/pmg-log-tracker-default "$@" | sed '/^#/ d'
ssh root@serverNODE_1 /usr/bin/pmg-log-tracker-default "$@" | sed '/^#/ d'
ssh root@serverNODE_2 /usr/bin/pmg-log-tracker-default "$@" | sed '/^#/ d'

is that correct?

Thanks!
You add it to the originals. You don't need to include the SSH to its own server as the first line is its own server, so you only need to include the SSH lines to other servers in the cluster (host or node) just not iteslf.

edit: I have re-read your post, yes as you say at the end, add NODE3 to each of the others including host, but dont include the NODE3 line on the new server as that is covered by the first line of the file.
 

Matas

New Member
May 7, 2020
2
0
1
31
Hello, what about pmg 6.2-3 version?
i have checked that file
Code:
nano /usr/bin/pmg-log-tracker
and didn't find any ssh code
what i have found is

Code:
^?ELF^B^A^A^@^@^@^@^@^@^@^@^@^C^@>^@^A^@^@^@��^@^@^@^@^@^@@^@^@^@^@^@^@^@��^O^@^@^@^@^@^@^@^@^@@^@8^@^L^@@^@ ^@^_^@^F^@^@^@^D^@^@^@@^@^@^@^@^@^@^@@^@^@^@^@^@^@^@@^@^@^@^@^@^@^@�^B^@^@^@^@^@^@�^B^@^@^@^@^@^@^H^@$
^@^@^@^@^@`!
^@^@^@^@^@`!
^@^@^@^@^@,<^@^@^@^@^@^@,<^@^@^@^@^@^@^D^@^@^@^@^@^@^@Q�td^F^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^P^@^@^@^@^@^@^@R�td^D^@^@^@P>^O^@^@^@^@^@PN^O^@^@^@^@^@PN^O^@^@$
^@#���u�
q��|���^\Z�;^O���|]�l^O}�^Q^O�^N�=���^N1��
^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@
 

JamesStockwell

New Member
Apr 1, 2020
6
1
3
27
Hello, what about pmg 6.2-3 version?
i have checked that file
Code:
nano /usr/bin/pmg-log-tracker
and didn't find any ssh code
what i have found is

Code:
^?ELF^B^A^A^@^@^@^@^@^@^@^@^@^C^@>^@^A^@^@^@��^@^@^@^@^@^@@^@^@^@^@^@^@^@��^O^@^@^@^@^@^@^@^@^@@^@8^@^L^@@^@ ^@^_^@^F^@^@^@^D^@^@^@@^@^@^@^@^@^@^@@^@^@^@^@^@^@^@@^@^@^@^@^@^@^@�^B^@^@^@^@^@^@�^B^@^@^@^@^@^@^H^@$
^@^@^@^@^@`!
^@^@^@^@^@`!
^@^@^@^@^@,<^@^@^@^@^@^@,<^@^@^@^@^@^@^D^@^@^@^@^@^@^@Q�td^F^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^P^@^@^@^@^@^@^@R�td^D^@^@^@P>^O^@^@^@^@^@PN^O^@^@^@^@^@PN^O^@^@$
^@#���u�
q��|���^\Z�;^O���|]�l^O}�^Q^O�^N�=���^N1��
^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@
You missed a step I believe. You need to rename the file

pmg-log-tracker to pmg-log-tracker-default
then make a file pmg-log-tracker with the SSH scripts in it.
 

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!