Help!

Bug#582097: nagios-statd-server: division by zero when gaw..

 
Post new topic   General Reply to Topic (not reply to a specific post)    Forums Home -> Bugs Dist RSS
Next:  Bug#582092: libttspico0: pico2wave should be in a..  
Author Message
zsimon
External


Since: May 18, 2010
Posts: 1



PostPosted: Tue May 18, 2010 7:10 am    Post subject: Bug#582097: nagios-statd-server: division by zero when gawk installed and swap size is 0
Archived from groups: linux>debian>bugs>dist (more info?)


Package: nagios-statd-server
Severity: normal

In line 21 /usr/sbin/nagios-statd contains
a shell command to determine swap usage:

free | awk '$1~/^Swap:/{print ($3/$2)*100}'

When gawk is installed, zero swap size causes
an error message and an exit code 2 (which
mistakenly marks the host as critical).

Zero swap size may occur routinely on virtualized
systems such as openvz.

(The default awk binary has no division by zero
error, but results in "nan".)

A working fix is replacing the above command with:

free | awk '$1~/^Swap:/{if ($2>0) print ($3/$2)*100; else print \"nan\"}'


-- System Information:
Debian Release: 5.0.4
APT prefers stable
APT policy: (500, 'stable')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.26-2-openvz-amd64 (SMP w/8 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-Cool
Shell: /bin/sh linked to /bin/bash



--
To UNSUBSCRIBE, email to debian-bugs-dist-REQUEST DeleteThis @lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster DeleteThis @lists.debian.org
Back to top
Display posts from previous:   
Post new topic   General Reply to Topic (not reply to a specific post)    Forums Home -> Bugs Dist All times are: Eastern Time (US & Canada)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum