Skip to content

Instantly share code, notes, and snippets.

@darkhelmet
Created December 24, 2013 05:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save darkhelmet/8109026 to your computer and use it in GitHub Desktop.
Save darkhelmet/8109026 to your computer and use it in GitHub Desktop.
class RebootRequiredPlugin < Scout::Plugin
def build_report
reboot_required = system('file /var/run/reboot-required >/dev/null 2>&1')
report(:reboot_required => reboot_required ? 1 : 0)
end
end
class UpdatesAvailablePlugin < Scout::Plugin
def build_report
total, security = `/usr/lib/update-notifier/apt-check 2>&1`.split(';').map(&:to_i)
report(:total_updates => total, :security_updates => security)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment