Vfs fs discovery zabbix linux

1 Discovery of mounted filesystems

It is possible to discover mounted filesystems and their properties (mountpoint name, mountpoint type, filesystem size and inode statistics).

To do that, you may use a combination of:

  • the vfs.fs.get agent item (supported since Zabbix 4.0.17) as the master item
  • a low-level discovery rule and dependent item prototypes

Configuration

Master item

Create a Zabbix agent item using the following key:

Set the type of information to «Text» for possibly big JSON data.

The data returned by this item will contain something like the following for a mounted filesystem:

   "fsname": "/", "fstype": "rootfs", "bytes":  "total": 1000, "free": 500, "used": 500, "pfree": 50.00, "pused": 50.00 >, "inodes":  "total": 1000, "free": 500, "used": 500, "pfree": 50.00, "pused": 50.00 > >
Low-level discovery rule

Create a low-level discovery rule using the in-built discovery key:

This discovery rule will return discovery macros such as , that can be used in creating item prototypes.

Dependent item prototype

Create an item prototype with «Dependent item» type in this LLD rule. As master item for this prototype select the vfs.fs.get item we created.

Note the use of macros in the item prototype name and key:

As type of information, use:

  • Numeric (unsigned) for metrics like ‘free’, ‘total’, ‘used’
  • Numeric (float) for metrics like ‘pfree’, ‘pused’ (percentage)

In the item prototype «Preprocessing» tab select JSONPath and use the following JSONPath expression as parameter:

When discovery starts, one item per each mountpoint will be created. This item will return the number of free bytes for the given mountpoint.

Источник

1 Discovery of mounted filesystems

It is possible to discover mounted filesystems and their properties:

  • mountpoint name
  • mountpoint type
  • filesystem size
  • inode statistics
  • mount options

To do that, you may use a combination of:

  • the vfs.fs.get agent item as the master item
  • dependent low-level discovery rule and item prototypes

Configuration

Master item

Create a Zabbix agent item using the following key:

Set the type of information to «Text» for possibly big JSON data.

The data returned by this item will contain something like the following for a mounted filesystem:

 [   "fsname": "/", "fstype": "ext4", "bytes":  "total": 249405239296, "free": 24069537792, "used": 212595294208, "pfree": 10.170306, "pused": 89.829694 >, "inodes":  "total": 15532032, "free": 12656665, "used": 2875367, "pfree": 81.487503, "pused": 18.512497 >, "options": "rw,noatime,errors=remount-ro" > ]
Dependent LLD rule

Create a low-level discovery rule as «Dependent item» type:

As master item select the vfs.fs.get item we created.

In the «LLD macros» tab define custom macros with the corresponding JSONPath:

In the «Filters» tab you may add a regular expression that filters only read-write filesystems:

Dependent item prototype

Create an item prototype with «Dependent item» type in this LLD rule. As master item for this prototype select the vfs.fs.get item we created.

Note the use of custom macros in the item prototype name and key:

As type of information, use:

  • Numeric (unsigned) for metrics like ‘free’, ‘total’, ‘used’
  • Numeric (float) for metrics like ‘pfree’, ‘pused’ (percentage)

In the item prototype «Preprocessing» tab select JSONPath and use the following JSONPath expression as parameter:

When discovery starts, one item per each mountpoint will be created. This item will return the number of free bytes for the given mountpoint.

Источник

Читайте также:  Linux добавить системного пользователя
Оцените статью
Adblock
detector