Skip to main content

Hello everyone, I recently viewed that the template check “OS-Linux-Disk-Global-SNMP-custom” has a problem and I don’t know how to resolve it. The server shows the free disk storage but differs from the centreon check and the server (df command). I’m aware that the real number is what is shown in the server site, but why is centreon showing another numbers?

Server


In my server i can see the /data disk usage:

$ df -h /data
/dev/mapper/01--vg-data 4,4T 3,8T 476G 89% /data

$ df -H /data
/dev/mapper/01--vg-data 4,9T 4,1T 511G 89% /data

$ df /data
/dev/mapper/01--vg-data 4695587440 3996106512 498103636 89% /data

 

Centreon

but when I use the check i see this in my /data:
 

 

I also used the same script as the service and encounters the same problem:
 

$ /usr/lib/centreon/plugins//centreon_linux_snmp.pl --plugin=os::linux::snmp::plugin --mode=storage --hostname=$server --snmp-version='2c' --snmp-community='public'  --storage='\/data|\/srv$|\/tmp$|\/var$|\/boot$|\/$' --name --regexp --display-transform-src='' --display-transform-dst='' --warning-usage='90' --critical-usage='95' --verbose --filter-perfdata='storage.space|used|free' --snmp-timeout=60

OK: All storages are ok | 'used_/'=3591811072B;0:22024337817;0:23247912140;0;24471486464 'used_/tmp'=6041600B;0:1738395648;0:1834973184;0;1931550720 'used_/var'=366907392B;0:153420831129;0:161944210636;0;170467590144 'used_/boot'=37908480B;0:222079795;0:234417561;0;246755328 'used_/data'=4092013166592B;0:4327453384704;0:4567867461632;0;4808281538560
Storage '/' Usage Total: 22.79 GB Used: 3.35 GB (14.68%) Free: 19.45 GB (85.32%)
Storage '/tmp' Usage Total: 1.80 GB Used: 5.76 MB (0.31%) Free: 1.79 GB (99.69%)
Storage '/var' Usage Total: 158.76 GB Used: 349.91 MB (0.22%) Free: 158.42 GB (99.78%)
Storage '/boot' Usage Total: 235.32 MB Used: 36.15 MB (15.36%) Free: 199.17 MB (84.64%)
Storage '/data' Usage Total: 4.37 TB Used: 3.72 TB (85.10%) Free: 667.08 GB (14.90%)


The /data folder is using the lvm 01-vg-data. in the volume group 01-vg there are 33Gb free to assign, but I think this isnt the problem

I tried to use the --help parameter in the centreon_linux_snmp.pl, but i cant find anything.
¿Whay can I do? 

Hello :)

From the research I've done, it seems that by default, Linux reserves around 5% (about the variation you're seeing) of disk space for the root user to prevent a normal user from filling the disk completely. There is a plugin option to take this into account:  

--space-reservation

Some filesystem has space reserved (like ext4 for root).
The value is in percent of total (default: none) (results like 'df' command).

I hope this has helped you, kind regards.


Hello :) 
With the option -T in df command, you can see the type of filesystem ( ext4, xfs , etc ) 
With the xfs no reservation exist , the snmp is fine, so the plugins is also fine. 
In my case, you can see the result.
/usr/lib/centreon/plugins//centreon_linux_snmp.pl --plugin=os::linux::snmp::plugin --mode=storage --hostname=localhost --snmp-version='2c' --snmp-community='public'  --storage='\/data01$' --name --regexp --display-transform-src='' --display-transform-dst='' --warning-usage='90' --critical-usage='95' --verbose --filter-perfdata='storage.space|used|free' --snmp-timeout=60
WARNING: Storage '/data01' Usage Total: 124.93 GB Used: 115.93 GB (92.79%) Free: 9.01 GB (7.21%) | 'used'=124475752448B;0:120731782348;0:127439103590;0;134146424832
Storage '/data01' Usage Total: 124.93 GB Used: 115.93 GB (92.79%) Free: 9.01 GB (7.21%)
# df -ThP /data01
Filesystem                Type  Size  Used Avail Use% Mounted on
/dev/mapper/vg01-LogVol04 xfs   125G  116G  9.1G  93% /data01
The problem is from snmp and  the option --space-reservation exist for correcting the snmp value.

In your case to verify that use the option --debug to display the snmp response.
sample response with your /data : 
.1.3.6.1.2.1.25.2.3.1.4.37 = 4096
.1.3.6.1.2.1.25.2.3.1.5.37 = 1173896860
.1.3.6.1.2.1.25.2.3.1.6.37 = 999026652
so :
# echo $((1173896860*4096))
4808281538560
# echo $((999026652*4096))
4092013166592
'used_/data'=4092013166592B;0:4327453384704;0:4567867461632;0;4808281538560

Bye.
 


Reply