Page 2 of 3
Re: Memory Usage Graph Issue
Posted: Fri Jun 17, 2016 2:04 pm
by Berto
Here is the requested output:
Memory: 16G phys mem, 1329M free mem, 25G total swap, 25G free swap
Re: Memory Usage Graph Issue
Posted: Mon Jun 20, 2016 9:23 am
by ssax
Please edit the plugin and around line 105 change these two lines from:
Code: Select all
total=`echo $topout | awk '{print $2}' | sed -e 's/M$//'`
free=`echo $topout | awk '{print $5}' | sed -e 's/M$//'`
To:
Code: Select all
total=`echo $topout | awk '{print $2}' | sed -e 's/\(M\|G\)$//'`
free=`echo $topout | awk '{print $5}' | sed -e 's/\(M\|G\)$//'`
Let us know if that resolves the issue for you.
Re: Memory Usage Graph Issue
Posted: Tue Jun 21, 2016 12:23 pm
by Berto
Well here's probably a stupid question but I assume the plugin would be check_mem? If not what then? I used the Solaris wizard when configuring and when I go to where the plugins are, I don't see anything that looks like checking memory.
--Berto
Re: Memory Usage Graph Issue
Posted: Tue Jun 21, 2016 3:11 pm
by tgriep
The plugin should be installed on the Solaris server and it's location is here
Code: Select all
/opt/nagios/libexec/custom_check_mem
That is the plugin that has to be edited for the check to work.
Re: Memory Usage Graph Issue
Posted: Tue Jun 21, 2016 5:06 pm
by Berto
I edited the plugin and this is what the output was. I also disable/enabled NRPE on the Solaris server before trying the plugin again.
solarishost# /opt/nagios/libexec/custom_check_mem -w 30 -c 10
/opt/nagios/libexec/custom_check_mem: line 104: 16G: value too great for base (error token is "16G")
/opt/nagios/libexec/custom_check_mem: line 125: [[: stack
stack
100: syntax error in expression (error token is "stack
100")
/opt/nagios/libexec/custom_check_mem: line 129: [[: stack
stack
100: syntax error in expression (error token is "stack
100")
/opt/nagios/libexec/custom_check_mem: line 143: [: -gt: unary operator expected
OK - / MB (stack
stack
100%) Free Memory, Used: MB, Shared: MB | total=MB free=MB used=MB shared=MB
Re: Memory Usage Graph Issue
Posted: Wed Jun 22, 2016 9:24 am
by ssax
Please attach your modified plugin, it doesn't look like it was modified.
Re: Memory Usage Graph Issue
Posted: Wed Jun 22, 2016 10:02 am
by Berto
I have uploaded the plugin but had to add a .txt to the end for it to be upload.
--Berto
Re: Memory Usage Graph Issue
Posted: Wed Jun 22, 2016 1:11 pm
by ssax
Apologies, sed works differently on SunOS, please replace them with this:
Code: Select all
total=`echo $topout | awk '{print $2}' | sed -e 's/G$//' -e 's/M$//'`
free=`echo $topout | awk '{print $5}' | sed -e 's/G$//' -e 's/M$//'`
Let us know the results.
Re: Memory Usage Graph Issue
Posted: Wed Jun 22, 2016 3:18 pm
by Berto
That seems to have fixed it as I now get;
/opt/nagios/libexec/custom_check_mem -w 30 -c 10
OK - 1222 / 16 MB (7637%) Free Memory, Used: -1206 MB, Shared: 0 MB, Cached: 4451 MB | total=16MB free=1222MB used=-1206MB shared=0MB cached=4451MB
So my next question then would is there a way to update the wizard for any future installs on Solaris servers?
--Berto
Re: Memory Usage Graph Issue
Posted: Wed Jun 22, 2016 3:38 pm
by ssax
Which wizard? Are you talking about the linux-nrpe-agent.tar.gz file that you download and install?