centreon / centreon-plugins

Collection of standard plugins to discover and gather cloud-to-edge metrics and status across your whole IT infrastructure.
https://www.centreon.com
Apache License 2.0
311 stars 274 forks source link

Check NFS mount point #4286

Closed Dubouchj closed 1 year ago

Dubouchj commented 1 year ago

Hello,

I am trying to check if a mount point ( /var/lib/jelastic/backup/backup ) is available or not on my server :

mysql@nodexxxxx ~ $ df -h
Filesystem                                                              Size  Used Avail Use% Mounted on
/dev/ploop35490p1                                                        48G  2.0G   44G   5% /
none                                                                    640M     0  640M   0% /sys/fs/cgroup
none                                                                    640M     0  640M   0% /dev
tmpfs                                                                   640M     0  640M   0% /dev/shm
tmpfs                                                                   640M  156K  640M   1% /run
nodeyyyy-backup:/data/backup/nodexxxxx  1.5T  568G  849G  41% /var/lib/jelastic/backup/backup

I am using the method "/usr/lib/centreon/plugins/centreon_linux_snmp.pl --plugin=os::linux::snmp::plugin --mode=storage" but it doesn't work, and I get the error below :

[root@monitoring ~]# /usr/lib/centreon/plugins//centreon_linux_snmp.pl --plugin=os::linux::snmp::plugin --mode=storage --hostname=10.102.x.x --snmp-version='2c' --snmp-community='communityxxx'  --storage='/var/lib/jelastic/bac
kup/backup' --name --regexp --display-transform-src='' --display-transform-dst=''  --verbose 

UNKNOWN: No storage found. Can be: filters, cache file.

Do you know if I did something wrong?

Thanks in advance. Jean-Luc

garnier-quentin commented 1 year ago

Could you provide the output without your filter ? (to see if net-snmp provide that mountpoint)

Dubouchj commented 1 year ago

@garnier-quentin here is the result :

mysql@nodexxxxx# /usr/lib/centreon/plugins//centreon_linux_snmp.pl --plugin=os::linux::snmp::plugin --mode=storage --hostname=10.102.x.x --snmp-version='2c' --snmp-community='communityxxx'

OK: All storages are ok | 'count'=7;;;0; 'used_/'=808333312B;;;0;51055448064 'used_/sys/fs/cgroup'=0B;;;0;402653184 'used_/dev/shm'=0B;;;0;402653184 'used_/run'=172032B;;;0;402653184 'used_/var/ftp/conf'=808333312B;;;0;51055448064 '
used_/var/ftp/logs'=808333312B;;;0;51055448064 'used_/var/ftp/keys'=808333312B;;;0;51055448064

So, the mountpoint is not present.

garnier-quentin commented 1 year ago

Try to use following option: ```--='^(hrStorageFixedDisk|hrStorageNetworkDisk|hrFSBerkeleyFFS|hrStorageNetworkDisk)$'````

Dubouchj commented 1 year ago

I tried with that parameters :

--filter-perfdata='^(hrStorageFixedDisk|hrStorageNetworkDisk|hrFSBerkeleyFFS|hrStorageNetworkDisk)$'

And still get no value :/

Dubouchj commented 1 year ago

@garnier-quentin Do you know if there is another way to monitor that mount point ?

garnier-quentin commented 1 year ago

You can test with the following option: --filter-storage-type='^(hrStorageFixedDisk|hrStorageNetworkDisk|hrFSBerkeleyFFS|hrStorageNetworkDisk)$'

Dubouchj commented 1 year ago

It works !

Thanks @garnier-quentin