Skip to content

Commit

Permalink
Bugfix, broken device discovery
Browse files Browse the repository at this point in the history
  • Loading branch information
scoopex committed May 10, 2018
1 parent 793e9c9 commit 5ea0ee7
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions extension-files/tools/zabbix_discovery_devices
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ for filename in glob.glob('/sys/block/*'):
continue
device_name = os.path.basename(filename)

device_model_file = "/sys/block/%s/device" % device_name
device_model_file = "/sys/block/%s/device/model" % device_name
device_model = "UNDEFINED"

if os.path.isfile(device_model_file):
Expand All @@ -186,7 +186,7 @@ for filename in glob.glob('/sys/block/*'):
device_size = int(f_size.readline().strip())
if device_size == 0:
if args.debug:
sys.stderr.write("ignoring device %s, its size is 0\n")
sys.stderr.write("ignoring device %s, its size is 0\n" % device_name)
continue

if args.debug:
Expand All @@ -202,6 +202,7 @@ for filename in glob.glob('/sys/block/*'):
# Check excluded devices
if check_match("exclude", device_name, config["regex_excludes_name"]):
continue

if check_match("exclude", device_model, config["regex_excludes_model"]):
continue

Expand Down

0 comments on commit 5ea0ee7

Please sign in to comment.