GithubHelp home page GithubHelp logo

swipswaps / kernelchecker Goto Github PK

View Code? Open in Web Editor NEW

This project forked from cloudlinuxadmin/kernelchecker

0.0 1.0 0.0 18 KB

The purpose of kernel checker is to determine if: newer kernel is available, if update / reboot is needed, if KernelCare (http://kernelcare.com) is installed, if latest patches are installed using KernelCare

License: Apache License 2.0

Python 100.00%

kernelchecker's Introduction

#KernelChecker

kernelcheker.py KernelChecker was created to allow control panels to easily detect & advise users on updating running kernel. It can be used to promote KernelCare through the control panel. One of the goals behind creating this script was to to make it easier for control panel providers to setup effective affiliate program with KernelCare to generate extra income. If you are interested in affiliate program, contact us at [email protected]

The purpose of KernelChecker is to determine if:

  • newer kernel is available
  • if update / reboot is needed
  • if KernelCare (http://kernelcare.com) is installed
  • if latest patches are installed using KernelCare

The script should work on dpkg & RPM based distributions. It should be able to detect if it is running inside container (Virtuozzo & LXC)

By defalt it produces YAML output. Additionally it understands --json / -j command line options that causes it to produce output in JSON

Usage:

python kernelchecker.py [--json]

Example output:

latest : 3.13.0-79-generic
current : 3.13.0-79-generic
distro : dpkg
needs_update : False
latest_installed : True
latest_available : True
inside_container : False
kernelcare :
  installed : False
  up2date : False
  supported : True
  • latest --> Latest available kernel
  • current --> current booted kernel
  • distro --> more like package manager, possible values: dpkg, rpm & unknown
  • needs_update --> newer kernel exits, reboot will be needed
  • latest_installed --> latest kernel already installed, no need to run yum update/etc...
  • inside_container --> if True, other values could be ignored, as we are running inside container and cannot update kernel
  • kernelcare : installed --> if True, KernelCare installed
  • kernelcare : up2date --> if True, kernel is patched with all the security patches, no need to update kernel (even if needs_update shows up)
  • kernelcare : supported --> if True, KernelCare supports this kernel, if False - KernelCare doesn't support this kernel

Some example of usages / advising customer based on results:

if inside_container == True: do nothing
// customer should not be advised to update/reboot no matter what
// as customer doesn't have ability to do so. 
// Also, node kernel might be patched using KernelCare or other tools.
else if needs_update == False : customer running latest kernel, nothing needs to be done
else if kernelcare.up2date == True: nothing needs to be done, Kernel is patched with KernelCare
else if needs_update == False {
  if kernelcare.installed: ask customer to run kcarectl --update
  else if kernelcare.supported: ask customer to deploy KernelCare
  else if latest_installed: ask customer to reboot
  else: ask customer to update using yum update/apt-get update, and reboot_
}

kc-compat.py Checks if server is running kernel compatible with KernelCare. Usage:

python kc-compat.py [--silent|-q]

Outputs COMPATIBLE if kernel supported, UNSUPPORTED and UNSUPPORTED; INSIDE CONTAINER if --silent flag is provided -- doesn't print anything Produces exit code 0 if compatible; 1 unsupported; 2 unsupported, inside container

Alternatively you can use:

curl -s https://raw.githubusercontent.com/iseletsk/kernelchecker/master/py/kc-compat.py|python

or

wget -qq -O - https://raw.githubusercontent.com/iseletsk/kernelchecker/master/py/kc-compat.py|python

Note: You cannot use exit code in this case, only output

kernelchecker's People

Contributors

cloudlinuxadmin avatar iseletsk avatar histrio avatar aborilov avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.