LinuxMonitor 1.5.8__tar.gz → 1.5.9__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: LinuxMonitor
3
- Version: 1.5.8
3
+ Version: 1.5.9
4
4
  Summary: Get information and warning status of Linux server like service, port, ping, ssl certificate, disk/folder/cpu/ram/swap usage, ip connection, ... (Python and shell library, Linux ONLY)
5
5
  Home-page: https://github.com/QuentinCG/Linux-Monitor-Python-Library
6
6
  Author: Quentin Comte-Gaz
@@ -88,7 +88,6 @@ Additionnal functionalities:
88
88
  echo "USERNAME_HERE ALL=(ALL) NOPASSWD: /sbin/reboot" >> /etc/sudoers.d/USERNAME_HERE
89
89
  # Only if this library should be able to kill a process on demand:
90
90
  echo "USERNAME_HERE ALL=(ALL) NOPASSWD: /bin/kill" >> /etc/sudoers.d/USERNAME_HERE
91
-
92
91
  # To check last user connection
93
92
  echo "USERNAME_HERE ALL=(ALL) NOPASSWD: /usr/bin/last" >> /etc/sudoers.d/USERNAME_HERE
94
93
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: LinuxMonitor
3
- Version: 1.5.8
3
+ Version: 1.5.9
4
4
  Summary: Get information and warning status of Linux server like service, port, ping, ssl certificate, disk/folder/cpu/ram/swap usage, ip connection, ... (Python and shell library, Linux ONLY)
5
5
  Home-page: https://github.com/QuentinCG/Linux-Monitor-Python-Library
6
6
  Author: Quentin Comte-Gaz
@@ -88,7 +88,6 @@ Additionnal functionalities:
88
88
  echo "USERNAME_HERE ALL=(ALL) NOPASSWD: /sbin/reboot" >> /etc/sudoers.d/USERNAME_HERE
89
89
  # Only if this library should be able to kill a process on demand:
90
90
  echo "USERNAME_HERE ALL=(ALL) NOPASSWD: /bin/kill" >> /etc/sudoers.d/USERNAME_HERE
91
-
92
91
  # To check last user connection
93
92
  echo "USERNAME_HERE ALL=(ALL) NOPASSWD: /usr/bin/last" >> /etc/sudoers.d/USERNAME_HERE
94
93
 
@@ -47,7 +47,6 @@ Additionnal functionalities:
47
47
  echo "USERNAME_HERE ALL=(ALL) NOPASSWD: /sbin/reboot" >> /etc/sudoers.d/USERNAME_HERE
48
48
  # Only if this library should be able to kill a process on demand:
49
49
  echo "USERNAME_HERE ALL=(ALL) NOPASSWD: /bin/kill" >> /etc/sudoers.d/USERNAME_HERE
50
-
51
50
  # To check last user connection
52
51
  echo "USERNAME_HERE ALL=(ALL) NOPASSWD: /usr/bin/last" >> /etc/sudoers.d/USERNAME_HERE
53
52
 
@@ -1,4 +1,4 @@
1
- from .linuxmonitor import LinuxMonitor
1
+ from .linuxmonitor import LinuxMonitor, __version__
2
2
 
3
3
  import argparse
4
4
  import sys
@@ -9,6 +9,7 @@ def main() -> None:
9
9
  parser = argparse.ArgumentParser(description='System Management CLI Tool')
10
10
 
11
11
  # Define available arguments
12
+ parser.add_argument('--version', action='version', version=f'Linux Monitor {__version__}', help='Show the Linux Monitor library version and exit')
12
13
  parser.add_argument('--config_file', type=str, required=True, help='Path to the configuration file (must be a JSON file)')
13
14
  parser.add_argument('--start_scheduled_task_check_for_issues', action='store_true', help='Start periodic task to show potential issues periodically (in background, will not stop until you stop the script)')
14
15
  parser.add_argument('--start_scheduled_task_show_info', action='store_true', help='Start periodic task to show system information periodically (in background, will not stop until you stop the script)')
@@ -33,7 +33,7 @@ __email__ = "quentin@comte-gaz.com"
33
33
  __license__ = "MIT License"
34
34
  __copyright__ = "Copyright Quentin Comte-Gaz (2026)"
35
35
  __python_version__ = "3.+"
36
- __version__ = "1.5.8 (2026/08/22)"
36
+ __version__ = "1.5.9 (2026/08/22)"
37
37
  __status__ = "Usable for any Linux project"
38
38
 
39
39
  import json
@@ -1538,6 +1538,30 @@ class LinuxMonitor:
1538
1538
 
1539
1539
  return out_msg
1540
1540
 
1541
+ def get_raw_version(self) -> str:
1542
+ """
1543
+ Get the raw version of the Linux Monitor library.
1544
+
1545
+ :return: The version string (e.g. "1.5.9 (2026/08/22)").
1546
+ """
1547
+ return __version__
1548
+
1549
+ def get_version(self) -> str:
1550
+ """
1551
+ Get the version of the Linux Monitor library.
1552
+
1553
+ :return: A string containing the result message.
1554
+ """
1555
+ out_msg: str = "# 📦 Linux Monitor version 📦\n"
1556
+ try:
1557
+ out_msg += f"- **{__version__}**"
1558
+ logging.info(msg=out_msg)
1559
+ except Exception as e:
1560
+ out_msg += f"⚠️ **Error getting version**:\n```sh\n{e}\n```"
1561
+ logging.exception(msg=out_msg)
1562
+
1563
+ return out_msg
1564
+
1541
1565
  #endregion
1542
1566
 
1543
1567
  #region Users
@@ -2233,6 +2257,23 @@ class LinuxMonitor:
2233
2257
  logging.exception(msg=out_msg)
2234
2258
  return out_msg
2235
2259
 
2260
+ def get_command_names(self, is_private: bool) -> List[Tuple[str, str]]:
2261
+ """
2262
+ Return the available commands (name and display name) for the given visibility.
2263
+ Same visibility rules as list_commands. Useful to build UI autocompletion.
2264
+
2265
+ :param is_private: True to get all commands (private context), False for public-only commands.
2266
+
2267
+ :return: A list of (command_name, display_name) tuples.
2268
+ """
2269
+ result: List[Tuple[str, str]] = []
2270
+ for command_config_key in self.config['commands'].keys():
2271
+ if is_private or is_private == self.config['commands'][command_config_key]['is_private']:
2272
+ display_name: str = self.config['commands'][command_config_key]['display_name']
2273
+ result.append((command_config_key, display_name))
2274
+ return result
2275
+
2276
+
2236
2277
  #endregion
2237
2278
 
2238
2279
  #region Scheduled Tasks
@@ -6,7 +6,7 @@ with io.open(file='README.md', mode='r', encoding='utf-8') as readme_file:
6
6
 
7
7
  setup(
8
8
  name="LinuxMonitor",
9
- version="1.5.8",
9
+ version="1.5.9",
10
10
  description="Get information and warning status of Linux server like service, port, ping, ssl certificate, disk/folder/cpu/ram/swap usage, ip connection, ... (Python and shell library, Linux ONLY)",
11
11
  long_description=readme,
12
12
  long_description_content_type="text/markdown",
File without changes
File without changes