Physical RAM in GB with MEMUSE (nsclient)

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
dlukinski
Posts: 1130
Joined: Tue Oct 06, 2015 9:42 am

Physical RAM in GB with MEMUSE (nsclient)

Post by dlukinski »

Hello Nagios support

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

Thank you
jolson
Attack Rabbit
Posts: 2560
Joined: Thu Feb 12, 2015 12:40 pm

Re: Physical RAM in GB with MEMUSE (nsclient)

Post 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!
Twits Blog
Show me a man who lives alone and has a perpetually clean kitchen, and 8 times out of 9 I'll show you a man with detestable spiritual qualities.
dlukinski
Posts: 1130
Joined: Tue Oct 06, 2015 9:42 am

Re: Physical RAM in GB with MEMUSE (nsclient)

Post 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.
bwallace
Posts: 1145
Joined: Tue Nov 17, 2015 1:57 pm

Re: Physical RAM in GB with MEMUSE (nsclient)

Post 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.
Be sure to check out the Knowledgebase for helpful articles and solutions!
Locked