[Nagiosplug-devel] [ nagiosplug-Bugs-2973603 ] disk_check, -g group, failing calculations

SourceForge.net noreply at sourceforge.net
Sat Aug 21 03:18:06 CEST 2010


Bugs item #2973603, was opened at 2010-03-20 12:52
Message generated for change (Comment added) made by bekar
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=397597&aid=2973603&group_id=29880

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: General plugin execution
Group: None
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Bekar (bekar)
Assigned to: Matthias Eble (psychotrahe)
Summary: disk_check, -g group, failing calculations

Initial Comment:
>From a tinderbox build:

#   Failed test 'grouping: exit warning if the sum of free megs on mp1+mp2 is between -w and -c '
#   at ./t/check_disk.t line 312.
#          got: 0
#     expected: 1
# Looks like you failed 1 test of 78.

..

Testing: ./check_disk -w 350 -c 348 -g group -p / -p /boot
not ok 68 - grouping: exit warning if the sum of free megs on mp1+mp2 is between -w and -c

Manually running the test and the check_disk command used to get the amount of disk space in the test shows:

[root at dev00 plugins]# ./check_disk -w 350 -c 348 -p / -p /boot
DISK CRITICAL - free space: / 275 MB (15% inode=91%); /boot 74 MB (80% inode=99%);| /=1518MB;1540;1542;0;1890 /boot=18MB;-252;-250;0;98
[root at dev00 plugins]# ./check_disk -w 350 -c 348 -g group -p / -p /boot
DISK OK - free space: group 500 MB (26% inode=91%);| group=1386MB;1639;1641;0;1989

The test is doing the calculation properly (349), adding one and taking one for warning / critical.

The check_disk it's self is coming up with the wrong number for free space in the group.

----------------------------------------------------------------------

>Comment By: Bekar (bekar)
Date: 2010-08-21 11:18

Message:
[buildmonkey at dev00 plugins]$ ./check_disk -vvv -w 448 -c 446 -g group -p /
-p /boot
calling stat on /
calling stat on /boot
Group of /: group
calling stat on /
Group group: add 43753 blocks (/) sized 4096
calling stat on /
Group group: add 75429 blocks (/boot) sized 1024
For group, total=585138, available=119182, available_to_root=149386,
used=435752, fsp.fsu_files=525816, fsp.fsu_ffree=477983
For group, used_pct=79 free_pct=21 used_units=1481 free_units=405
total_units=1989 used_inodes_pct=10 free_inodes_pct=90
fsp.fsu_blocksize=3565 mult=1048576
Freespace_units result=2
Freespace% result=0
Usedspace_units result=0
Usedspace_percent result=0
Usedinodes_percent result=0
Freeinodes_percent result=0
Group of /boot: group
DISK CRITICAL - free space: group 405 MB (21% inode=90%);|
group=1481MB;1541;1543;0;1989
[buildmonkey at dev00 plugins]$ ./check_disk -vvvv -w 448 -c 446 -g group -p
/ -p /boot
calling stat on /
calling stat on /boot
Group of /: group
calling stat on /
Group group: add 43753 blocks (/) sized 4096
calling stat on /
Group group: add 75429 blocks (/boot) sized 1024
For group, total=585138, available=119182, available_to_root=149386,
used=435752, fsp.fsu_files=525816, fsp.fsu_ffree=477983
For group, used_pct=79 free_pct=21 used_units=1481 free_units=405
total_units=1989 used_inodes_pct=10 free_inodes_pct=90
fsp.fsu_blocksize=3565 mult=1048576
Freespace_units result=2
Freespace% result=0
Usedspace_units result=0
Usedspace_percent result=0
Usedinodes_percent result=0
Freeinodes_percent result=0
Group of /boot: group
DISK CRITICAL - free space: group 405 MB (21% inode=90%);|
group=1481MB;1541;1543;0;1989


One FS is 1024, the other is 4096.

----------------------------------------------------------------------

Comment By: Matthias Eble (psychotrahe)
Date: 2010-08-18 09:39

Message:
hi again,

I found a bug in the calculation logic, but the problem only shows up if
the FS blocksizes differ. Could you please check if this is the case at
your site?
This will of course be fixed either way, but you can simply check this by
changing
              printf("Group %s: add %llu blocks (%s) \n", path->group,
tmpfsp.fsu_bavail, temp_list->name);
to
              printf("Group %s: add %llu blocks (%s) sized %d\n",
path->group, tmpfsp.fsu_bavail, temp_list->name, tmpfsp.fsu_blocksize);

and run the -vvvv check again. I'd bet the sizes differ.

Matthias


----------------------------------------------------------------------

Comment By: Bekar (bekar)
Date: 2010-08-16 20:34

Message:
For point-in-time reference, what the check_disk.t uses to get the
available
space, coupled with a 'df' just to make sure I'm not going loony:

]# ./check_disk -w 1 -c 1 -p / -p /boot
DISK OK - free space: / 143 MB (8% inode=90%); /boot 74 MB (79%
inode=99%);|
/=1649MB;1889;1889;0;1890 /boot=19MB;97;97;0;98
]# df -vh
Filesystem            Size  Used Avail Use% Mounted on
/dev/mapper/VolGroup01-LogVol00
                     1.9G  1.7G  144M  92% /
/dev/hda1              99M   20M   75M  21% /boot
tmpfs                 250M     0  250M   0%
/dev/shm

Then the strange output:

]# ./check_disk -vvvv -w 218 -c 216 -g group -p / -p /boot
calling stat on /
calling stat on /boot
Group of /: group
calling stat on /
Group group: add 36758 blocks (/)
calling stat on /
Group group: add 75817 blocks (/boot)
For group, total=585138, available=112575, available_to_root=142779,
used=442359, fsp.fsu_files=525816, fsp.fsu_ffree=479159
For group, used_pct=80 free_pct=20 used_units=1503 free_units=382
total_units=1989 used_inodes_pct=9 free_inodes_pct=91
fsp.fsu_blocksize=3565
mult=1048576
Freespace_units result=0
Freespace% result=0
Usedspace_units result=0
Usedspace_percent result=0
Usedinodes_percent result=0
Freeinodes_percent result=0
Group of /boot: group
DISK OK - free space: group 382 MB (20% inode=91%);|
group=1503MB;1771;1773;0;198

----------------------------------------------------------------------

Comment By: Matthias Eble (psychotrahe)
Date: 2010-08-16 09:38

Message:
Hi Bekar,

thanks for your report and running the test cases.
Could you please send the failing grouping call with -vvvv added? This
should ease finding the problem.

Matthias

----------------------------------------------------------------------

Comment By: Bekar (bekar)
Date: 2010-03-20 12:59

Message:
Bloody hell, bad reporting there, sorry.

Plugin Version (-V output): check_disk v1.4.14-65-ge11b (nagios-plugins
1.4.14)
Operating System: Linux (Centos 5)
Architecture: x86_64
Compiler: gcc version 4.1.2 20080704 (Red Hat 4.1.2-46)


----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=397597&aid=2973603&group_id=29880




More information about the Devel mailing list