Setting Watchman Monitoring Preferences from the Command Line is an efficient method when using deployment scripts and Apple Remote Desktop.
Notes on Editing Preferences from the Command Line
Editing Watchman Monitoring Preferences from the command line will cause the files to become unreadable by the logged-in user.
This will not cause a problem with normal reporting, however it does have an undesired cosmetic side effect when viewing the PreferencePane (ie during testing of the results).
The normal hourly run of the agent will correct the permissions, and also converts the binary formatted files to the preferred xml format.
You can force a report (and plist updating) via this command:
sudo /Library/MonitoringClient/RunClient -F
Then, re-open System Preferences to verify your changes.
All commands must be sent as root. Preface the command with sudo in an account with administrative rights.
The following are a few common command line operations. See Discovering Plugin Settings for information on finding specific plugin settings.
Client Operations
Reporting
Force the Monitoring Client to report now:
sudo /Library/MonitoringClient/RunClient -F
Updating
Force the Monitoring Client to check for software updates:
sudo /Library/MonitoringClient/RunUpdater -F
Disable Auto-Update:
sudo defaults write /Library/MonitoringClient/ClientSettings Update_Enabled -bool false
Adjust Reporting Interval
Adjust the time interval between one (1) and six (6) hours that the client reports its status.
Replace the 1 below with a number less than or equal to 6.
sudo defaults write /Library/MonitoringClient/ClientSettings RunClient_Interval -int 1
Removal
Remove the Monitoring Client from the computer:
sudo /Library/MonitoringClient/RunClient -F --remove
The -F is case sensitive.
Remove the Monitoring Client without Email Notification:
sudo /Library/MonitoringClient/RunClient -FQ --remove
When the -Q flag is sent, no email notification will be sent to the subscriber. The Dashboard will report the related Computer Record as "Missing" for failure to report as expected.
Group Setting
Change the Group:
sudo defaults write /Library/MonitoringClient/ClientSettings ClientGroup -string "GROUP_NAME"
Replace GROUP_NAME with the desired Group name.
List Plugins
A list of plugins with status, slug, settings location, and UUID can be obtained using --list-plugins
.
sudo /Library/MonitoringClient/RunClient --list-plugins
Disable/Enable a Plugin with RunClient:
Plugins can be Disabled/Enabled using the appropriate --disable
/--enable
flag when calling RunClient
with the --plugin [plugin_name]
flag.
sudo /Library/MonitoringClient/RunClient --disable --plugin [plugin_name]
sudo /Library/MonitoringClient/RunClient --enable --plugin [plugin_name]
Locate the actual plugin name in /Library/MonitoringClient/Plugins
As an example, to disable root capacity:
sudo /Library/MonitoringClient/RunClient --disable --plugin check_root_capacity
Disable a Plugin:
Disable a plugin by setting the Plugin_Enabled
boolean key in /Library/MonitoringClient/PluginSupport/[plugin_name]_settings to false
.
sudo defaults write /Library/MonitoringClient/PluginSupport/[plugin_name]_settings Plugin_Enabled -bool false
Locate the actual plugin name in /Library/MonitoringClient/Plugins
As an example, to disable time machine:
sudo defaults write /Library/MonitoringClient/PluginSupport/check_time_machine_settings Plugin_Enabled -bool false
The PluginsDisabled
array key has been deprecated. Writing a plugin to the array will disable the plugin and empty the array.
sudo defaults write /Library/MonitoringClient/ClientSettings PluginsDisabled -array-add "check_[service-to-ignore].plugin"
Disable a plugin for a user:
Disabling a plugin for a user only applies to the Daylite Client plugin.
This command would stop reporting for the user "administrator' for the Daylite Client plugin.
sudo /usr/libexec/PlistBuddy -c "Set :Users_To_Monitor:administrator bool false /Library/MonitoringClient/PluginSupport/check_daylite_client_settings.plist"
Enable a Plugin:
Enable a plugin by setting the Plugin_Enabled
boolean key in /Library/MonitoringClient/PluginSupport/check_[plugin_name]_settings to true
.
sudo defaults write /Library/MonitoringClient/PluginSupport/check_time_machine_settings Plugin_Enabled -bool true
The PluginsDisabled
array in /Library/MonitoringClient/ClientSettings.plist has been deprecated.
Plugin Settings
Time Machine
Change the Time Machine warning threshold:
sudo defaults write /Library/MonitoringClient/PluginSupport/check_time_machine_settings Days_Until_Warning -int 10
You can set Days_Until_Warning (Currently 10) with a number from 1-99.
Toggle Time Machine monitoring Off/On:
sudo defaults write /Library/MonitoringClient/PluginSupport/check_time_machine_settings Warning_Enabled -bool false
false = off, true = on
Enable Time Machine to Schedule Automatic Daily Backups:
sudo defaults write /Library/MonitoringClient/PluginSupport/check_time_machine_settings Days_Until_Manual_Run -int 1
If enabling a daily backup, be sure to disable Time Machine with:
sudo tmutil disable
Set to 0 (zero) to disable, or the number of days between triggering. See Enable Time Machine to Schedule Automatic Daily Backups for additional details.
Root Capacity
Adjust Root Volume Capacity Warning:
sudo defaults write /Library/MonitoringClient/PluginSupport/check_root_capacity_settings Root_Warn_Level -int 90
Default is 90% (90)
Reboot Notifications
Enable reboot notifications:
sudo defaults write /Library/MonitoringClient/PluginSupport/check_reboot_time_settings Warn_On_Reboot -bool true
Disable reboot notifications:
sudo defaults write /Library/MonitoringClient/PluginSupport/check_reboot_time_settings Warn_On_Reboot -bool false
Daylight
Reduce Daylight Client Warning Days:
sudo defaults write /Library/MonitoringClient/PluginSupport/check_daylite_client_settings.plist Warning_Days -int 3
You can set Warning_Days (3 in this example) with a number from 1-99.
Report Internal IP Address
Send IP Addresses for All Interfaces:
sudo defaults write /Library/MonitoringClient/PluginSupport/check_internal_ip_settings Only_Report_Primary -bool false
Generate a warning when primary IP address changes:
sudo defaults write /Library/MonitoringClient/PluginSupport/check_internal_ip_settings Warn_On_Change -bool true
Check Specified Applications
sudo defaults write /Library/MonitoringClient/PluginSupport/check_specified_applications_settings.plist Specified_Applications -array-add "/Applications/APPLICATION.app"
defaults
does not allow for modification or removal of array items. The check_specified_applications_settings.plist
will need to be edited manually, or use the Preference Pane to modify/remove a monitored application.
How can this article be improved?
Please sign in to leave a comment.