jamfHelper policy reports failure

cwaldrip
Valued Contributor

I'm sure this is an easy one...

I have a simply policy that runs jamfHelper to put a message on the user's screen to call support because their computer is a smart group of machines where smart reporter says their hard drive is failing.

Policy runs the script, script runs on their computer. They have one dialog button they can click. It stays until they click it. All is great.

Except the policy reports that it failed. Looking at the actual log it looks like it's fine. I think that Casper just things that a result of 0 (zero) means a failure, but that's the only button. I'd rather not give them two buttons. :-

Here's the log...
Executing Policy SMART Status Failing Alert...
Running script SMART Status Failure Alert...
Script exit code: 0
Script result: 0

I guess this is just a 'deal with it' situation? O.o

6 REPLIES 6

bvrooman
Valued Contributor

Are you using 'echo 0' or 'exit 0' in your script, or is that 0 coming from the jamfHelper result? If you don't have an exit line, try adding 'exit 0' to the end of the script.

cwaldrip
Valued Contributor

jamfHelper is giving a script exit code of 0. If I had two buttons (button 0 and button 1) I'd get either 0 or 1 depending on the button returned I guess, but I don't want a binary answer, I just want confirmation that they've seen the message.

The script I'm using is basically this...

#!/bin/bash
/Library/Application Support/JAMF/bin/jamfHelper.app/Contents/MacOS/jamfHelper -windowType hud -title "S.M.A.R.T. Status Alert" -description "WARNING. It appears that your hard drive may be failing.

Please contact Support at -snip- so that we can verify and resolve the issue.

You should also take a few minutes and copy any important files from this computer to an external hard drive in the mean time just in case this is not a false alarm." -button1 "I Understand" -alignDescrtiption center

I guess for this one we'll just live with the 'failed' status. Hmm. :

bentoms
Release Candidate Programs Tester

@cwaldrip, does it have to be JAMFHelper? You should be able to do this via AppleScript (or rather OSAScript in bash).

Or you could add an "exit 0" to the script so it always returns as succesful.

bvrooman
Valued Contributor

Add a line right below that jamfHelper command that says "exit 0" - that has always worked for me, and continues to work for at least a dozen of the user-interaction scripts that we have in our setup.

cwaldrip
Valued Contributor

Thanks for the suggestions, but even with exit 0, the JSS shows the policy executing this script fails.

#!/bin/bash
/Library/Application Support/JAMF/bin/jamfHelper.app/Contents/MacOS/jamfHelper -windowType hud -title "S.M.A.R.T. Status Alert" -description "WARNING. It appears that your hard drive may be failing.

Please contact DNG Support yadda yadda yadda.

You should also take a few minutes and copy any important files from this computer to an external hard drive in the mean time just in case this is not a false alarm." -button1 "I Understand" -alignDescrtiption center

exit 0

Also tried exit 1, but that obviously shows as a failure. I guess it has to do with only having one button for the response? :-

merps
Contributor III

@cwaldrip According to this post this is happening because your output contains the word "fail"

Executing Policy SMART Status Failing Alert...
Running script SMART Status Failure Alert...

I've recently come across this issue, too, getting exit 0 and false failures. Apparently there has been a planned removal of the output checking, but it has yet to happen. What happens if you change the name of your policies to not include the word "error" or "fail"?