LC.sys.*¶
The module LC.sys
provides access to several system informations.
-
LC.sys.
get_fqdn
()¶ -
- Returns
-
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
()¶ -
- Returns
-
machine (hardware) name
This function returns the hardware name (e.g.
x86_64
). The result is the same as running the commanduname -m
.
-
LC.sys.
get_name
()¶ -
- Returns
-
kernel name
This function returns the kernel name (e.g.
Linux
). The result is the same as running the commanduname -k
.
-
LC.sys.
get_node
()¶ -
- Returns
-
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
()¶ -
- Returns
-
kernel release
This function returns the kernel release (e.g.
4.9.0-11-amd64
). The result is the same as running the commanduname -r
.
-
LC.sys.
get_version
()¶ -
- Returns
-
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 commanduname -v
.
-
LC.sys.
group_exists
(name)¶ -
- Arguments
-
-
name (String) – group name
-
- Returns
-
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)¶ -
- Arguments
-
-
name (String) – user name
-
- Returns
-
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
.