Esta es una traducción de la página de documentación original en español. Ayúdanos a mejorarla.

1 Descubrimiento de sistemas de archivos montados

Overview

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 as the master item
  • dependent low-level discovery rule and item prototypes

Configuración

Master item

Create a Zabbix agent item using the following key:

vfs.fs.get

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
         }
       }
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:

Prototipo de métrica dependiente

Cree un prototipo de métrica con el tipo "Métrica dependiente" en esta regla LLD. Como métrica principal para este prototipo, seleccione la métrica vfs.fs.get que creamos.

Tenga en cuenta el uso de macros personalizadas en el nombre y la clave del prototipo de la métrica:

  • Nombre: Espacio libre en disco en {#FSNAME}, tipo: {#FSTYPE}
  • Clave: Free[{#FSNAME}]

Como tipo de información utilice:

  • Numérico (sin signo) para métricas como "free", "total", "used"
  • Numérico (flotante) para métricas como 'pfree', 'pused' (porcentaje)

En la pestaña "Preprocesamiento" del prototipo de la métrica, seleccione JSONPath y use la siguiente expresión JSONPath como parámetro:

$.[?(@.fsname=='{#FSNAME}')].bytes.free.first()

Cuando comience el descubrimiento, se creará una métrica por cada punto de montaje. Esta métrica devolverá la cantidad de bytes libres para el punto de montaje dado.