LinuxMonitor 1.3.7__tar.gz → 1.3.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.
- {linuxmonitor-1.3.7 → linuxmonitor-1.3.9/LinuxMonitor.egg-info}/PKG-INFO +1 -1
- {linuxmonitor-1.3.7/LinuxMonitor.egg-info → linuxmonitor-1.3.9}/PKG-INFO +1 -1
- {linuxmonitor-1.3.7 → linuxmonitor-1.3.9}/linuxmonitor/linuxmonitor.py +16 -5
- {linuxmonitor-1.3.7 → linuxmonitor-1.3.9}/setup.py +1 -1
- {linuxmonitor-1.3.7 → linuxmonitor-1.3.9}/LICENSE.md +0 -0
- {linuxmonitor-1.3.7 → linuxmonitor-1.3.9}/LinuxMonitor.egg-info/SOURCES.txt +0 -0
- {linuxmonitor-1.3.7 → linuxmonitor-1.3.9}/LinuxMonitor.egg-info/dependency_links.txt +0 -0
- {linuxmonitor-1.3.7 → linuxmonitor-1.3.9}/LinuxMonitor.egg-info/requires.txt +0 -0
- {linuxmonitor-1.3.7 → linuxmonitor-1.3.9}/LinuxMonitor.egg-info/top_level.txt +0 -0
- {linuxmonitor-1.3.7 → linuxmonitor-1.3.9}/README.md +0 -0
- {linuxmonitor-1.3.7 → linuxmonitor-1.3.9}/linuxmonitor/__init__.py +0 -0
- {linuxmonitor-1.3.7 → linuxmonitor-1.3.9}/linuxmonitor/__main__.py +0 -0
- {linuxmonitor-1.3.7 → linuxmonitor-1.3.9}/setup.cfg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: LinuxMonitor
|
|
3
|
-
Version: 1.3.
|
|
3
|
+
Version: 1.3.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
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: LinuxMonitor
|
|
3
|
-
Version: 1.3.
|
|
3
|
+
Version: 1.3.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
|
|
@@ -33,7 +33,7 @@ __email__ = "quentin@comte-gaz.com"
|
|
|
33
33
|
__license__ = "MIT License"
|
|
34
34
|
__copyright__ = "Copyright Quentin Comte-Gaz (2024)"
|
|
35
35
|
__python_version__ = "3.+"
|
|
36
|
-
__version__ = "1.3.
|
|
36
|
+
__version__ = "1.3.9 (2024/09/19)"
|
|
37
37
|
__status__ = "Usable for any Linux project"
|
|
38
38
|
|
|
39
39
|
import json
|
|
@@ -295,6 +295,15 @@ class LinuxMonitor:
|
|
|
295
295
|
if not display_only_if_critical:
|
|
296
296
|
if not show_only_std_and_exception:
|
|
297
297
|
out_msg = f" - ✅ **{display_name} executed successfully**"
|
|
298
|
+
else:
|
|
299
|
+
if stdout_str != "":
|
|
300
|
+
msg_stout: str = stdout_str
|
|
301
|
+
if is_stdout_json:
|
|
302
|
+
msg_stout = self._json_to_md(stdout_str)
|
|
303
|
+
if msg_stout != "":
|
|
304
|
+
if out_msg != "":
|
|
305
|
+
out_msg += "\n"
|
|
306
|
+
out_msg += f"```sh\n{msg_stout}\n```"
|
|
298
307
|
|
|
299
308
|
if res == True:
|
|
300
309
|
logging.info(msg=f"Command {display_name} (command {command}) executed successfully")
|
|
@@ -1873,14 +1882,16 @@ class LinuxMonitor:
|
|
|
1873
1882
|
logging.info(msg=out_msg)
|
|
1874
1883
|
|
|
1875
1884
|
if show_content_if_success:
|
|
1876
|
-
|
|
1885
|
+
if res_msg != "":
|
|
1886
|
+
out_msg += f"\n{res_msg}"
|
|
1877
1887
|
|
|
1878
1888
|
elif res == False:
|
|
1879
1889
|
out_msg = f"⚠️ **{display_name} failed to execute**."
|
|
1880
1890
|
logging.warning(msg=out_msg)
|
|
1881
1891
|
|
|
1882
1892
|
if show_content_if_issue:
|
|
1883
|
-
|
|
1893
|
+
if res_msg != "":
|
|
1894
|
+
out_msg += f"\n{res_msg}"
|
|
1884
1895
|
|
|
1885
1896
|
else:
|
|
1886
1897
|
out_msg = f"⚠️ **{display_name} expired**."
|
|
@@ -1897,7 +1908,7 @@ class LinuxMonitor:
|
|
|
1897
1908
|
out_msg: str = ""
|
|
1898
1909
|
display_name: str = command_name
|
|
1899
1910
|
for command_config_key in self.config['commands'].keys():
|
|
1900
|
-
if
|
|
1911
|
+
if command_config_key == command_name:
|
|
1901
1912
|
display_name = self.config['commands'][command_config_key]['display_name']
|
|
1902
1913
|
command: str = self.config['commands'][command_config_key]['command']
|
|
1903
1914
|
is_private_cmd: bool = self.config['commands'][command_config_key]['is_private']
|
|
@@ -1965,7 +1976,7 @@ class LinuxMonitor:
|
|
|
1965
1976
|
for command_config_key in self.config['commands'].keys():
|
|
1966
1977
|
if is_private or is_private == self.config['commands'][command_config_key]['is_private']:
|
|
1967
1978
|
display_name: str = self.config['commands'][command_config_key]['display_name']
|
|
1968
|
-
out_msg += f"- {display_name}\n"
|
|
1979
|
+
out_msg += f"- `{command_config_key}`: {display_name}\n"
|
|
1969
1980
|
|
|
1970
1981
|
logging.info(msg=out_msg)
|
|
1971
1982
|
return out_msg
|
|
@@ -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.3.
|
|
9
|
+
version="1.3.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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|