Report back custom data field?

NullPointer
New Contributor III

Is there a way to store script output back to Jamf? Is it possible to do it in a way that is searchable?

I would like to be able to create a Computer Search for "firewall disabled".

To get the data, I could call socketfilterfw --getglobalstate in a script and report the output back to Jamf.

Is this possible?

Thank you!

1 ACCEPTED SOLUTION

KatieE
Contributor
Contributor

Hi @NullPointer - yup, you're looking for a Computer Extension Attribute Populated by a Script.

What you describe would look something like

#!/bin/sh
echo "<result>$(/usr/libexec/ApplicationFirewall/socketfilterfw --getglobalstate)</result>"

But you'd likely want to parse that output a bit:

#!/bin/sh
echo "<result>$(/usr/libexec/ApplicationFirewall/socketfilterfw --getglobalstate| awk '{print $3}' | sed 's/.$//')</result>"

View solution in original post

2 REPLIES 2

KatieE
Contributor
Contributor

Hi @NullPointer - yup, you're looking for a Computer Extension Attribute Populated by a Script.

What you describe would look something like

#!/bin/sh
echo "<result>$(/usr/libexec/ApplicationFirewall/socketfilterfw --getglobalstate)</result>"

But you'd likely want to parse that output a bit:

#!/bin/sh
echo "<result>$(/usr/libexec/ApplicationFirewall/socketfilterfw --getglobalstate| awk '{print $3}' | sed 's/.$//')</result>"

NullPointer
New Contributor III

Thank you @kenglish ! I didn't realize Computer Extension Attributes existed, this opens so many doors!