Landscape can execute scripts on machines on demand, or at a regular interval for monitoring purposes.
- Remote execution Scripts
- Graphs for monitoring over time
scripts-in-landscape.md explains how to add and run these scripts in Landscape.
Landscape Scripts can be authored in any familiar shell scripting language. Some scripts are easier to implement with bash, others are easier to implement with Python. The goal of this project is to continuously improve and grow a collection of useful scripts that perform systems management or systems monitoring functions.
If you
- have an idea for a new script
- are able to convert a bash script to python
- can convert scripts to any other shell scripting language
- have thoughts around improving the quality of this material
Do not hesitate to fork this repository, and submit a pull request with your improvements. If appropriate, you are encouraged to write a companion tutorial for your contribution, or suggest updates to the existing tutorials.
- Tutorial: Test and deploy individual CVE fixes with UA Client and Landscape
- uafix.sh: Granular security patching by USN patch number of CVE number.
- uafix.py - conversion needed
- Tutorial: Enable or disable Livepatch at scale with Landscape
- livepatchenable.sh
- livepatchenable.py - conversion needed
- livepatchdisable.sh
- livepatchdisable.py - conversion needed
- Tutorial: Track the Livepatch entitlement in an auditable manner, through Landscape
- livepatchannotations.sh
- livepatchannotations.py - pending
- Tutorial: add annotations to machines in Landscape, identifying each machine's Ubuntu Advantage entitlements. This tutorial does not yet exist.
- uastatus.sh
- uastatus.py - conversion needed
- Tutorial: Audit UA Client ESM configurations at scale with Landscape
- esmaudit.sh
- esmaudit.py - conversion needed
- Tutorial: Enable ESM configurations at scale with UA Client and Landscape
- esmenable.sh
- esmenable.py - conversion needed
- Tutorial: Enable and disable the Ubuntu Advantage FIPS entitlement in an auditable manner, through Landscape
- fipsenable.sh
- fispenable.py - conversion needed
- fipsdisable.sh
- fipsdisable.py - conversion needed
- Tutorial: Track the Ubuntu Advantage FIPS entitlement in an auditable manner, through Landscape
- Tutorial: Granular software restrictions by apt package name.
- bypackagename.sh
- bypackagename.py - conversion needed
- Tutorial: There is a need to programmatically create .pref files to block all packages from Universe. This allows tightly regulated environments to lock down their Ubuntu environments, and loosen restrictions as needed. This tutorial and its companion scripts do not yet exist. Feel free to contribute!
- allpackages.sh - pending
- allpackages.py - pending
- A Windows PowerShell function to get all registered computers from Canonical Landscape.
-
Tutorial: find inaccessible security updates on any Ubuntu instance, by identifying the availability of software updates from the security pocket of the Expanded Security Maintenance repository. This tutorial does not yet exist. Feel free to contribute!
- securitystatus.sh - pending
- securitystatus.py
-
Tutorial: chart kernel live patching activities over time with Landscape’s custom graphs.
- livepatchcount.sh
- livepatchcount.py - conversion needed
- Tutorial: Deploy Landscape to an ARM powered Ubuntu instance on Oracle Public Cloud. This tutorial does not yet exist.
Note: some scripts may require python3-requests deb (or PyPI requests) in order to function correctly. It is automatically installed in most environments (including the Landscape Client Snap) but that might not always be the case.
-
Tutorial: Install a snap using a python wearfile and dump script output to a temporary file for debugging on the device.
-
Tutorial: Install a snap using a python script and the SnapD REST API
-
Tutorial: Run an attached python script
-
Tutorial: Install a snap using python and the snap-http library
-
Tutorial: Remove a snap using python and the snap-http library
-
Tutorial: Update snapd configuration using Python and the snap-http library
-
Tutorial: Set the refresh timer using Python and the snap-http library
-
Tutorial: Put device into managed mode (disable automatic snap refreshes)
-
Tutorial: Enable a snap service using Python and the snap-http library
-
Tutorial: Restart a snap service using Python and the snap-http library
-
Tutorial: Stop a snap service using Python and the snap-http library
-
Tutorial: Connect a snap interface using Python and the snap-http library
-
Tutorial: Disconnect a snap interface using Python and the snap-http library
-
Tutorial: Get interface connections using Python and the snap-http library
-
Tutorial: Display logs for all snaps using Python and the snap-http library
-
Tutorial: Push landscape-client's logs to an FTP server using Python
-
Tutorial: Add an Ubuntu SSO user to a Core device using Python and the snap-http library
-
Tutorial: Add a system user to a Core device using Python and the snap-http library
-
Tutorial: Remove a user from a Core device