BigFix Task to run a Linux Command

I am not a Linux guru by any means nor am I that good at action scripts. I know enough to get myself in trouble :slight_smile: That being said, I have Splunk servers that are load-balanced so before patching three of them I need to run /usr/share/heartbeat/hb_standby. I believe I should be using a task so correct me if I am incorrect.

I have a very simple task

// Enter your action script here
if {name of operating system contains “Linux”}
run /usr/share/heartbeat/hb_standby
endif

I have no idea if it really runs. The way I know it runs at the console is the response comes back as “Going Standby [all]” on the console. It sates it completes on the Linux server but I also ran it against a windows server and it states that it completed. I would assume with the if statement it should not apply to the windows server and fail or not relavent.

I also have to run this command with elevated privileges. I would assume that I would need to pass the creds in the action script or create an script to run on the linux server.

Any help is appreciated.

Tailing the BigFix log

sudo tail -f /var/opt/BESClient/__BESData/__Global/Logs/`date +“%Y%m%d”`.log

The windows box gets to the if statement which reports false, skips on to the endif and carries on - so it does exactly what you told it and did complete successfully.

If you don’t want it to be run at all on a windows box, either put that in the relevance or add a line near the start of the script

continue if {name of operating system contains “Linux”}

an errant invocation on a Windows box will just fail the action

Thanks I will give this a try