Skip to content

Commit

Permalink
"Cleaned up" by properly encoding the Extension Attributes for import…
Browse files Browse the repository at this point in the history
…ing into a JSS
  • Loading branch information
YesThatAllen committed Nov 5, 2013
1 parent cbba24c commit 09e8a98
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 41 deletions.
21 changes: 10 additions & 11 deletions ExtensionAttributes/WatchmanMonitoring-ComputerURL.xml
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE extensionAttribute PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<?xml version="1.0" encoding="UTF-8"?>
<extensionAttribute>
<displayName>Watchman Monitoring Computer URL</displayName>
<displayInCategory/>
<dataType>string</dataType>
<description>This will display a computer's Watchman Monitoring URL, where its full status can be reviewed.</description>
<scriptContentsMac>#!/bin/sh
if [ -f /Library/MonitoringClient/Utilities/ExportStatus ]; then
echo "<result>`defaults read /Library/MonitoringClient/ClientData/UnifiedStatus.plist ClientURL`</result>"
else
echo "<result>Watchman Monitoring not installed</result>"
<displayName>Watchman Monitoring Computer URL</displayName>
<description>Displays the URL to a monitored computer's record in Watchman Monitoring.</description>
<dataType>string</dataType>
<scriptContentsMac>#!/bin/sh&#13;
if [ -f /Library/MonitoringClient/Utilities/ExportStatus ]; then&#13;
echo "&lt;result&gt;`defaults read /Library/MonitoringClient/ClientData/UnifiedStatus.plist ClientURL`&lt;/result&gt;"&#13;
else&#13;
echo "&lt;result&gt;Watchman Monitoring not installed&lt;/result&gt;"&#13;
fi</scriptContentsMac>
<scriptContentsWindows/>
</extensionAttribute>
37 changes: 18 additions & 19 deletions ExtensionAttributes/WatchmanMonitoring-Status.xml
Original file line number Diff line number Diff line change
@@ -1,21 +1,20 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE extensionAttribute PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<?xml version="1.0" encoding="UTF-8"?>
<extensionAttribute>
<displayName>Watchman Monitoring Error Condition</displayName>
<displayInCategory/>
<dataType>string</dataType>
<description>This attribute return true when Watchman Monitoring is reporting an error.</description>
<scriptContentsMac>#!/bin/sh

if [ -f /Library/MonitoringClient/Utilities/ExportStatus ]; then
if [ defaults read /Library/MonitoringClient/ClientData/UnifiedStatus.plist CurrentWarning ]; then
result="Has Issue"
else
result="No problems detected"
fi
echo "<result>$result</result>"
fi
echo "<result>Watchman Monitoring not installed</result>"
fi
</scriptContentsMac>
<displayName>Watchman Monitoring Status</displayName>
<description>This attribute returns "Has issue" when Watchman Monitoring is reporting an error.</description>
<dataType>string</dataType>
<scriptContentsMac>#!/bin/sh&#13;
&#13;
if [ -f /Library/MonitoringClient/Utilities/ExportStatus ]; then&#13;
if [ defaults read /Library/MonitoringClient/ClientData/UnifiedStatus.plist CurrentWarning ]; then&#13;
result="Has issue"&#13;
else&#13;
result="No problems detected"&#13;
fi&#13;
echo "&lt;result&gt;$result&lt;/result&gt;"&#13;
fi&#13;
echo "&lt;result&gt;Watchman Monitoring not installed&lt;/result&gt;"&#13;
fi&#13;
</scriptContentsMac>
<scriptContentsWindows/>
</extensionAttribute>
21 changes: 10 additions & 11 deletions ExtensionAttributes/WatchmanPluginList-Long.xml
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE extensionAttribute PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<?xml version="1.0" encoding="UTF-8"?>
<extensionAttribute>
<displayName>Watchman Monitoring Heath Report</displayName>
<displayInCategory/>
<dataType>string</dataType>
<description>This will display a list of all Watchman Monitoring plugins active on the computer, and their reported status.</description>
<scriptContentsMac>#!/bin/sh
if [ -f /Library/MonitoringClient/Utilities/ExportStatus ]; then
echo "<result>`/Library/MonitoringClient/Utilities/ExportStatus -v`</result>"
else
echo "<result>Watchman not installed</result>"
<displayName>Watchman Monitoring-Full Report</displayName>
<description>Displays a list of all plugins active on the computer, and their status.</description>
<dataType>string</dataType>
<scriptContentsMac>#!/bin/sh&#13;
if [ -f /Library/MonitoringClient/Utilities/ExportStatus ]; then&#13;
echo "&lt;result&gt;`/Library/MonitoringClient/Utilities/ExportStatus -v`&lt;/result&gt;"&#13;
else&#13;
echo "&lt;result&gt;Watchman Monitoring not installed&lt;/result&gt;"&#13;
fi</scriptContentsMac>
<scriptContentsWindows/>
</extensionAttribute>

0 comments on commit 09e8a98

Please sign in to comment.