Skip to main content

Tool to manage remote systems and services

Project description

Build Status Code Coverage Code Health

python-rrmngmnt

Remote Resources MaNaGeMeNT

Intro

This tool helps you manage remote machines and services running on that. It is targeted to Linux based machines. All is done via SSH connection, that means SSH server must be running there already.

from rrmngmnt import Host, RootUser

h = Host("10.11.12.13")
h.users.append(RootUser('123456'))
exec = h.executor()
print exec.run_cmd(['echo', 'Hello World'])

Features

List of provided interfaces to manage resources on machine, and examples.

Filesystem

Basic file operations, you can find there subset of python ‘os’ module related to files.

print h.fs.exists("/path/to/file")
h.fs.chown("/path/to/file", "root", "root")
h.fs.chmod("/path/to/file", "644")
h.fs.unlink("/path/to/file")

Network

It allows to manage network configuration.

print h.network.hostname
h.network.hostname = "my.machine.org"
print h.network.all_interfaces()
print h.network.list_bridges()

Package Management

It encapsulates various package managements. It is able to determine which package management to use. You can still specify package management explicitly.

Implemented managements:

  • APT

  • YUM

  • DNF

  • RPM

# install htop package using implicit management
h.package_management.install('htop')
# remove htop package using rpm explicitly
h.package_management('rpm').remove('htop')

System Services

You can toggle system services, it encapsulates various service managements. It is able to determine which service management to use in most cases.

Implemented managements:

  • Systemd

  • SysVinit

  • InitCtl

if h.service('httpd').status():
    h.service('httpd').stop()
if h.service('httpd').is_enabled():
    h.service('httpd').disable()

Operating System Info

Host provide os attribute which allows obtain basic operating system info. Note that os.release_info depends on systemd init system.

print h.os.distribution
# Distribution(distname='Fedora', version='23', id='Twenty Three')

print h.os.release_info
# {'HOME_URL': 'https://fedoraproject.org/',
#  'ID': 'fedora',
#  'NAME': 'Fedora',
#  'PRETTY_NAME': 'Fedora 23 (Workstation Edition)',
#  'VARIANT': 'Workstation Edition',
#  'VARIANT_ID': 'workstation',
#  'VERSION': '23 (Workstation Edition)',
#  'VERSION_ID': '23',
#  ...
# }

print h.os.release_str
# Fedora release 23 (Twenty Three)

Storage Management

It is in PROGRESS state. Planed are NFS & LVM services.

Power Management

Give you possibility to control host power state, you can restart, poweron, poweroff host and get host power status.

Implemented managements:

  • SSH

  • IPMI

ipmi_user = User(pm_user, pm_password)
ipmi_params = {
    'pm_if_type': 'lan',
    'pm_address': 'test-mgmt.testdomain',
    'user': ipmi_user
}
h.add_power_manager(
    power_manager.IPMI_TYPE, **ipmi_params
)
# restart host via ipmitool
h.power_manager.restart()

Requires

  • paramiko

  • netaddr

  • six

Install

python setup.py devop

Test

tox

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

python-rrmngmnt-0.1.3.zip (56.8 kB view details)

Uploaded Source

python-rrmngmnt-0.1.3.tar.gz (40.6 kB view details)

Uploaded Source

Built Distributions

python_rrmngmnt-0.1.3-py2.7.egg (69.0 kB view details)

Uploaded Source

python-rrmngmnt-0.1.3-1.src.rpm (52.5 kB view details)

Uploaded Source

python-rrmngmnt-0.1.3-1.noarch.rpm (61.9 kB view details)

Uploaded Source

File details

Details for the file python-rrmngmnt-0.1.3.zip.

File metadata

File hashes

Hashes for python-rrmngmnt-0.1.3.zip
Algorithm Hash digest
SHA256 d723b9e5598fd7c878e274f9996ce4a87aacb6eb9ffb9b64009dfae6a8627fe9
MD5 d21859e73296ec3144ea29676ead92b1
BLAKE2b-256 d016a1a93054a859f477aae260a40d855ed8cb924f98cd2bf3b97b94d2d4f1d0

See more details on using hashes here.

Provenance

File details

Details for the file python-rrmngmnt-0.1.3.tar.gz.

File metadata

File hashes

Hashes for python-rrmngmnt-0.1.3.tar.gz
Algorithm Hash digest
SHA256 9461f81e7dd700dcbe6ec11553732e82f90fb38636e8464a6754fe01b8e5f58e
MD5 1164602c0e85a50a08f9a3562c0d7fbd
BLAKE2b-256 11aedec7f25c25c268a0f1f3841837378b29fbadd9bbe78838657563cadfdd90

See more details on using hashes here.

Provenance

File details

Details for the file python_rrmngmnt-0.1.3-py2.7.egg.

File metadata

File hashes

Hashes for python_rrmngmnt-0.1.3-py2.7.egg
Algorithm Hash digest
SHA256 a988677b2e689e8efaaabd8df8d3d98bd6b9dbde32e03283256febb0a15f0d75
MD5 65fb2ae897f809a969730e5d2bb55a2e
BLAKE2b-256 c72fc622889408a5613b91e61d1dc9e9224a6a07778ac8681e21f07fb046c8b0

See more details on using hashes here.

Provenance

File details

Details for the file python-rrmngmnt-0.1.3-1.src.rpm.

File metadata

File hashes

Hashes for python-rrmngmnt-0.1.3-1.src.rpm
Algorithm Hash digest
SHA256 e9f95e17d2565c246ba45c8178b3c5524d4ebd9578d2091cf7ffe2664a301d51
MD5 71074a4983d62c35198454b28abf31aa
BLAKE2b-256 56fa27a37e27aa398823353baf8eb529f6b8ae524fca3566b9ce1d85eb4b65ed

See more details on using hashes here.

Provenance

File details

Details for the file python-rrmngmnt-0.1.3-1.noarch.rpm.

File metadata

File hashes

Hashes for python-rrmngmnt-0.1.3-1.noarch.rpm
Algorithm Hash digest
SHA256 611e98a6747875d9966bad5b41938b384e02c4fbeba6f6bf5b2e4a9fdfa2baef
MD5 fc61cd63d6e99fd5b12d1b1a16ca1a18
BLAKE2b-256 e1896e1af7ca49f8cb5f04a5c40bd8d52b7797ebfd6095f3bb455bc8f0745765

See more details on using hashes here.

Provenance

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page