sciveo 0.1.9__tar.gz → 0.1.10__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 (44) hide show
  1. {sciveo-0.1.9 → sciveo-0.1.10}/PKG-INFO +1 -1
  2. sciveo-0.1.10/sciveo/cli.py +59 -0
  3. {sciveo-0.1.9 → sciveo-0.1.10}/sciveo/monitoring/network.py +4 -6
  4. sciveo-0.1.10/sciveo/version.py +2 -0
  5. {sciveo-0.1.9 → sciveo-0.1.10}/sciveo.egg-info/PKG-INFO +1 -1
  6. sciveo-0.1.9/sciveo/cli.py +0 -39
  7. sciveo-0.1.9/sciveo/version.py +0 -2
  8. {sciveo-0.1.9 → sciveo-0.1.10}/README.md +0 -0
  9. {sciveo-0.1.9 → sciveo-0.1.10}/sciveo/__init__.py +0 -0
  10. {sciveo-0.1.9 → sciveo-0.1.10}/sciveo/api/__init__.py +0 -0
  11. {sciveo-0.1.9 → sciveo-0.1.10}/sciveo/api/base.py +0 -0
  12. {sciveo-0.1.9 → sciveo-0.1.10}/sciveo/api/upload.py +0 -0
  13. {sciveo-0.1.9 → sciveo-0.1.10}/sciveo/common/__init__.py +0 -0
  14. {sciveo-0.1.9 → sciveo-0.1.10}/sciveo/common/configuration.py +0 -0
  15. {sciveo-0.1.9 → sciveo-0.1.10}/sciveo/common/model.py +0 -0
  16. {sciveo-0.1.9 → sciveo-0.1.10}/sciveo/common/optimizers.py +0 -0
  17. {sciveo-0.1.9 → sciveo-0.1.10}/sciveo/common/sampling.py +0 -0
  18. {sciveo-0.1.9 → sciveo-0.1.10}/sciveo/common/tools/__init__.py +0 -0
  19. {sciveo-0.1.9 → sciveo-0.1.10}/sciveo/common/tools/configuration.py +0 -0
  20. {sciveo-0.1.9 → sciveo-0.1.10}/sciveo/common/tools/daemon.py +0 -0
  21. {sciveo-0.1.9 → sciveo-0.1.10}/sciveo/common/tools/formating.py +0 -0
  22. {sciveo-0.1.9 → sciveo-0.1.10}/sciveo/common/tools/hardware.py +0 -0
  23. {sciveo-0.1.9 → sciveo-0.1.10}/sciveo/common/tools/logger.py +0 -0
  24. {sciveo-0.1.9 → sciveo-0.1.10}/sciveo/common/tools/synchronized.py +0 -0
  25. {sciveo-0.1.9 → sciveo-0.1.10}/sciveo/common/tools/timers.py +0 -0
  26. {sciveo-0.1.9 → sciveo-0.1.10}/sciveo/content/__init__.py +0 -0
  27. {sciveo-0.1.9 → sciveo-0.1.10}/sciveo/content/dataset.py +0 -0
  28. {sciveo-0.1.9 → sciveo-0.1.10}/sciveo/content/experiment.py +0 -0
  29. {sciveo-0.1.9 → sciveo-0.1.10}/sciveo/content/project.py +0 -0
  30. {sciveo-0.1.9 → sciveo-0.1.10}/sciveo/content/runner.py +0 -0
  31. {sciveo-0.1.9 → sciveo-0.1.10}/sciveo/monitoring/__init__.py +0 -0
  32. {sciveo-0.1.9 → sciveo-0.1.10}/sciveo/monitoring/monitor.py +0 -0
  33. {sciveo-0.1.9 → sciveo-0.1.10}/sciveo/monitoring/start.py +0 -0
  34. {sciveo-0.1.9 → sciveo-0.1.10}/sciveo.egg-info/SOURCES.txt +0 -0
  35. {sciveo-0.1.9 → sciveo-0.1.10}/sciveo.egg-info/dependency_links.txt +0 -0
  36. {sciveo-0.1.9 → sciveo-0.1.10}/sciveo.egg-info/entry_points.txt +0 -0
  37. {sciveo-0.1.9 → sciveo-0.1.10}/sciveo.egg-info/requires.txt +0 -0
  38. {sciveo-0.1.9 → sciveo-0.1.10}/sciveo.egg-info/top_level.txt +0 -0
  39. {sciveo-0.1.9 → sciveo-0.1.10}/setup.cfg +0 -0
  40. {sciveo-0.1.9 → sciveo-0.1.10}/setup.py +0 -0
  41. {sciveo-0.1.9 → sciveo-0.1.10}/test/test_configuration.py +0 -0
  42. {sciveo-0.1.9 → sciveo-0.1.10}/test/test_monitoring.py +0 -0
  43. {sciveo-0.1.9 → sciveo-0.1.10}/test/test_runner.py +0 -0
  44. {sciveo-0.1.9 → sciveo-0.1.10}/test/test_sampling.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: sciveo
3
- Version: 0.1.9
3
+ Version: 0.1.10
4
4
  Description-Content-Type: text/markdown
5
5
  Provides-Extra: mon
6
6
  Provides-Extra: net
@@ -0,0 +1,59 @@
1
+ #!/usr/bin/env python
2
+ #
3
+ # Pavlin Georgiev, Softel Labs
4
+ #
5
+ # This is a proprietary file and may not be copied,
6
+ # distributed, or modified without express permission
7
+ # from the owner. For licensing inquiries, please
8
+ # contact pavlin@softel.bg.
9
+ #
10
+ # 2024
11
+ #
12
+
13
+ import os
14
+ import argparse
15
+
16
+ from sciveo.common.tools.logger import *
17
+ from sciveo.common.tools.timers import Timer
18
+ from sciveo.monitoring.start import MonitorStart
19
+ from sciveo.monitoring.network import NetworkTools
20
+ from sciveo.common.tools.configuration import GlobalConfiguration
21
+
22
+
23
+ def main():
24
+ config = GlobalConfiguration.get()
25
+
26
+ parser = argparse.ArgumentParser(description='sciveo CLI')
27
+ parser.add_argument('command', choices=['init', 'monitor', 'scan'], help='Command to execute')
28
+ parser.add_argument('--period', type=int, default=120, help='Period in seconds')
29
+ parser.add_argument('--block', type=bool, default=True, help='Block flag')
30
+ parser.add_argument('--auth', type=str, default=config['secret_access_key'], help='Auth secret access key')
31
+ parser.add_argument('--timeout', type=float, default=0.5, help='Timeout')
32
+ parser.add_argument('--port', type=int, default=22, help='Host port number, used for network ops')
33
+ parser.add_argument('--localhost', type=bool, default=False, help='Add localhost to list of hosts')
34
+ args = parser.parse_args()
35
+
36
+ if args.command == 'monitor':
37
+ MonitorStart(period=args.period, block=args.block)()
38
+ elif args.command == 'scan':
39
+ NetworkTools(timeout=args.timeout, localhost=args.localhost).scan_port(port=args.port)
40
+ elif args.command == 'init':
41
+ home = os.path.expanduser('~')
42
+ base_path = os.path.join(home, '.sciveo')
43
+ if not os.path.exists(base_path):
44
+ os.makedirs(base_path)
45
+ default_lines = [
46
+ "secret_access_key=<your secret access key>",
47
+ "api_base_url=https://sciveo.com",
48
+ "log_min_level=DEBUG"
49
+ ]
50
+ with open("default", 'w') as fp:
51
+ for line in default_lines:
52
+ fp.write(line + '\n')
53
+ else:
54
+ info(f"init, [{base_path}] already there")
55
+ else:
56
+ warning(args.command, "not implemented")
57
+
58
+ if __name__ == '__main__':
59
+ main()
@@ -58,13 +58,14 @@ class NetworkTools:
58
58
  def scan_port(self, port=22):
59
59
  t = Timer()
60
60
  list_local_ips = self.get_local_nets()
61
- debug(type(self).__name__, "scan_port", "list_local_ips", list_local_ips)
61
+ # debug(type(self).__name__, "scan_port", "list_local_ips", list_local_ips)
62
+ self.data["scan"].setdefault(port, [])
62
63
  for local_ip in list_local_ips:
63
64
  list_ip = self.generate_ip_list(local_ip)
64
65
  self.scan_port_hosts(list_ip, port)
65
66
  if self.arguments["localhost"]:
66
67
  self.scan_port_hosts(["127.0.0.1"], port)
67
- debug(type(self).__name__, f"scan_port [{port}] elapsed time", t.stop(), self.data["scan"][port])
68
+ debug(type(self).__name__, f"scan_port [{port}] elapsed time {t.stop():.1f}s", self.data["scan"][port])
68
69
  return self.data["scan"][port]
69
70
 
70
71
  def scan_port_hosts(self, list_ip, port=22):
@@ -84,7 +85,6 @@ class NetworkTools:
84
85
  result = sock.connect_ex((ip, port))
85
86
  if result == 0:
86
87
  with self.data_lock:
87
- self.data["scan"].setdefault(port, [])
88
88
  self.data["scan"][port].append(ip)
89
89
  # debug(type(self).__name__, "scan_ports", ip, port, result)
90
90
  except socket.error:
@@ -92,6 +92,4 @@ class NetworkTools:
92
92
 
93
93
 
94
94
  if __name__ == "__main__":
95
- net = NetworkTools(timeout=0.5, localhost=True)
96
- list_hosts = net.scan_port(port=22)
97
- print(list_hosts)
95
+ print(NetworkTools(timeout=0.5, localhost=False).scan_port(port=9901))
@@ -0,0 +1,2 @@
1
+
2
+ __version__ = '0.1.10'
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: sciveo
3
- Version: 0.1.9
3
+ Version: 0.1.10
4
4
  Description-Content-Type: text/markdown
5
5
  Provides-Extra: mon
6
6
  Provides-Extra: net
@@ -1,39 +0,0 @@
1
- #!/usr/bin/env python
2
- #
3
- # Pavlin Georgiev, Softel Labs
4
- #
5
- # This is a proprietary file and may not be copied,
6
- # distributed, or modified without express permission
7
- # from the owner. For licensing inquiries, please
8
- # contact pavlin@softel.bg.
9
- #
10
- # 2024
11
- #
12
-
13
- import os
14
- import argparse
15
-
16
- from sciveo.common.tools.logger import *
17
- from sciveo.monitoring.start import MonitorStart
18
- from sciveo.common.tools.configuration import GlobalConfiguration
19
-
20
-
21
- def main():
22
- config = GlobalConfiguration.get()
23
-
24
- parser = argparse.ArgumentParser(description='sciveo CLI')
25
- parser.add_argument('command', choices=['monitor', 'net'], help='Command to execute')
26
- parser.add_argument('--period', type=int, default=120, help='Period in seconds')
27
- parser.add_argument('--block', type=bool, default=True, help='Block flag')
28
- parser.add_argument('--auth', type=str, default=config['secret_access_key'], help='Auth secret access key')
29
- args = parser.parse_args()
30
-
31
- if args.command == 'monitor':
32
- MonitorStart(period=args.period, block=args.block)()
33
- elif args.command == 'net':
34
- warning(args.command, "not implemented")
35
- else:
36
- warning(args.command, "not implemented")
37
-
38
- if __name__ == '__main__':
39
- main()
@@ -1,2 +0,0 @@
1
-
2
- __version__ = '0.1.9'
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
File without changes
File without changes
File without changes