Merge branch 'ent-10583-Script-pandora-diagnostic-sh' into 'develop'

search of my.cnf pandora_diagnostic script

See merge request artica/pandorafms!5804
This commit is contained in:
Matias Didier 2023-05-25 12:25:10 +00:00
commit 8dd14576ee
1 changed files with 11 additions and 1 deletions

View File

@ -48,7 +48,17 @@ ps aux | grep pandora >> $OUTFILE
echo "-----------------------------------------------------------------" >> $OUTFILE
echo "MySQL Configuration file" >> $OUTFILE
echo "-----------------------------------------------------------------" >> $OUTFILE
cat /etc/mysql/my.cnf >> $OUTFILE
# Search for my.cnf file in directories in order (search in root /etc if it was not found in previous paths)
MY_CNF=$(find /etc/mysql /usr/local/mysql /usr/local/etc /etc -name my.cnf 2>/dev/null | head -n 1)
# Check if my.cnf file was found
if [ -z "$MY_CNF" ]; then
echo "ERROR: my.cnf file not found."
exit 1
fi
cat $MY_CNF >> $OUTFILE
echo "-----------------------------------------------------------------" >> $OUTFILE
echo "Pandora FMS Server Configuration file" >> $OUTFILE