Page 1 of 1

Physical RAM in GB with MEMUSE (nsclient)

Posted: Thu Jan 07, 2016 11:20 am
by dlukinski
Hello Nagios support

How to report Physical RAM in GB with MEMUSE (check_xi_service_nsclient) ?

Thank you

Re: Physical RAM in GB with MEMUSE (nsclient)

Posted: Thu Jan 07, 2016 12:47 pm
by jolson
According to the NSClient documentation, these are the settings we're allowed to use:

help (CheckSystem, checkmem)
Show help screen (this screen)

help-pb (CheckSystem, checkmem)
Show help screen as a protocol buffer payload

show-default (CheckSystem, checkmem)
Show default values for a given command

help-short (CheckSystem, checkmem)
Show help screen (short format).

type (CheckSystem, checkmem)
The types to check

ShowAll (CheckSystem, checkmem)
Configures display format (if set shows all items not only failures, if set to long shows all cores).

MaxWarn (CheckSystem, checkmem)
Maximum value before a warning is returned.

MaxCrit (CheckSystem, checkmem)
Maximum value before a critical is returned.

MinWarn (CheckSystem, checkmem)
Minimum value before a warning is returned.

MinCrit (CheckSystem, checkmem)
Minimum value before a critical is returned.

warn (CheckSystem, checkmem)
Maximum value before a warning is returned.

crit (CheckSystem, checkmem)
Maximum value before a critical is returned.

Unfortunately there is no way of performing this check using the default command provided with XI.

That being said, with a little customization you can get the results that you'd like to see - using check_nrpe against the NSClient agent. A few things have to be in place for this to work appropriately.

First, be sure you're using a recent version of NSClient. I'm using version 0.4.3.

Second, the nsclient configuration should look something like this:

Code: Select all

[/settings/default]
allowed hosts = x.x.x.x
password = somepass

[/modules]
NSClientServer = 1
CheckSystem = 1
CheckDisk = 1
NRPEServer = 1
CheckExternalScripts=enabled

[/settings/NRPE/server]
use ssl = 1
payload length = 1024
allow nasty characters = false
allowed ciphers = ADH
ssl = 1
allow arguments = 1
insecure = 1
The command you'll need to run from Nagios XI to test the results:

Code: Select all

cd /usr/local/nagios/libexec
./check_nrpe --host x.x.x.x --command check_memory
Results:

Code: Select all

[root@localhost libexec]# ./check_nrpe --host 192.168.x.x --command check_memory
OK: committed = 16.745GB, physical = 20.429GB|'committed'=16.74484GB;51.05516;57.43705;0;63.81895 'committed %'=26%;80;90;0;100 'physical'=20.42904GB;25.52828;28.71931;0;31.91035 'physical %'=64%;79;89;0;100
Let me know if you have any questions. Thanks!

Re: Physical RAM in GB with MEMUSE (nsclient)

Posted: Thu Jan 07, 2016 3:02 pm
by dlukinski
jolson wrote:According to the NSClient documentation, these are the settings we're allowed to use:

help (CheckSystem, checkmem)
Show help screen (this screen)

help-pb (CheckSystem, checkmem)
Show help screen as a protocol buffer payload

show-default (CheckSystem, checkmem)
Show default values for a given command

help-short (CheckSystem, checkmem)
Show help screen (short format).

type (CheckSystem, checkmem)
The types to check

ShowAll (CheckSystem, checkmem)
Configures display format (if set shows all items not only failures, if set to long shows all cores).

MaxWarn (CheckSystem, checkmem)
Maximum value before a warning is returned.

MaxCrit (CheckSystem, checkmem)
Maximum value before a critical is returned.

MinWarn (CheckSystem, checkmem)
Minimum value before a warning is returned.

MinCrit (CheckSystem, checkmem)
Minimum value before a critical is returned.

warn (CheckSystem, checkmem)
Maximum value before a warning is returned.

crit (CheckSystem, checkmem)
Maximum value before a critical is returned.

Unfortunately there is no way of performing this check using the default command provided with XI.

That being said, with a little customization you can get the results that you'd like to see - using check_nrpe against the NSClient agent. A few things have to be in place for this to work appropriately.

First, be sure you're using a recent version of NSClient. I'm using version 0.4.3.

Second, the nsclient configuration should look something like this:

Code: Select all

[/settings/default]
allowed hosts = x.x.x.x
password = somepass

[/modules]
NSClientServer = 1
CheckSystem = 1
CheckDisk = 1
NRPEServer = 1
CheckExternalScripts=enabled

[/settings/NRPE/server]
use ssl = 1
payload length = 1024
allow nasty characters = false
allowed ciphers = ADH
ssl = 1
allow arguments = 1
insecure = 1
The command you'll need to run from Nagios XI to test the results:

Code: Select all

cd /usr/local/nagios/libexec
./check_nrpe --host x.x.x.x --command check_memory
Results:

Code: Select all

[root@localhost libexec]# ./check_nrpe --host 192.168.x.x --command check_memory
OK: committed = 16.745GB, physical = 20.429GB|'committed'=16.74484GB;51.05516;57.43705;0;63.81895 'committed %'=26%;80;90;0;100 'physical'=20.42904GB;25.52828;28.71931;0;31.91035 'physical %'=64%;79;89;0;100
Let me know if you have any questions. Thanks!
So various CheckMEM / Check MEmory options via NRPE is the only way indeed.

Thank you,
We could now close this case.

Re: Physical RAM in GB with MEMUSE (nsclient)

Posted: Thu Jan 07, 2016 3:14 pm
by bwallace
Glad we were able to help. We'll lock this thread now and feel free to open another should you require assistance with anything else.