BigFix pre-execution action script

Hi Team,

I want to execute below script as pre-execution while taking action, Also need info where I can find logs for this scripts when it runs on client…?

This test script, we need to run similar on clients…If this script successful we would run another scripts…Just need to know how to use it…


#/bin/bash
FILE_SYS='ext4’
OPTIONS='default’
BACK_OP=0
FS_CHECK_ORDER=1
for FS in $(df -hPT |egrep -v ‘Filesystem|vxfs|autofs|debugfs|secfs2|tmpfs|devtmpfs|overlay’ |awk ‘{print $7}’ |sort |uniq)
do
FS_FSTAB=$(cat /etc/fstab |egrep -v ‘vxfs|swap|tmpfs|sysfs|debugfs|proc|devpts|auto’ | awk ‘$1 !~/#|^$|swap/ {print $2}’ |grep -E “(^|\s)${FS}($|\s)”)
if [ “$FS” = “$FS_FSTAB” ]
then
:
else
DRIVE_MOUNT=df -h | grep ${FS} | awk '{print $1}'
printf “%-20s%-20s%-10s%-10s%-10s%-10s%-s\n” ${DRIVE_MOUNT} ${FS} ${FILE_SYS} ${OPTIONS} ${BACK_OP} ${FS_CHECK_ORDER} >> /etc/fstab
fi
done

A. You can create simple task with your script but you need to update curly bracket to avoid conflict with BigFix relevance.
B. For logs you need to run your script manually to see where logs are being generated or you can direct the path in script itself or while executing it using BigFix action script.
C. After that you can use it as a pre task in baseline or any method of deployment.

But based on your question i would suggest sync with your BigFix Admin, they will help you to achieve all these steps.

1 Like