Nobody? Anybody? Again, some of my questions:
1. In NSH Script Jobs, we can spit messages to stdout and stderr. Can we also output warnings?
2. Can we mark an NSH Script Job result (per job or per target) as a warning?
3. I've tried #3 in version 6.3.0; we cannot mark individual targets within centrally-run NSH Script Jobs with success or failure. The targets take on the same success or failure as the overall job, even if you try to echo out an "Exit Code 0" or "Exit Code 1".
To the best of my knowledge, you can't do this. I don't believe we've ever been able to do it though (even with ExitCode checking), though I could be wrong there.
It's been the nature of the beast that this is one of the drawbacks to using a type 2 script over a type 1 script.
That along with the lack of speed due to sequential execution against multiple hosts.
Personally, I've found that I tend to use batch jobs more than type 2 script. Perform all looping functionality in the runscript-based job and perform any centralized pre- or post-work in other subjobs.
Have you tried echoing the words 'error' or 'warning'?
Not sure this works, but I'm sure something like this works.
I'll often pipe things to stderr to create errors (i.e. print "ERROR: blah" 1>&2), but that's the best I can do. I definitely have tried
print "($HOST_NAME) Exit Code 1" and things like that.
We're on 6.2. I have never been able to return script exit codes to the bladelogic job that ran the script. When we first purchased bladelogic we had high hopes for auditing from the perspective of being able to detect failed/aborted script execution. We've now learned that a failed 'X' doesn't mean anything (could be that one host of 100 was unreachable) and a successful 'checkmark' doesn't mean anything (the script that was called completely failed: exit 1). For type 2 scripts bladelogic is just cron with a GUI. We use it because it centralizes our logging. Hopefully, this will change in later releases.
Well I would disagree a bit; both the red X and the green checkmark mean something.
Red X (runscript): At least one host failed.
Red X (type 2): Overall job failed.
Green checkmark (runscript): All hosts passed.
Green checkmark (type 2): Overall job succeeded.
We generally recommend using the runscript-based NSH Script Jobs when you can, as they do a better job of segmenting the logging and such. But in cases where that's not possible for whatever reason, the type 2 option provides an ample fallback.