Memory Usage Graph Issue

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Berto
Posts: 162
Joined: Tue Jul 01, 2014 6:12 pm

Re: Memory Usage Graph Issue

Post by Berto »

Here is the requested output:

Memory: 16G phys mem, 1329M free mem, 25G total swap, 25G free swap
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: Memory Usage Graph Issue

Post 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.
Berto
Posts: 162
Joined: Tue Jul 01, 2014 6:12 pm

Re: Memory Usage Graph Issue

Post 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
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: Memory Usage Graph Issue

Post 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.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Berto
Posts: 162
Joined: Tue Jul 01, 2014 6:12 pm

Re: Memory Usage Graph Issue

Post 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
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: Memory Usage Graph Issue

Post by ssax »

Please attach your modified plugin, it doesn't look like it was modified.
Berto
Posts: 162
Joined: Tue Jul 01, 2014 6:12 pm

Re: Memory Usage Graph Issue

Post by Berto »

I have uploaded the plugin but had to add a .txt to the end for it to be upload.

--Berto
You do not have the required permissions to view the files attached to this post.
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: Memory Usage Graph Issue

Post 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.
Berto
Posts: 162
Joined: Tue Jul 01, 2014 6:12 pm

Re: Memory Usage Graph Issue

Post 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
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: Memory Usage Graph Issue

Post by ssax »

Which wizard? Are you talking about the linux-nrpe-agent.tar.gz file that you download and install?
Locked