Logging LaunchAgent Script Results with Casper

tkersting
New Contributor II

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 5

thoule
Valued Contributor II
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
Legendary Contributor III
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.

thoule
Valued Contributor II

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
Legendary Contributor III

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'.

tkersting
New Contributor II
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?