File: debug.py

package info (click to toggle)
python-qnapstats 0.6.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 456 kB
  • sloc: xml: 857; python: 456; makefile: 2
file content (54 lines) | stat: -rwxr-xr-x 1,059 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#!/usr/bin/env python3
import getpass
import traceback
import qnapstats

host = input("Host (prefix with 'https://' if needed): ")
port = int(input("Port: "))
username = input("Username: ")
password = getpass.getpass("Password: ")

qnap = qnapstats.QNAPStats(host, port, username, password, debugmode=True, verify_ssl=False)

try:
    qnap.get_system_stats()
except Exception as e:
    print(e.args)
    traceback.print_exc()

try:
    qnap.get_system_health()
except Exception as e:
    print(e.args)
    traceback.print_exc()

try:
    qnap.get_smart_disk_health()
except Exception as e:
    print(e.args)
    traceback.print_exc()

try:
    qnap.get_volumes()
except Exception as e:
    print(e.args)
    traceback.print_exc()

try:
    qnap.get_bandwidth()
except Exception as e:
    print(e.args)
    traceback.print_exc()

try:
    qnap.get_external_drive()
except Exception as e:
    print(e.args)
    traceback.print_exc()


try:
    qnap.get_storage_information_on_external_device()
except Exception as e:
    print(e.args)
    traceback.print_exc()