I am trying to combine a Bigfix Action script with a few Linux shell commands to install a customized nagios agent. The problem I am encountering is that the agent does not seem to untar the .tar file correctly. It reports an exit code of zero in the log when I view it but does not actually extract the file. The alternative would be to use a pure shell script and manually cache the tar file but I can’t seem to find the correct location for using wget. I know that files that are uploaded are usually found here: http://bigfixserver:52311/Uploads/Shavalue/filename but for files in the download folder I tried http://bigfixserver:52311/downloads/Sha1/filename without success. I swore that the fixlet worked in the past extracting the tar file but maybe it was wishful thinking
As a best practice we do not perform actions against artifacts in the action site path on endpoints. Instead we move the artifact to /tmp or some other filesystem, chmod/chown it as needed and then perform the necessary actions.
If your commands still fail, you may have to su to root to make the full environment available to the action in question. For example:
It seems that when using Bigfix action script language that I have to explicitly state the location to untar the file instead of untaring in the current working directory.
I was looking for it to be in the /tmp folder following a move command to move it from the __Dowload folder. Oddly enough the logs report that the tar command returns an exit code 0 but nothing happens. I found on another forum post that using -C to explicitly state the directory to untar performed as intended.
I think you will find if there are commands with any real output, you should use “wait /bin/bash” (or sh) to get the output you want. Even if you wanted to use something like “echo testing > /tmp/somefile.txt”, you would still need to prefix the action script command with sh -c “your command”. Never really figured out why, but standard output doesn’t work well unless you use a shell environment.