Skip to content

A collection of scripts to make Landscape more powerful

License

Notifications You must be signed in to change notification settings

canonical/landscape-scripts

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

98 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Landscape Scripts

Landscape can execute scripts on machines on demand, or at a regular interval for monitoring purposes.

  1. Remote execution Scripts
  2. Graphs for monitoring over time

scripts-in-landscape.md explains how to add and run these scripts in Landscape.

The purpose of this project

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.

Attention open-source contributors

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.


Systems Management Scripts

Security Patching

  • 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
  • Tutorial: Track the Livepatch entitlement in an auditable manner, through Landscape

Ubuntu Advantage and Ubuntu Pro Subscriptions

  • Tutorial: add annotations to machines in Landscape, identifying each machine's Ubuntu Advantage entitlements. This tutorial does not yet exist.
  • Tutorial: Audit UA Client ESM configurations at scale with Landscape
  • Tutorial: Enable ESM configurations at scale with UA Client and Landscape

FIPS configurations at scale with Landscape

  • Tutorial: Enable and disable the Ubuntu Advantage FIPS entitlement in an auditable manner, through Landscape
  • Tutorial: Track the Ubuntu Advantage FIPS entitlement in an auditable manner, through Landscape

Blocking Software Package Installation with Landscape

  • Tutorial: Granular software restrictions by apt package name.
  • 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

Get all computers from Landscape

  • A Windows PowerShell function to get all registered computers from Canonical Landscape.

Systems Monitoring Scripts

Security Patching Graphs

  • 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!

  • Tutorial: chart kernel live patching activities over time with Landscape’s custom graphs.


Landscape Deployment Script

Deploy Landscape with cloud-init and Juju

  • Tutorial: Deploy Landscape to an ARM powered Ubuntu instance on Oracle Public Cloud. This tutorial does not yet exist.

Landscape for IoT / Ubuntu Core devices

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.

Snap Management

Snap Services

  • 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

Snap Interfaces

Logs

  • 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

User Management

  • 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