Page 1 of 2

A custom_check_mem error value too big.

Posted: Mon Oct 24, 2016 8:12 pm
by lee.krause
When I run the custom_check_mem script i get the following errors:
./custom_check_mem: line 111: 111G: value too great for base (error token is "111G")
./custom_check_mem: line 132: [[: stack
0: syntax error in expression (error token is "0")
./custom_check_mem: line 136: [[: stack
0: syntax error in expression (error token is "0")
./custom_check_mem: line 150: [: -gt: unary operator expected
OK - / 262144 MB (stack
0%) Free Memory, Used: MB, Shared: MB | total=262144MB free=MB used=MB shared=MB


Is there an update to this script? I'm running Solaris 10.

Re: A custom_check_mem error value too big.

Posted: Tue Oct 25, 2016 1:58 am
by Box293
How did you install this plugin? Was it installed via this method?

https://assets.nagios.com/downloads/nag ... _Agent.pdf

Re: A custom_check_mem error value too big.

Posted: Tue Oct 25, 2016 3:19 pm
by lee.krause
Yes it was installed as the document says.

Re: A custom_check_mem error value too big.

Posted: Tue Oct 25, 2016 4:17 pm
by Box293
Can you please show us the full command you are using to test at the command line. For example:

Code: Select all

/opt/nagios/libexec/custom_check_mem -w 20 -c 10

Re: A custom_check_mem error value too big.

Posted: Tue Oct 25, 2016 7:16 pm
by lee.krause
~ # /opt/nagios/libexec/custom_check_mem -w 20 -c 10
/opt/nagios/libexec/custom_check_mem: line 110: 110G: value too great for base (error token is "110G")
/opt/nagios/libexec/custom_check_mem: line 131: [[: stack
0: syntax error in expression (error token is "0")
/opt/nagios/libexec/custom_check_mem: line 135: [[: stack
0: syntax error in expression (error token is "0")
/opt/nagios/libexec/custom_check_mem: line 149: [: -gt: unary operator expected
OK - / 262144 MB (stack
0%) Free Memory, Used: MB, Shared: MB | total=262144MB free=MB used=MB shared=MB

Re: A custom_check_mem error value too big.

Posted: Tue Oct 25, 2016 10:07 pm
by Box293
Would you be able to upload the plugin here as a text file. I am unable to reproduce on a test server I have so I want to make sure we have the same version of the plugin.

Re: A custom_check_mem error value too big.

Posted: Tue Oct 25, 2016 10:52 pm
by lee.krause
Here's the txt file

Re: A custom_check_mem error value too big.

Posted: Wed Oct 26, 2016 1:14 am
by Box293
I think this forum thread has the answer to your problem:

https://support.nagios.com/forum/viewto ... 10#p187375

Can you see if this modified version fixes your issue:
custom_check_mem.txt

Re: A custom_check_mem error value too big.

Posted: Wed Oct 26, 2016 4:21 pm
by lee.krause
I changed the code in that section for SunOS and have noted in the text document.

Re: A custom_check_mem error value too big.

Posted: Wed Oct 26, 2016 4:36 pm
by rkennedy
The file you just posted looks to be different from what @Box293 attached as a fix, could you try the fixed version and let us know the new output you're seeing?