Skip to main content

utmp/wtmp reader

Project description

Pure-Python library to decode/read utmp and wtmp files. Please note that there is an alternative library which uses the underlying C API: pyutmp

This package requires Python 3.4.

What is utmp/wtmp?

utmp, wtmp, btmp and variants such as utmpx, wtmpx and btmpx are files on Unix-like systems that keep track of all logins and logouts to the system.

The utmp file keeps track of the current login state of each user. The wtmp file records all logins and logouts history. The btmp file records failed login attempts.

On Linux the wtmp and btmp files are usually located in the /var/log/ directory.

Usage

The utmp.read function decodes a binary utmp/wtmp stream and yields record objects:

with open('/var/log/wtmp', 'rb') as fd:
    buf = fd.read()
    for entry in utmp.read(buf):
        print(entry.time, entry.type, entry)

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

utmp-0.3.tar.gz (4.3 kB view details)

Uploaded Source

File details

Details for the file utmp-0.3.tar.gz.

File metadata

  • Download URL: utmp-0.3.tar.gz
  • Upload date:
  • Size: 4.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for utmp-0.3.tar.gz
Algorithm Hash digest
SHA256 47f973c9b511bf32f99cf25fee8ce71c2c536273a67d5f7705f66227e7195531
MD5 96747827f7e8839c195ae5f9f348abe8
BLAKE2b-256 1b981659377b4e00f9267134deea4769a3aa380c21712b1e96c012336d63d2e0

See more details on using hashes here.

Supported by

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