Skip to main content

Tool to manage remote systems and services

Project description

# python-rrmngmnt
Remote Resources MaNaGeMeNT
[![Build Status](https://travis-ci.org/rhevm-qe-automation/python-rrmngmnt.svg?branch=master)](https://travis-ci.org/rhevm-qe-automation/python-rrmngmnt)

## 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()
```

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

## Requires
* paramiko
* netaddr

### 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()
```

## Install
```
python setup.py devop
```

Project details


Download files

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

Source Distribution

python-rrmngmnt-0.1.1.tar.gz (33.6 kB view details)

Uploaded Source

Built Distributions

python-rrmngmnt-0.1.1-1.src.rpm (43.6 kB view details)

Uploaded Source

python-rrmngmnt-0.1.1-1.noarch.rpm (54.5 kB view details)

Uploaded Source

File details

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

File metadata

File hashes

Hashes for python-rrmngmnt-0.1.1.tar.gz
Algorithm Hash digest
SHA256 a500538fbde527026f746e4bc63b2d57a348e3e61acb4680d35278ef0402e616
MD5 120131d6387b606a2c3229eb750cc0c4
BLAKE2b-256 bf05654b75fb3cd05c6c12970c4f9f019f87be02857d8dda1ce6ea581804a909

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for python-rrmngmnt-0.1.1-1.src.rpm
Algorithm Hash digest
SHA256 6df9affd43ce57f65b10c3154806c103800e1298027bfd62b5f58b6c714d5678
MD5 fbbe37b6aa753a1be59602eb401e4362
BLAKE2b-256 322ca720a68f66165667c63ef12e66094dd93305ad4c82f31746e1cdeb983a5f

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for python-rrmngmnt-0.1.1-1.noarch.rpm
Algorithm Hash digest
SHA256 191788163e76e3c30c429c1c7ef8fd6a508674618d3cd945841a7f460a873136
MD5 0a2beb7065a80b1686480df3a3524ffd
BLAKE2b-256 5805f6aef4e082dd1d2182d16b10ecc7722079d724735b3274ba9a4bf8e2680a

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