darold / pgcluu

PostgreSQL Cluster performances monitoring and auditing tool
http://pgcluu.darold.net/
PostgreSQL License
336 stars 45 forks source link

pgcluu_collectd fails if the output_dir contains spaces #138

Closed Krysztophe closed 2 years ago

Krysztophe commented 2 years ago

I know, this is not a good idea, but theses things happen:

$ /opt/pgcluu/pgcluu_collectd   -v  --pid-file='/tmp/p i d/pgcluu collectd.pid'  "/tmp/aa bb/toto tutu"
LOG: Setting retention from configuration file to 30

*** pgcluu_collectd v3.2 (pid:1645445) started at Tue Feb  1 17:37:29 2022
Type Ctrl+c to quit.

grep: bb/toto: Aucun fichier ou dossier de ce type
grep: tutu/sar_stats.dat: Aucun fichier ou dossier de ce typegrep: bb/toto
: Aucun fichier ou dossier de ce type
grep: tutu/pidstat_stats.dat: Aucun fichier ou dossier de ce type
^CLOG: Received terminating signal INT.

This seems to work for the pid-file.

There are so many things to check that I gave up a real patch to correct it. Is it really worth it? I'll do a quick PR to add a clean error.

Krysztophe commented 2 years ago

Details:

psql:<stdin>:42: erreur : n'a pas pu écrire les données du COPY : Relais brisé (pipe)
cat: bb/toto: Aucun fichier ou dossier de ce type
cat: tutu/pg_stat_locks.csv: Aucun fichier ou dossier de ce type
ng-pe commented 2 years ago

Hello Krysztophe

I think the problem is in : \\o | cat $FILE_REDIR $OUT_DIR/$file_output Should we add single quotes?

\\o | cat $FILE_REDIR '$OUT_DIR/$file_output' Edit : Only quote '$OUT_DIR/$file_output' works :)

https://github.com/ng-pe/pgcluu/commit/161da1973e18a24753e591191046ed7680b2f6c4

regards,

Krysztophe commented 2 years ago

@ng-pe : Last results from you branch: there is still a problem while copying the *.conf files, around line 1087.

ng-pe commented 2 years ago

Fixed whith other : https://github.com/ng-pe/pgcluu/commits/fix-138

Krysztophe commented 2 years ago

@ng-pe : OK for a local execution

Still KO for an ssh access ; I'm looking...

Krysztophe commented 2 years ago

My mistake, that seems to work through ssh too.

I've found there is still a problem in System/Devices when a device has a space in it, as //mafreebox.freebox.fr/Disque dur, the report is lost, but I don't think that it matters in real life :smile:

ng-pe commented 2 years ago

WIP : https://github.com/ng-pe/pgcluu/commit/32216d9cb16b0383c323c63876908e87614f4fef Add fix in pgcluu.

ng-pe commented 2 years ago

Hi, New merge request for this issue ;)