Skip to main content

Wrapper for the sysctl* system functions

Project description

py-sysctl is a wrapper for the sysctl* system functions. The core is written in C.

Examples

py-sysctl provides a very simple interface to access sysctls through the filter method.

Sysctls for CPU #0

>>> import sysctl
>>> sysctl.filter('dev.cpu.0')
[<Sysctl: dev.cpu.0.%desc>, <Sysctl: dev.cpu.0.%driver>, <Sysctl: dev.cpu.0.%location>, <Sysctl: dev.cpu.0.%pnpinfo>, <Sysctl: dev.cpu.0.%parent>, <Sysctl: dev.cpu.0.freq>, <Sysctl: dev.cpu.0.freq_levels>, <Sysctl: dev.cpu.0.cx_supported>, <Sysctl: dev.cpu.0.cx_lowest>, <Sysctl: dev.cpu.0.cx_usage>]

Inspect a sysctl

>>> import sysctl
>>> shmall = sysctl.filter('kern.ipc.shmall')[0]
>>> shmall.value
131072L
>>> shmall.tuneable
False
>>> shmall.writable
True

License

This python module is licensed under BSD 2 Clause, see LICENSE.

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

sysctl-0.3.3.tar.gz (8.8 kB view details)

Uploaded Source

File details

Details for the file sysctl-0.3.3.tar.gz.

File metadata

  • Download URL: sysctl-0.3.3.tar.gz
  • Upload date:
  • Size: 8.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.6.1 pkginfo/1.4.2 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.57.0 CPython/3.9.7

File hashes

Hashes for sysctl-0.3.3.tar.gz
Algorithm Hash digest
SHA256 c3c6ce08be6e3181bb243f200a36644b2d4882913db204aeed2e2999543f8b00
MD5 beb814b4f1e41177e930842476ebbcd4
BLAKE2b-256 d54948e82ebcb5419c3703f7bbde69da1d0014abf62bb9f780049107bbf9d61a

See more details on using hashes here.

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