I modified ghillan device_mapper script from https://www.zabbix.com/forum/showpos...77&postcount=7 to handle normal /dev's and also device mappers.
The primary change was to add a check to see if the filesystem name (returned from /proc/mounts) has "mapper" in it, if so it does another step is done to find the /dev/dm-? for each /dev/mapper device.
When called without arguments, device_mapper.pl returns three values for each mount:
FSNAAME = the mount point
FSDEVICE = the /dev/ device (sda or dm-)
FSTYPE = the filesystem type.
for example, the root filesystem:
"{#FSNAME}":"\/",
"{#FSDEVICE}":"dm-7",
"{#FSTYPE}":"ext4" },
User Parameter for your zabbix_config:
Discovery Template is attached.
ToDo: Add step to get device for UUID mounted drives (/dev/disk/by-uuid/xxxxx-xxxx-xxx)
The primary change was to add a check to see if the filesystem name (returned from /proc/mounts) has "mapper" in it, if so it does another step is done to find the /dev/dm-? for each /dev/mapper device.
When called without arguments, device_mapper.pl returns three values for each mount:
FSNAAME = the mount point
FSDEVICE = the /dev/ device (sda or dm-)
FSTYPE = the filesystem type.
for example, the root filesystem:
"{#FSNAME}":"\/",
"{#FSDEVICE}":"dm-7",
"{#FSTYPE}":"ext4" },
User Parameter for your zabbix_config:
UserParameter=device_mapper[*],/usr/bin/device_mapper.pl $1 $2
Discovery Template is attached.
ToDo: Add step to get device for UUID mounted drives (/dev/disk/by-uuid/xxxxx-xxxx-xxx)

Comment