perun.proxy.utils 2.7.4__tar.gz → 3.0.0__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.
Files changed (36) hide show
  1. {perun.proxy.utils-2.7.4 → perun.proxy.utils-3.0.0}/PKG-INFO +3 -1
  2. {perun.proxy.utils-2.7.4 → perun.proxy.utils-3.0.0}/README.md +2 -0
  3. {perun.proxy.utils-2.7.4 → perun.proxy.utils-3.0.0}/perun/proxy/utils/run_probes.py +19 -6
  4. {perun.proxy.utils-2.7.4 → perun.proxy.utils-3.0.0}/perun.proxy.utils.egg-info/PKG-INFO +3 -1
  5. {perun.proxy.utils-2.7.4 → perun.proxy.utils-3.0.0}/setup.cfg +1 -1
  6. {perun.proxy.utils-2.7.4 → perun.proxy.utils-3.0.0}/LICENSE +0 -0
  7. {perun.proxy.utils-2.7.4 → perun.proxy.utils-3.0.0}/perun/proxy/utils/__init__.py +0 -0
  8. {perun.proxy.utils-2.7.4 → perun.proxy.utils-3.0.0}/perun/proxy/utils/metadata_expiration.py +0 -0
  9. {perun.proxy.utils-2.7.4 → perun.proxy.utils-3.0.0}/perun/proxy/utils/nagios/__init__.py +0 -0
  10. {perun.proxy.utils-2.7.4 → perun.proxy.utils-3.0.0}/perun/proxy/utils/nagios/check_custom_command.py +0 -0
  11. {perun.proxy.utils-2.7.4 → perun.proxy.utils-3.0.0}/perun/proxy/utils/nagios/check_dockers.py +0 -0
  12. {perun.proxy.utils-2.7.4 → perun.proxy.utils-3.0.0}/perun/proxy/utils/nagios/check_exabgp_propagation.py +0 -0
  13. {perun.proxy.utils-2.7.4 → perun.proxy.utils-3.0.0}/perun/proxy/utils/nagios/check_ldap.py +0 -0
  14. {perun.proxy.utils-2.7.4 → perun.proxy.utils-3.0.0}/perun/proxy/utils/nagios/check_ldap_syncrepl.py +0 -0
  15. {perun.proxy.utils-2.7.4 → perun.proxy.utils-3.0.0}/perun/proxy/utils/nagios/check_mongodb.py +0 -0
  16. {perun.proxy.utils-2.7.4 → perun.proxy.utils-3.0.0}/perun/proxy/utils/nagios/check_nginx.py +0 -0
  17. {perun.proxy.utils-2.7.4 → perun.proxy.utils-3.0.0}/perun/proxy/utils/nagios/check_oidc_login.py +0 -0
  18. {perun.proxy.utils-2.7.4 → perun.proxy.utils-3.0.0}/perun/proxy/utils/nagios/check_pgsql.py +0 -0
  19. {perun.proxy.utils-2.7.4 → perun.proxy.utils-3.0.0}/perun/proxy/utils/nagios/check_php_syntax.py +0 -0
  20. {perun.proxy.utils-2.7.4 → perun.proxy.utils-3.0.0}/perun/proxy/utils/nagios/check_privacyidea.py +0 -0
  21. {perun.proxy.utils-2.7.4 → perun.proxy.utils-3.0.0}/perun/proxy/utils/nagios/check_rpc_status.py +0 -0
  22. {perun.proxy.utils-2.7.4 → perun.proxy.utils-3.0.0}/perun/proxy/utils/nagios/check_saml.py +0 -0
  23. {perun.proxy.utils-2.7.4 → perun.proxy.utils-3.0.0}/perun/proxy/utils/nagios/check_user_logins.py +0 -0
  24. {perun.proxy.utils-2.7.4 → perun.proxy.utils-3.0.0}/perun/proxy/utils/nagios/webserver_availability.py +0 -0
  25. {perun.proxy.utils-2.7.4 → perun.proxy.utils-3.0.0}/perun/proxy/utils/oracle2postgresql.py +0 -0
  26. {perun.proxy.utils-2.7.4 → perun.proxy.utils-3.0.0}/perun/proxy/utils/print_docker_versions.py +0 -0
  27. {perun.proxy.utils-2.7.4 → perun.proxy.utils-3.0.0}/perun/proxy/utils/run_version_script.py +0 -0
  28. {perun.proxy.utils-2.7.4 → perun.proxy.utils-3.0.0}/perun/proxy/utils/separate_oidc_logs.py +0 -0
  29. {perun.proxy.utils-2.7.4 → perun.proxy.utils-3.0.0}/perun/proxy/utils/separate_ssp_logs.py +0 -0
  30. {perun.proxy.utils-2.7.4 → perun.proxy.utils-3.0.0}/perun/proxy/utils/sync_usable_token_types.py +0 -0
  31. {perun.proxy.utils-2.7.4 → perun.proxy.utils-3.0.0}/perun.proxy.utils.egg-info/SOURCES.txt +0 -0
  32. {perun.proxy.utils-2.7.4 → perun.proxy.utils-3.0.0}/perun.proxy.utils.egg-info/dependency_links.txt +0 -0
  33. {perun.proxy.utils-2.7.4 → perun.proxy.utils-3.0.0}/perun.proxy.utils.egg-info/entry_points.txt +0 -0
  34. {perun.proxy.utils-2.7.4 → perun.proxy.utils-3.0.0}/perun.proxy.utils.egg-info/requires.txt +0 -0
  35. {perun.proxy.utils-2.7.4 → perun.proxy.utils-3.0.0}/perun.proxy.utils.egg-info/top_level.txt +0 -0
  36. {perun.proxy.utils-2.7.4 → perun.proxy.utils-3.0.0}/setup.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: perun.proxy.utils
3
- Version: 2.7.4
3
+ Version: 3.0.0
4
4
  Summary: Utilities and monitoring probes for Perun ProxyIdP
5
5
  Home-page: https://gitlab.ics.muni.cz/perun/perun-proxyidp/perun-proxy-utils.git
6
6
  Requires-Python: >=3.9
@@ -55,6 +55,8 @@ There are several extras which are required only for some scripts:
55
55
  - script designed to execute multiple monitoring probes
56
56
  - output is compatible with CheckMK
57
57
  - it is required to put configuration file to `/etc/run_probes_cfg.yaml`
58
+ - default timeout in seconds for all checks is set by `default_timeout` in the config, and each check can optionally have its own `timeout` setting overriding the default one.
59
+
58
60
 
59
61
  For usage instructions, run:
60
62
 
@@ -25,6 +25,8 @@ There are several extras which are required only for some scripts:
25
25
  - script designed to execute multiple monitoring probes
26
26
  - output is compatible with CheckMK
27
27
  - it is required to put configuration file to `/etc/run_probes_cfg.yaml`
28
+ - default timeout in seconds for all checks is set by `default_timeout` in the config, and each check can optionally have its own `timeout` setting overriding the default one.
29
+
28
30
 
29
31
  For usage instructions, run:
30
32
 
@@ -41,7 +41,7 @@ def get_metrics_and_new_output(output):
41
41
  return None, output
42
42
 
43
43
 
44
- def run_probe(probe_name, command):
44
+ def run_probe(probe_name, command, timeout):
45
45
  """
46
46
  Runs nagios monitoring probe and prints output in following formats:
47
47
  1) return_code probe_name metrics output
@@ -50,9 +50,17 @@ def run_probe(probe_name, command):
50
50
  metrics output format:
51
51
  metric1=val;|metric2=val2|metric3=val3;val3;;;|metric4=val4
52
52
  """
53
- result = subprocess.run(
54
- command, text=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT
55
- )
53
+ try:
54
+ result = subprocess.run(
55
+ command,
56
+ text=True,
57
+ stdout=subprocess.PIPE,
58
+ stderr=subprocess.STDOUT,
59
+ timeout=timeout,
60
+ )
61
+ except subprocess.TimeoutExpired:
62
+ print(f"3 {probe_name} - probe TIMED OUT after {timeout}s")
63
+ return 3
56
64
  output = re.sub("[ \t\n]+", " ", result.stdout)
57
65
  search = re.search(r" - .*", output)
58
66
  if search:
@@ -71,12 +79,17 @@ def main():
71
79
  if not config:
72
80
  return
73
81
 
74
- for _, options in config.items():
82
+ global_timeout = config["default_timeout"]
83
+ for _, options in config["checks"].items():
75
84
  module = options["module"]
76
85
  for name, args in options.get("runs").items():
77
86
  command = ["python3", "-m", module]
87
+ timeout = global_timeout
78
88
  if args is not None:
79
89
  for arg_name, arg_val in args.items():
90
+ if arg_name == "timeout":
91
+ timeout = arg_val
92
+ continue
80
93
  if len(arg_name) == 1:
81
94
  arg_name = "-" + arg_name
82
95
  else:
@@ -88,7 +101,7 @@ def main():
88
101
  command.append(arg_name)
89
102
  if arg_val is not None:
90
103
  command.append(str(arg_val))
91
- Thread(target=run_probe, args=[name, command]).start()
104
+ Thread(target=run_probe, args=[name, command, timeout]).start()
92
105
 
93
106
 
94
107
  if __name__ == "__main__":
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: perun.proxy.utils
3
- Version: 2.7.4
3
+ Version: 3.0.0
4
4
  Summary: Utilities and monitoring probes for Perun ProxyIdP
5
5
  Home-page: https://gitlab.ics.muni.cz/perun/perun-proxyidp/perun-proxy-utils.git
6
6
  Requires-Python: >=3.9
@@ -55,6 +55,8 @@ There are several extras which are required only for some scripts:
55
55
  - script designed to execute multiple monitoring probes
56
56
  - output is compatible with CheckMK
57
57
  - it is required to put configuration file to `/etc/run_probes_cfg.yaml`
58
+ - default timeout in seconds for all checks is set by `default_timeout` in the config, and each check can optionally have its own `timeout` setting overriding the default one.
59
+
58
60
 
59
61
  For usage instructions, run:
60
62
 
@@ -1,5 +1,5 @@
1
1
  [metadata]
2
- version = 2.7.4
2
+ version = 3.0.0
3
3
  license_files = LICENSE
4
4
  long_description = file: README.md
5
5
  long_description_content_type = text/markdown