custom_check_mem bug

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
pteegarden
Posts: 27
Joined: Thu Dec 06, 2012 6:13 pm

custom_check_mem bug

Post by pteegarden »

I downloaded and installed the Linux Agent by following the instuctions in http://assets.nagios.com/downloads/nagi ... _Agent.pdf
I installed it on a Red Hat Enterprise Linux Server release 5.8

One of the modules (shell script) that it installs, /usr/local/nagios/libexec/custom_check_mem,
does not report correctly.

# ./custom_check_mem -w 4 -c 3
OK - 227 / 3951 MB (5%) Free Memory, Used: 3724 MB, Shared: 0 MB, Buffers: 458 MB, Cached: 2752 MB | total=3951MB free=227MB used=3724MB shared=0 buffers=458MB cached=2752MB
# ./custom_check_mem -w 5 -c 4
WARNING - 227 / 3951 MB (5%) Free Memory, Used: 3724 MB, Shared: 0 MB, Buffers: 458 MB, Cached: 2752 MB | total=3951MB free=227MB used=3724MB shared=0 buffers=458MB cached=2752MB
# ./custom_check_mem -w 6 -c 5
WARNING - 227 / 3951 MB (5%) Free Memory, Used: 3724 MB, Shared: 0 MB, Buffers: 458 MB, Cached: 2752 MB | total=3951MB free=227MB used=3724MB shared=0 buffers=458MB cached=2752MB

If lines 101 thru 110:

101 if [[ "$percent" -le $critical ]]
102 then
103 string="CRITICAL"
104 result=2
105 fi
106 if [[ "$percent" -le $warning ]]
107 then
108 string="WARNING"
109 result=1
110 fi

are replaced with

101 if [[ "$percent" -le $warning ]]
102 then
103 string="WARNING"
104 result=1
105 fi
106 if [[ "$percent" -le $critical ]]
107 then
108 string="CRITICAL"
109 result=2
110 fi

The module will work better:

# ./custom_check_mem -w 4 -c 3
OK - 226 / 3951 MB (5%) Free Memory, Used: 3725 MB, Shared: 0 MB, Buffers: 458 MB, Cached: 2752 MB | total=3951MB free=226MB used=3725MB shared=0 buffers=458MB cached=2752MB
# ./custom_check_mem -w 5 -c 4
WARNING - 227 / 3951 MB (5%) Free Memory, Used: 3724 MB, Shared: 0 MB, Buffers: 458 MB, Cached: 2752 MB | total=3951MB free=227MB used=3724MB shared=0 buffers=458MB cached=2752MB
# ./custom_check_mem -w 6 -c 5
CRITICAL - 226 / 3951 MB (5%) Free Memory, Used: 3725 MB, Shared: 0 MB, Buffers: 458 MB, Cached: 2752 MB | total=3951MB free=226MB used=3725MB shared=0 buffers=458MB cached=2752MB


When can we expect an updated linux-nrpe-agent.tar.gz?
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: custom_check_mem bug

Post by slansing »

If you believe this is a bug report, or a feature request.. please submit it to http://tracker.nagios.com/
Locked