The module LC.sys
provides access to several system informations.
LC.sys.
get_fqdn
()¶
fully-qualified name
This function returns the fully-qualified domain name of the server. The result is the same as running the command hostname -f
.
LC.sys.
get_machine
()¶
machine (hardware) name
This function returns the hardware name (e.g. x86_64
). The result is the same as running the command uname -m
.
LC.sys.
get_name
()¶
kernel name
This function returns the kernel name (e.g. Linux
). The result is the same as running the command uname -k
.
LC.sys.
get_node
()¶
host name
This function returns the host name (without domain). The result is the same as running the command uname -n
.
LC.sys.
get_release
()¶
kernel release
This function returns the kernel release (e.g. 4.9.0-11-amd64
). The result is the same as running the command uname -r
.
LC.sys.
get_version
()¶
kernel version
This function returns the full kernel version string (e.g. #1 SMP Debian 4.9.189-3+deb9u1 (2019-09-20)
). The result is the same as running the command uname -v
.
LC.sys.
group_exists
(name)¶
name (String) – group name
group id or false
Check if a group with the given name exists. The check is done using getgrnam()
, so NIS and LDAP are also taken into account.
If the group exists, its numerical ID is returned, otherwise false
.
LC.sys.
user_exists
(name)¶
name (String) – user name
user id or false
Check if a user with the given name exists. The check is done using getgrnam()
, so NIS and LDAP are also taken into account.
If the user exists, its numerical ID is returned, otherwise false
.