Posted on 05-20-2015 06:48 AM
I’ve recently created a script to report various system/status settings on a group of machines, which I can then study via the policy logs in Casper. To improve the readability of the output I’ve incorporated some switches to add tabs and new lines in appropriate places. This works well if I run the script locally and output to text file, but, when the script is run via Casper some of the formatting is ignored in the logs – e.g. printf and echo –e switches. I’ve spoken with tech support and it appears that this formatting is not supported via Casper logs.
Has anyone else found this to be a problem and/or found a way around it – other than outputting to text files and uploading to the JSS?
Posted on 05-20-2015 06:57 AM
Yeah, I've run across this as well. One of the scripts I've built does a fair amount of logging that gets uploaded later into the policy log. The log entries have tabs for indenting in certain places in order to create some visual "grouping" of related log items. When I run the script in Terminal, even if using sudo jamf runScript -script "script.sh" -path /path/to/script/, etc, I see the formatting show correctly. But when run out of a policy, it gets ignored in the log that I view in the JSS, just as you stated.
TBH, earlier versions of Casper even ignored line breaks, which made for some seriously ugly logs in the JSS - long run on lines - so at this point, I'm glad to have proper line breaks and just live with the fact that it doesn't respect some of the special formatting I've put into my scripts. It would be great if JAMF could make it respect them, but its not a deal breaker for me personally.
Posted on 05-21-2015 08:50 AM
I'm glad to see someone else has noticed this. I may resort to outputting to text files on the distribution point. It's not crucial, but it does enhance the reporting potential.
Posted on 05-21-2015 02:23 PM
Hah!
I'd never really noticed they were including the line breaks now! Time to go back through all my old scripts and remove all the "---" I was putting in to seperate everything!
They were hideous before for long scripts with lots of logging.