How to tweak the metrics for number of files?

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
linearstack
Posts: 26
Joined: Tue Nov 07, 2017 7:35 pm

Re: How to tweak the metrics for number of files?

Post by linearstack »

While performing the NSCA setup on the server and NSClient++ on the host, I'm stuck as it's not communicating.
For NSCA Configuration on the Cent OS server I used the following link:

https://support.nagios.com/kb/article/n ... -x-79.html

During the installation of the NSCA I stuck on the following commands as it overwrites the previous files :
------------------------------------------------------------------------------------
cp src/nsca /usr/local/nagios/bin
cp sample-config/nsca.cfg /usr/local/nagios/etc
chown nagios.nagcmd /usr/local/nagios/etc/nsca.cfg
chmod g+r /usr/local/nagios/etc/nsca.cfg
cp src/send_nsca /usr/local/nagios/libexec
cp sample-config/send_nsca.cfg /usr/local/nagios/etc
cp sample-config/nsca.xinetd /etc/xinetd.d/nsca
------------------------------------------------------------------------------------
For Installing The Windows Agent NSClient++ on the host I used the following link :

https://assets.nagios.com/downloads/nag ... ios-XI.pdf

Kindly let me know where I'm lacking.
jomann
Development Lead
Posts: 611
Joined: Mon Apr 22, 2013 10:06 am
Location: Nagios Enterprises

Re: How to tweak the metrics for number of files?

Post by jomann »

You don't actually have to install NSCA - which is installed on Nagios XI already by default, and can be configured in the Inbound Transfer settings in the Admin section - to do what @lmiltchev mentioned earlier in this post. You just need to install NSClient++ and then setup the check to run using check_nrpe (which can be done using the NRPE wizard and selecting Windows on step 1 also).
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
linearstack
Posts: 26
Joined: Tue Nov 07, 2017 7:35 pm

Re: How to tweak the metrics for number of files?

Post by linearstack »

Hello,

I tried the steps provided by you, but the command is not generating any output.
And it is also not giving any error.
Is it something missing?
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: How to tweak the metrics for number of files?

Post by lmiltchev »

I tried the steps provided by you, but the command is not generating any output.
Can you show us the actual command run from the command line on the Nagios Xi server, along with the output of it?

Also run:

Code: Select all

/usr/local/nagios/libexec/check_nrpe -H <Windows IP>
and show the output.

Please post the nsclient.ini and nsclient.log from the Windows server.
Be sure to check out our Knowledgebase for helpful articles and solutions!
linearstack
Posts: 26
Joined: Tue Nov 07, 2017 7:35 pm

Re: How to tweak the metrics for number of files?

Post by linearstack »

I tried the command as per the instructions provided :
**********************************
[root@LABLINNIX01 ~]# /usr/local/nagios/libexec/check_nrpe -H 192.168.101.141 -c check_count -a '-p C:\Test -r -w 3 -c 6'
Exception processing request: Request contained arguments (not currently allowed, check the allow arguments option).
[root@LABLINNIX01 ~]#
**********************************
But it generated the above error. But if I run the command as :
**********************************
[root@LABLINNIX01 ~]# /usr/local/nagios/libexec/check_nrpe -H 192.168.101.141 -c check_count -a path=’C:\\Test’ ’warning=count>3’ ’critical=count>6’
[root@LABLINNIX01 ~]#
**********************************
This command didn't give any error but do not generate any output.
And the command you asked to run now has the following output:
**********************************
[root@LABLINNIX01 ~]# /usr/local/nagios/libexec/check_nrpe -H 192.168.101.141
I (0.4.4.23 2016-04-05) seem to be doing fine...
[root@LABLINNIX01 ~]#
**********************************
Please find the attached nsclient.ini file and nsclient.log file
You do not have the required permissions to view the files attached to this post.
User avatar
mcapra
Posts: 3739
Joined: Thu May 05, 2016 3:54 pm

Re: How to tweak the metrics for number of files?

Post by mcapra »

Please see this NSClient++ community thread for the solution:
https://forums.nsclient.org/t/arguments ... shell/3456
http://docs.nsclient.org/howto/external ... #arguments

There are a few configuration directives in your NSClient++ configuration file that may need to be set (depending on your NSClient++ version) in order for NSClient++ to allow args to be passed from check_nrpe.

The first 2 that come to mind:

Code: Select all

[/settings/NRPE/server]
allow arguments=true

[/settings/external scripts]
allow arguments=true
Former Nagios employee
https://www.mcapra.com/
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: How to tweak the metrics for number of files?

Post by lmiltchev »

@linearstack, let us know if allowing arguments under the [/settings/NRPE/server] and [/settings/external scripts] sections solved your problem.
Be sure to check out our Knowledgebase for helpful articles and solutions!
linearstack
Posts: 26
Joined: Tue Nov 07, 2017 7:35 pm

Re: How to tweak the metrics for number of files?

Post by linearstack »

Even after allowing the arguments in the under the [/settings/NRPE/server] and [/settings/external scripts] sections didn't solved the problem.
When tried to run the command it run witout any error but doesn't give any output
Following is the command after allowing the arguments :
**************************************************
[root@LABLINNIX01 ~]# /usr/local/nagios/libexec/check_nrpe -H 192.168.101.141 -c check_count -a path=’C:\\Test’ ’warning=count>3’ ’critical=count>6’
[root@LABLINNIX01 ~]# /usr/local/nagios/libexec/check_nrpe -H 192.168.101.141 -c check_count -a path=’C:\Test’ ’warning=count>3’ ’critical=count>6’
[root@LABLINNIX01 ~]#
**************************************************
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: How to tweak the metrics for number of files?

Post by lmiltchev »

In the example I showed you some time ago, I wrapped the arguments in single quotes, e.g.

Code: Select all

-a '<my arguments>'
as the way the command is defined, it expects only 1 argument... Also, don't use ">" for thresholds.

Instead of running this:

Code: Select all

/usr/local/nagios/libexec/check_nrpe -H 192.168.101.141 -c check_count -a path=’C:\\Test’ ’warning=count>3’ ’critical=count>6’
try running this:

Code: Select all

/usr/local/nagios/libexec/check_nrpe -H 192.168.101.141 -c check_count -a 'p C:\Test -r -w 3 -c 6'
Be sure to check out our Knowledgebase for helpful articles and solutions!
linearstack
Posts: 26
Joined: Tue Nov 07, 2017 7:35 pm

Re: How to tweak the metrics for number of files?

Post by linearstack »

Hello,

I am somehow now stuck on another message : ssl_err !=5
Please find the example :
******************************************************************************************
[root@LABLINNIX01 ~]# /usr/local/nagios/libexec/check_nrpe -H 192.168.101.141 -c check_count -a 'p C:\Test -r -w 3 -c 6'
CHECK_NRPE: (ssl_err != 5) Error - Could not complete SSL handshake with 192.168.101.141: 1
[root@LABLINNIX01 ~]# /usr/local/nagios/libexec/check_nrpe -H 192.168.101.141
CHECK_NRPE: (ssl_err != 5) Error - Could not complete SSL handshake with 192.168.101.141: 1
[root@LABLINNIX01 ~]#
******************************************************************************************
I tried to ping the 192.168.101.141 from 192.168.101.142(Nagios server) and vice versa and it is pinging fine.
Locked