Skip to main content
Question

Logging LaunchAgent Script Results with Casper


Forum|alt.badge.img+3

Is there any way to log the results of a login script that is run by a Launch Agent the same way it would be logged if it were deployed as a Login Hook by Casper? I initially set this script up as a Login Hook but the script was only running at login about half the time. As a Launch Agent it runs consistently every time. I know I could have the script create a log elsewhere but I would really like to utilize the powerful logging features of Casper.

5 replies

Forum|alt.badge.img+15
  • Contributor
  • 589 replies
  • August 31, 2016
powerful logging features of Casper

First time I've heard that...

But still, only a JSS policy will log in the JSS. If I needed to accomplish that, I would have my LaunchAgent log to a file, perhaps in /tmp, and then read it in with an EA.


mm2270
Forum|alt.badge.img+16
  • Legendary Contributor
  • 7880 replies
  • August 31, 2016
If I needed to accomplish that, I would have my LaunchAgent log to a file, perhaps in /tmp, and then read it in with an EA.

I think that's about the only way one could do this. You can't tie into a policy's logging functions without actually doing it through a policy. At least not that I'm aware of.


Forum|alt.badge.img+15
  • Contributor
  • 589 replies
  • August 31, 2016

I suppose you could have the launchagent log to /tmp/file then have a policy with 'Files and Processes' -> Execute command -> cat /tmp/file At least then you could get to it via policy logs.


mm2270
Forum|alt.badge.img+16
  • Legendary Contributor
  • 7880 replies
  • August 31, 2016

Hmm, good point. I suppose a policy that scrapes a log and echoes the results would end up putting those contents into the regular policy log. Still, that is, once again, doing it 'through a policy'.


Forum|alt.badge.img+3
  • Author
  • New Contributor
  • 4 replies
  • August 31, 2016
powerful logging features of Casper First time I've heard that...

The word I was thinking of was convenient. I would like to be able to see all of my scripts/policies in one place and be able to quickly verify that they are running as expected. If someone else looks through Casper to see what's running, they'd have no idea that some computers have login scripts because they're done outside of Casper. Has anyone submitted a feature request to utilize Launch Agents instead of Login Hooks for the built in login trigger?


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings