gluster-health-report icon indicating copy to clipboard operation
gluster-health-report copied to clipboard

gfid-mismatch-dht-report.py : Avoid hardcoding of log file location

Open PrasadDesala opened this issue 6 years ago • 0 comments

We should be sending the log file location as an arg or some other way instead of hard coding in the py file. Also, with the current code gfid-mismatch-dht-report.py is passing though it failed to get the log file location. We are checking for , { output >0 --> Mismatch of gfid else: ctx.ok("no gfid mismatch")

Output of the command is is returning 0 when it failed , hence the script is passing with "no gifd mismatch". May be we should add some check first if the log file is present then grep for the string.

Output snip:

grep 'gfid differs' /var/log/glusterfs/mnt.log | grep -v grep | wc -l grep: /var/log/glusterfs/mnt.log: No such file or directory 0

gluster-health-report --run-only gfid-mismatch-dht-report

Loaded reports: gfid-mismatch-dht-report

[ OK] no gfid mismatch

PrasadDesala avatar Jul 25 '18 11:07 PrasadDesala