CPULOAD,MEMUSE,Check_mem

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
grayloglearn
Posts: 222
Joined: Thu Jul 06, 2017 8:55 am

CPULOAD,MEMUSE,Check_mem

Post by grayloglearn »

Hi Team,

I have small doubt on check_nt and check_nrpe. First i will discuss on check_nt

root@ip-XXXX:/usr/local/nagios/libexec# ./check_nt -H XXXX -s 'Password@123' -p 12489 -v MEMUSE -w 80 -c 90
Memory usage: total:9215.69 MB - used: 1055.69 MB (11%) - free: 8160.00 MB (89%) | 'Memory usage'=1055.69MB;7372.55;8294.12;0.00;9215.69

Nsclient is agent for windows which works on port 12489 till i am fine

I understand that check_nt is calling the remote XXXX host to get the Memory utilization. But what is this MEMUSE.

MEMUSE is an plugin ? If plugin where is stored in windows server ? what is path for that MEMUSE and also(USEDDISKSPACE,CPULOAD)

Why we use check_nrpe plugin in windows again as i know that its an linux agent. How it will help us in windows??

check_nrpe is an linux agent which calls to get the details of usage/cpu/memory etc

in the below check_mem is what, I understand the command -c then check_mem
$USER1$/check_nrpe -H $HOSTADDRESS$ -t 30 -c $ARG1$ $ARG2$


[nagios@ip XXXX ~]$ /usr/local/nagios/libexec/check_nrpe -H XXXX -t 30 -c check_mem -a '-w 20 -c 10'
OK - 894 / 992 MB (90%) Free Memory, Used: 543 MB, Shared: 0 MB, Buffers: 21 MB, Cached: 445 MB | total=992MB free=894MB used=543MB shared=0MB buffers=21MB cached=445MB

Again check_nrpe using -c check_mem (The plugin is not having in linux agent and nagios server but i am getting the memory output) I am attaching the screenshot of libexec folder for server and client.

Does Agent should have all plugins ??

why all these MEMUSE and check_mem (Are these separate plugin but i have not seen these plugin any path like in /usr/local/nagios/libexec folder)

in linux agent i am able to see check_load. And few like check_open_files.pl is monitoring open files. Again -c check_open_file.py plugin is in linux agent server

For this check_open_files check_nrpe calling the remote plugin which is stored in libexe

-c means what Does it calling the remote the plugin ?

/usr/local/nagios/libexec/check_nrpe -H XXXX -t 30 -c check_open_files -a '-w 30 -c 50'
OK: 512 open files (0% of max 99764)|opened_files=512;29929;49882

Excuse me, if i ask more but i need some clarification on variable names after -c and -v , what are those ? Does those plugins (if plugins not seen check_mem in libexe folder)
You do not have the required permissions to view the files attached to this post.
User avatar
mbellerue
Posts: 1403
Joined: Fri Jul 12, 2019 11:10 am

Re: CPULOAD,MEMUSE,Check_mem

Post by mbellerue »

I understand that check_nt is calling the remote XXXX host to get the Memory utilization. But what is this MEMUSE.

MEMUSE is an plugin ? If plugin where is stored in windows server ? what is path for that MEMUSE and also(USEDDISKSPACE,CPULOAD)
MEMUSE, USEDDISKSPACE, and CPULOAD are all variables that NSClient keeps track of and reports back when queries. The code that actually drives them is installed with NSClient, usually at C:\Program Files\NSClient++\.
Why we use check_nrpe plugin in windows again as i know that its an linux agent. How it will help us in windows??
Typically, NRPE is a Linux client. However, NSClient++ also allows you to use NRPE checks in Windows. You do have to change some settings in nsclient.ini. I'm not certain about check_nt, but NRPE communication can be secured. That may be one of the differences.
Again check_nrpe using -c check_mem (The plugin is not having in linux agent and nagios server but i am getting the memory output) I am attaching the screenshot of libexec folder for server and client.
check_mem translates automatically to custom_check_mem, which does reside on the client side.
-c means what Does it calling the remote the plugin ?
Yes -c, or --command=, tells NRPE what to execute on the client side. You can get more information on these command line switches by running,

Code: Select all

/usr/local/nagios/libexec/check_nrpe --help
/usr/local/nagios/libexec/check_nrpe -H XXXX -t 30 -c check_open_files -a '-w 30 -c 50'
OK: 512 open files (0% of max 99764)|opened_files=512;29929;49882

Excuse me, if i ask more but i need some clarification on variable names after -c and -v , what are those ?
The '-w 30 -c 50' variables? Those are the warning and critical thresholds. In this example, they are expecting to see a percentage of the maximum.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

Be sure to check out our Knowledgebase for helpful articles and solutions!
grayloglearn
Posts: 222
Joined: Thu Jul 06, 2017 8:55 am

Re: CPULOAD,MEMUSE,Check_mem

Post by grayloglearn »

Thanks for the reply,

i understand check_nrpe is also we can use the monitor for windows client.

Could you please tell me what are variables we can use after ./check_nrpe -H XXXX -c (check_load, check_mem...etc)
I want list of variables name what we can use check_nrpe
I want list of variables name what we can use check_nt -V (CPULOAD,MEMUSE).

Please help with those two.
User avatar
mbellerue
Posts: 1403
Joined: Fri Jul 12, 2019 11:10 am

Re: CPULOAD,MEMUSE,Check_mem

Post by mbellerue »

The best resource for this is to look at the modules that you have enabled in nsclient.ini, and check the NSClient++ documentation. For example, here is the CheckSystem module that includes checkmem.

https://docs.nsclient.org/reference/win ... eckSystem/
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

Be sure to check out our Knowledgebase for helpful articles and solutions!
grayloglearn
Posts: 222
Joined: Thu Jul 06, 2017 8:55 am

Re: CPULOAD,MEMUSE,Check_mem

Post by grayloglearn »

So as per my understand the default variables on check_nt as below. Apart from we don't have someother variable. We can monitor all the below. If we want to monitor something more we should create our own plugin then we should call correct me if i am wrong.


check_cpu Check that the load of the CPU(s) are within bounds.
check_memory Check free/used memory on the system.
check_network Check network interface status.
check_os_version Check the version of the underlaying OS.
check_pagefile Check the size of the system pagefile(s).
check_pdh Check the value of a performance (PDH) counter on the local or remote system.
check_process Check state/metrics of one or more of the processes running on the computer.
check_service Check the state of one or more of the computer services.
check_uptime Check time since last server re-boot.
checkcounter Legacy version of check_pdh
checkcpu Legacy version of check_cpu
checkmem Legacy version of check_mem
checkprocstate Legacy version of check_process
checkservicestate Legacy version of check_service
checkuptime Legacy version of check_uptime


Could you please send the same link for chck_nrpe. Like( https://docs.nsclient.org/reference/win ... eckSystem/)
User avatar
mbellerue
Posts: 1403
Joined: Fri Jul 12, 2019 11:10 am

Re: CPULOAD,MEMUSE,Check_mem

Post by mbellerue »

NSClient++ provides the data for both check_nt, and check_nrpe plugins. If you take a look at your nsclient.ini file, you will find a section called /modules, which will determine what is available to those plugins. For example, I have attached a screenshot of my nsclient.ini file. Under /modules, I have CheckSystem = true, and CheckEventLog = true. Therefore I have access to the variables mentioned previously, as well as the variables mentioned here,
https://docs.nsclient.org/reference/win ... kEventLog/
You do not have the required permissions to view the files attached to this post.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

Be sure to check out our Knowledgebase for helpful articles and solutions!
grayloglearn
Posts: 222
Joined: Thu Jul 06, 2017 8:55 am

Re: CPULOAD,MEMUSE,Check_mem

Post by grayloglearn »

i understand but i am attaching the my nsclient.ini. In that file i am not seeing any such variable names. Could you please help on this.
And you said MEMUSE will in /nsclient ++/ Folder but i am not able to see that aslo i mean where is located path. Could you please clarify both :-)

Support Edit: nsclient-support (1).txt downloaded and shared with team
User avatar
mbellerue
Posts: 1403
Joined: Fri Jul 12, 2019 11:10 am

Re: CPULOAD,MEMUSE,Check_mem

Post by mbellerue »

Ah, the full list can be found by running check_nt --help
Valid variables are:
CLIENTVERSION = Get the NSClient version
If -l <version> is specified, will return warning if versions differ.
CPULOAD =
Average CPU load on last x minutes.
Request a -l parameter with the following syntax:
-l <minutes range>,<warning threshold>,<critical threshold>.
<minute range> should be less than 24*60.
Thresholds are percentage and up to 10 requests can be done in one shot.
ie: -l 60,90,95,120,90,95
UPTIME =
Get the uptime of the machine.
-l <unit>
<unit> = seconds, minutes, hours, or days. (default: minutes)
Thresholds will use the unit specified above.
USEDDISKSPACE =
Size and percentage of disk use.
Request a -l parameter containing the drive letter only.
Warning and critical thresholds can be specified with -w and -c.
MEMUSE =
Memory use.
Warning and critical thresholds can be specified with -w and -c.
SERVICESTATE =
Check the state of one or several services.
Request a -l parameters with the following syntax:
-l <service1>,<service2>,<service3>,...
You can specify -d SHOWALL in case you want to see working services
in the returned string.
PROCSTATE =
Check if one or several process are running.
Same syntax as SERVICESTATE.
COUNTER =
Check any performance counter of Windows NT/2000.
Request a -l parameters with the following syntax:
-l "\\<performance object>\\counter","<description>
The <description> parameter is optional and is given to a printf
output command which requires a float parameter.
If <description> does not include "%%", it is used as a label.
Some examples:
"Paging file usage is %%.2f %%%%"
"%%.f %%%% paging file used."
INSTANCES =
Check any performance counter object of Windows NT/2000.
Syntax: check_nt -H <hostname> -p <port> -v INSTANCES -l <counter object>
<counter object> is a Windows Perfmon Counter object (eg. Process),
if it is two words, it should be enclosed in quotes
The returned results will be a comma-separated list of instances on
the selected computer for that object.
The purpose of this is to be run from command line to determine what instances
are available for monitoring without having to log onto the Windows server
to run Perfmon directly.
It can also be used in scripts that automatically create Nagios service
configuration files.
Some examples:
check_nt -H 192.168.1.1 -p 1248 -v INSTANCES -l Process
As for the modules, you should be able to find them in C:\Program Files\NSClient++\modules\. From there you should be able to tie them to the documentation on NSClient's site.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

Be sure to check out our Knowledgebase for helpful articles and solutions!
grayloglearn
Posts: 222
Joined: Thu Jul 06, 2017 8:55 am

Re: CPULOAD,MEMUSE,Check_mem

Post by grayloglearn »

Hi Team,

Thanks for the reply, Able to only few modules in nsclient/moduel folder and tried with check_nt --help able to see what you past in above post. And check_nrpe --help has not given same as check_nt, Please find the attachment for module which are showing(memuse,cpuload...etc few modules are not able to see) . Find the below check_nrpe --help. Tell us what we have to do same as check_nrpe modules names default.

root@ip-XXXX:/usr/local/nagios/libexec# ./check_nrpe --help
NRPE Plugin for Nagios
Version: 3.2.1

Copyright (c) 2009-2017 Nagios Enterprises
1999-2008 Ethan Galstad ([email protected])

Last Modified: 2017-09-01

License: GPL v2 with exemptions (-l for more info)

SSL/TLS Available: OpenSSL 0.9.6 or higher required

Usage: check_nrpe -H <host> [-2] [-4] [-6] [-n] [-u] [-V] [-l] [-d <dhopt>]
[-P <size>] [-S <ssl version>] [-L <cipherlist>] [-C <clientcert>]
[-K <key>] [-A <ca-certificate>] [-s <logopts>] [-b <bindaddr>]
[-f <cfg-file>] [-p <port>] [-t <interval>:<state>] [-g <log-file>]
[-c <command>] [-E] [-a <arglist...>]

Options:
-H, --host=HOST The address of the host running the NRPE daemon
-2, --v2-packets-only Only use version 2 packets, not version 3
-4, --ipv4 Bind to ipv4 only
-6, --ipv6 Bind to ipv6 only
-n, --no-ssl Do no use SSL
-u, --unknown-timeout Make connection problems return UNKNOWN instead of CRITICAL
-V, --version Print version info and quit
-l, --license Show license
-E, --stderr-to-stdout Redirect stderr to stdout
-d, --use-dh=DHOPT Anonymous Diffie Hellman use:
0 Don't use Anonymous Diffie Hellman
(This will be the default in a future release.)
1 Allow Anonymous Diffie Hellman (default)
2 Force Anonymous Diffie Hellman
-P, --payload-size=SIZE Specify non-default payload size for NSClient++
-S, --ssl-version=VERSION The SSL/TLS version to use. Can be any one of:
SSLv2 SSL v2 only
SSLv2+ SSL v2 or above
SSLv3 SSL v3 only
SSLv3+ SSL v3 or above
TLSv1 TLS v1 only
TLSv1+ TLS v1 or above (DEFAULT)
TLSv1.1 TLS v1.1 only
TLSv1.1+ TLS v1.1 or above
TLSv1.2 TLS v1.2 only
TLSv1.2+ TLS v1.2 or above
-L, --cipher-list=LIST The list of SSL ciphers to use (currently defaults
to "ALL:!MD5:@STRENGTH". THIS WILL change in a future release.)
-C, --client-cert=FILE The client certificate to use for PKI
-K, --key-file=FILE The private key to use with the client certificate
-A, --ca-cert-file=FILE The CA certificate to use for PKI
-s, --ssl-logging=OPTIONS SSL Logging Options
-b, --bind=IPADDR Local address to bind to
-f, --config-file=FILE Configuration file to use
-g, --log-file=FILE Log file to write to
-p, --port=PORT The port on which the daemon is running (default=5666)
-c, --command=COMMAND The name of the command that the remote daemon should run
-a, --args=LIST Optional arguments that should be passed to the command,
separated by a space. If provided, this must be the last
option supplied on the command line.

NEW TIMEOUT SYNTAX
-t, --timeout=INTERVAL:STATE
INTERVAL Number of seconds before connection times out (default=10)
STATE Check state to exit with in the event of a timeout (default=CRITICAL)
Timeout STATE must be a valid state name (case-insensitive) or integer:
(OK, WARNING, CRITICAL, UNKNOWN) or integer (0-3)

Note:
This plugin requires that you have the NRPE daemon running on the remote host.
You must also have configured the daemon to associate a specific plugin command
with the [command] option you are specifying here. Upon receipt of the
[command] argument, the NRPE daemon will run the appropriate plugin command and
send the plugin output and return code back to *this* plugin. This allows you
to execute plugins on remote hosts and 'fake' the results to make Nagios think
the plugin is being run locally.
You do not have the required permissions to view the files attached to this post.
User avatar
mbellerue
Posts: 1403
Joined: Fri Jul 12, 2019 11:10 am

Re: CPULOAD,MEMUSE,Check_mem

Post by mbellerue »

I know you can use at least some of those variables with check_nrpe. The tricky piece here is that NSClient is a 3rd party application, and they made the NRPE translation for Windows in their client.

What may be useful for you is a more cohesive experience. We have a cross platform agent that you could try.
https://www.nagios.org/ncpa/
https://www.nagios.org/ncpa/getting-started.php#windows

If you need more help to find out what checks are available via check_nt or check_nrpe using NSClient, then the NSClient forums may be a better resource. Our plugins, check_nt and check_nrpe, simply query the client application.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked