The Addigy policier is the software utility that downloads, installs, and tracks the progress of all the items applied to a policy. The status of a policy is viewable in the user interface: Policy Deployment Status Overview
In the below sections are some more advanced scripting methods. For more information on running scripts within Addigy, check out our articles on Using the GoLive Terminal and Creating and Running Scripts. These commands were designed to work great when run remotely via LiveTerminal, GoLive, or the Devices page.
Usually, the policier will work well on its own and accurately report all the details of your devices. Should the policier run into any issues, or you would like more information regarding whether it is running, the below commands may help.
Directory
- How To Start The Policy Via Terminal Command
- How To Check For In-Progress Downloads
- How To Reset Policy Progress On A Device
- How To Check Whether The Policy Is Running On A Device Via Terminal Command
How To Start The Policy Via Terminal Command
The following command starts the policy deployment on a device via terminal command. It can be run remotely via LiveTerminal, GoLive, or the Devices page.
if sudo launchctl start com.addigy.policier; then echo "Policy started." && exit 0; else echo "Error starting policy." && exit 1; fi
This will start the policier process that downloads and executes all of the items associated with a policy. It will output "Policy started" once the policier starts running, or "Error starting policy." if it fails to start the policier.
Note: The above command will not affect a policy that is actively being deployed.
How To Check For In-Progress Downloads
To check whether a file that has been deployed via a Policy is currently being downloaded by a device, try this command:
if sudo ps aux | grep -v grep | grep lan-cache; then echo "Download in progress." && exit 0; else echo "No download is being performed." && exit 1; fi
If a file is currently being downloaded, the command output will be "Download in progress". If a file is not being downloaded, the output will be "No download is being performed".
This command can be run remotely via LiveTerminal, GoLive, or the Devices page.
How To Reset Policy Progress On A Device
Sometimes a device will stop reporting the status of items being deployed to it via the policy. The status of policy items is stored in a JSON file located at /Library/Addigy/ansible/status.json.
By deleting the status.json file, you can reset the information on the deployment progress for the device. Try this command to delete the status.json file:
if sudo rm /Library/Addigy/ansible/status.json; then echo "Reset policy progress." && exit 0; else echo "Failed to reset policy progress by deleting status.json file." && exit 1; fi
If the command successfully deletes the file, it will output "Reset policy progress". Otherwise, the output will be "Failed to reset policy progress by deleting status.json file".
The above command can be run remotely via LiveTerminal, GoLive, or the Devices page.
How To Check Whether The Policy Is Running On A Device Via Terminal Command
To check if the policy is currently running, try this command:
if ! sudo ps aux | grep -v grep | grep policier; then echo "Policier not running." && exit 1; fi
This command will check the running process for the Addigy policier, and will return the current policier process or "Policier not running" if a process is not found. It can be run locally on a device, or remotely via LiveTerminal, GoLive, or the Devices page.