check_nrpe

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
nebblkshts
Posts: 58
Joined: Tue Dec 08, 2015 7:35 am

Re: check_nrpe

Post by nebblkshts »

hsmith wrote:So if you run ./check_nrpe -H LYNCFE2 -c CheckMem -a MaxWarn=80% MaxCrit=90% ShowAll type=physical it works, you stated earlier. Yes

This is your service definition:

Code: Select all

define service {
use infra-trivial-service
host_name LYNCFE2
service_description Memory Usage
check_command check_nrpe!CheckMem!-a MaxWarn=80% MaxCrit=90% ShowAll type=physical
}
This looks good. Yes This is the definition

This is your check_nrpe command:

Code: Select all

command_line                             $USER1$/check_nrpe -H $HOSTADDRESS$ -t 30 -c '$ARG1$' '$ARG2$'
I can't see a reason this wouldn't be working right now. Everything should be getting passed correctly. Can you please upload a screenshot of the error you are getting in the GUI?
Yes, but I have it commented out because of the following information I just noticed
Warning: Duplicate definition found for command 'check_nrpe' (config file '/etc/nagios3/objects/commands.cfg', starting on line 65)
Error: Could not add object property in file '/etc/nagios3/objects/commands.cfg' on line 66.
Error processing object config files!


***> One or more problems was encountered while processing the config files...

Check your configuration file(s) to ensure that they contain valid
directives and data defintions. If you are upgrading from a previous
version of Nagios, you should be aware that some variables/definitions
may have been removed or modified in this version. Make sure to read
the HTML documentation regarding the config files, as well as the
'Whats New' section to find out what has changed.

* errors in config!
and

Code: Select all

#NRPE Definition
#define command{
#        command_name check_nrpe
#        /usr/lib/nagios/plugins/check_nrpe -H $HOSTADDRESS$ -t 30 -c '$ARG1$' '$ARG2$'
#}

# 'check_ups' command definition
define command{
        command_name    check_ups
        command_line    $USER1$/check_nrpe -H $HOSTADDRESS$ -t 30 -c $ARG1$ $ARG2$
        }
and here is the gui screenshot
Attachments
checknrpe.png
checknrpe.png (8.28 KiB) Viewed 2871 times
User avatar
hsmith
Agent Smith
Posts: 3539
Joined: Thu Jul 30, 2015 11:09 am
Location: 127.0.0.1
Contact:

Re: check_nrpe

Post by hsmith »

You have two commands.cfg files. One of them has the check_nrpe commented out and the other does not. If you changed them both to have it commented out, then it will absolutely fail.
Former Nagios Employee.
me.
nebblkshts
Posts: 58
Joined: Tue Dec 08, 2015 7:35 am

Re: check_nrpe

Post by nebblkshts »

I only one of them commented out (/etc/nagios3/objects/commands.cfg) the other one(/etc/nagios3/commands.cfg) did not seem to do anything. and if I reverse these two I get the same error.
Warning: Duplicate definition found for command 'check_nrpe' (config file '/etc/nagios3/objects/commands.cfg', starting on line 65)
Error: Could not add object property in file '/etc/nagios3/objects/commands.cfg' on line 66.
Error processing object config files!


***> One or more problems was encountered while processing the config files...

Check your configuration file(s) to ensure that they contain valid
directives and data defintions. If you are upgrading from a previous
version of Nagios, you should be aware that some variables/definitions
may have been removed or modified in this version. Make sure to read
the HTML documentation regarding the config files, as well as the
'Whats New' section to find out what has changed.

* errors in config!
Which I thought that meant the system must be trying to use this config file (/etc/nagios3/objects/commands.cfg) which has the code commented out.
User avatar
hsmith
Agent Smith
Posts: 3539
Joined: Thu Jul 30, 2015 11:09 am
Location: 127.0.0.1
Contact:

Re: check_nrpe

Post by hsmith »

What's the output of ls /etc/nagios3/conf.d ?
Former Nagios Employee.
me.
nebblkshts
Posts: 58
Joined: Tue Dec 08, 2015 7:35 am

Re: check_nrpe

Post by nebblkshts »

administrator@NETSERVICES:/usr/lib/nagios/plugins$ ls /etc/nagios3/conf.d
contacts_nagios2.off generic-host_nagios2.off hostgroups_nagios2.off services_nagios2.off
extinfo_nagios2.off generic-service_nagios2.off localhost_nagios2.off timeperiods_nagios2.off
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: check_nrpe

Post by lmiltchev »

Can you post the 'nagios.cfg', '/etc/nagios3/objects/commands.cfg', and '/etc/nagios3/commands.cfg' file?
Be sure to check out our Knowledgebase for helpful articles and solutions!
nebblkshts
Posts: 58
Joined: Tue Dec 08, 2015 7:35 am

Re: check_nrpe

Post by nebblkshts »

Here you go.
Attachments
commands(Objects).cfg
(7.12 KiB) Downloaded 285 times
commands(Nagios3).cfg
(2.81 KiB) Downloaded 292 times
nagios.cfg
(44.13 KiB) Downloaded 290 times
User avatar
hsmith
Agent Smith
Posts: 3539
Joined: Thu Jul 30, 2015 11:09 am
Location: 127.0.0.1
Contact:

Re: check_nrpe

Post by hsmith »

Can you do the following?

Code: Select all

cd /etc/conf.d/nagios3
mv * ~
pkill -9 nagios
service nagios3 start
grep -r -e "command_name.*check_nrpe" /var/cache/nagios3/objects.cache
Let me know what happens. Thanks!
Former Nagios Employee.
me.
nebblkshts
Posts: 58
Joined: Tue Dec 08, 2015 7:35 am

Re: check_nrpe

Post by nebblkshts »

I get the same issue. GUI has the error but everything moved and started just fine. the grep had this result:
command_name check_nrpe
command_name check_nrpe_1arg
User avatar
hsmith
Agent Smith
Posts: 3539
Joined: Thu Jul 30, 2015 11:09 am
Location: 127.0.0.1
Contact:

Re: check_nrpe

Post by hsmith »

What is in the /etc/nagios-plugins/config directory?
Former Nagios Employee.
me.
Locked