Service & Host check command 'is_reacheable' is not defined

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Siddharth Hegde
Posts: 70
Joined: Mon Aug 07, 2017 4:19 am

Service & Host check command 'is_reacheable' is not defined

Post by Siddharth Hegde »

Hi,

I recently installed nagios and nrpe using the following tutorial and i have created some host files also

https://www.digitalocean.com/community/ ... requisites

However, when i try to check nagios configuration using

sudo /usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg

I get,

Host check command 'is_reacheable' and Service check command 'is_reacheable' specified for host 'abc' is not defined anywhere!

And when i check nrpe by using,

sudo /usr/local/nagios/libexec/check_nrpe -H remote_host_ip, I'll get

CHECK_NRPE: Error - Could not complete SSL handshake.

Thank you in advance for all the suggestions
npolovenko
Support Tech
Posts: 3457
Joined: Mon May 15, 2017 5:00 pm

Re: Service & Host check command 'is_reacheable' is not defi

Post by npolovenko »

Hello, @Siddharth Hegde. I'd like to see your service command definitions for the host ABC. Would you be able to upload the whole /usr/local/nagios/etc/ folder from the Nagios server? You could use FileZilla or WinSCP, or a similar software for that.
CHECK_NRPE: Error - Could not complete SSL handshake.
1.Let's make sure that the NRPE agent is actually running on the remote server. Please run the following command on the remote server and show us the output:

Code: Select all

service nrpe status
or
sudo systemctl status nrpe.service
2. If nrpe satus is ok, please upload the following file:

Code: Select all

/usr/local/nagios/etc/nrpe.cfg
Thank you.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Siddharth Hegde
Posts: 70
Joined: Mon Aug 07, 2017 4:19 am

Re: Service & Host check command 'is_reacheable' is not defi

Post by Siddharth Hegde »

Hi @npolovenko,

Thanks for replying.

How do I send /usr/local/nagios/etc/ folder to you?

1. Let's make sure that the NRPE agent is actually running on the remote server. Please run the following command on the remote server and show us the output:

service nrpe status
nrpe stop/waiting

Then I tried service nrpe start, i got

service nrpe start
start: Rejected send message, 1 matched rules; type="method_call", sender=":1.158" (uid=1007 pid=57946 comm="start nrpe ") interface="com.ubuntu.Upstart0_6.Job" member="Start" error name="(unset)" requested_reply="0" destination="com.ubuntu.Upstart" (uid=0 pid=1 comm="/sbin/init")

But if i tried

$ nrpe -

NRPE - Nagios Remote Plugin Executor
Copyright (c) 1999-2008 Ethan Galstad ([email protected])
Version: 2.15
Last Modified: 09-06-2013
License: GPL v2 with exemptions (-l for more info)
SSL/TLS Available: Anonymous DH Mode, OpenSSL 0.9.6 or higher required
TCP Wrappers Available

***************************************************************
** POSSIBLE SECURITY RISK - COMMAND ARGUMENTS ARE SUPPORTED! **
** Read the NRPE SECURITY file for more information **
***************************************************************

Usage: nrpe [-n] -c <config_file> [-4|-6] <mode>

Options:
-n = Do not use SSL
<config_file> = Name of config file to use
-4 = use ipv4 only
-6 = use ipv6 only
<mode> = One of the following operating modes:
-i = Run as a service under inetd or xinetd
-d = Run as a standalone daemon
-d -s = Run as a subsystem under AIX

Notes:
This program is designed to process requests from the check_nrpe
plugin on the host(s) running Nagios. It can run as a service
under inetd or xinetd (read the docs for info on this), or as a
standalone daemon. Once a request is received from an authorized
host, NRPE will execute the command/plugin (as defined in the
config file) and return the plugin output and return code to the
check_nrpe plugin.
npolovenko
Support Tech
Posts: 3457
Joined: Mon May 15, 2017 5:00 pm

Re: Service & Host check command 'is_reacheable' is not defi

Post by npolovenko »

@Siddharth Hegde
How do I send /usr/local/nagios/etc/ folder to you?
You'd download a copy of that folder on your computer using WinSCP or FileZilla, archive the folder so it becomes a single zip file. And then you can either attach the zip file with your next post, or you could upload the file to a cloud storage of your choice and share a link with us.
start: Rejected send message, 1 matched rules; type="method_call", sender=":1.158" (uid=1007 pid=57946 comm="start nrpe ") interface="com.ubuntu.Upstart0_6.Job" member="Start" error name="(unset)" requested_reply="0" destination="com.ubuntu.Upstart" (uid=0 pid=1 comm="/sbin/init")
That probably means the user you're signed in as right now doesn't have permissions to start nrpe. But you could switch the user to nagios with su - nagios, and then attempt to start it.
NRPE - Nagios Remote Plugin Executor
Copyright (c) 1999-2008 Ethan Galstad ([email protected])
Version: 2.15
How did that happen? The article that you referenced uses nrpe version 3.2.1. I'd recommend starting all over, at least with the NRPE agent part. Would you be able to wipe the remote computer, so that way you could start from a "clean state"? Here's the official guide on how to install nrpe agent on a remote system: https://support.nagios.com/kb/article.php?id=515
You can follow it line by line and that will get you started.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Siddharth Hegde
Posts: 70
Joined: Mon Aug 07, 2017 4:19 am

Re: Service & Host check command 'is_reacheable' is not defi

Post by Siddharth Hegde »

Hi @npolovenko,

Sorry for the late reply.

I've uploaded /usr/local/nagios/etc/ folder in the attachment.

I tried to reinstall again using the link provided by you. But i'm getting nrpe start/running, process 36792 when i try sudo start nrpe, but when i check sudo status nrpe, i'm getting nrpe stop/waiting. i even trued using sudo su nagios

And when i try this /usr/local/nagios/libexec/check_nrpe -H 127.0.0.1 -c check_load, i'll get OK - load average: 0.03, 0.10, 0.12|load1=0.030;15.000;30.000;0; load5=0.100;10.000;25.000;0; load15=0.120;5.000;20.000;0; but when I add my server ip address (both private and public), i'm getting CHECK_NRPE: Error - Could not connect to 10.x.x.x: Connection reset by peer
You do not have the required permissions to view the files attached to this post.
npolovenko
Support Tech
Posts: 3457
Joined: Mon May 15, 2017 5:00 pm

Re: Service & Host check command 'is_reacheable' is not defi

Post by npolovenko »

@Siddharth Hegde, It seems like you may have multiple instances of NRPE on your system because you installed it more than one time.
I tried to reinstall again using the link provided by you.
But did you wipe the system before or reverted the VM to clean state before reinstalling it? Installing one NRPE on top of another will give you problems in a long run.

Please run the following command and show us the output:

Code: Select all

ps -aef | grep nrpe
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Siddharth Hegde
Posts: 70
Joined: Mon Aug 07, 2017 4:19 am

Re: Service & Host check command 'is_reacheable' is not defi

Post by Siddharth Hegde »

Hi @npolovenko,

ps -aef | grep nrpe
siddarth 758 749 0 05:39 pts/0 00:00:00 grep nrpe
nagios 34138 1 0 Jan08 ? 00:00:00 /usr/sbin/nrpe -c /etc/nagios/nrpe.cfg -d

I'm not allowed to wipe or revert the VM as there are services running in them. Please can i know how to properly/completely uninstall or remove nrpe and plugins so I can reinstall them?
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Service & Host check command 'is_reacheable' is not defi

Post by lmiltchev »

The check_command that is defined in the "host01" host definition doesn't exist in the commands.cfg. You should replace it with a command that is available, e.g. "check-host-alive".

Example:

Code: Select all

define host {
        use                             linux-server
        host_name                       host01 
        alias                           host01
        address                         remote-host-publicip
        check_command                   check-host-alive
        max_check_attempts              5
        check_period                    24x7
        notification_interval           15
        notification_period             24x7
	contact_groups                  nagiosadmin
}
Also, replace "is_reacheable" with "check_ping" in the "PING" service on "host01".

Example:

Code: Select all

define service {
        use                             generic-service
        host_name                       host01
        service_description             PING
        check_command                   check_ping
	 contact_groups                  nagiosadmin
}
Verify your configuration:

Code: Select all

sudo /usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg
If there are no config errors, restart nagios.

As far as nrpe goes, you should be able to start/restart, and check the status of nrpe by running:

Code: Select all

sudo systemctl start nrpe.service
sudo systemctl restart nrpe.service
sudo systemctl status nrpe.service
Let us know if this helped.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Siddharth Hegde
Posts: 70
Joined: Mon Aug 07, 2017 4:19 am

Re: Service & Host check command 'is_reacheable' is not defi

Post by Siddharth Hegde »

Hi @lmiltchev,

check-host-alive and check_ping is working now, Thanks.

But, I'm still getting check command errors for some services like tomcat,mongodb,website response, neo4j, rabbitmq and they are in /usr/local/nagios/libexec.

I have uploaded /usr/local/nagios/libexec folder also for reference.
You do not have the required permissions to view the files attached to this post.
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Service & Host check command 'is_reacheable' is not defi

Post by lmiltchev »

Without seeing the errors, we wouldn't know what to look for. Usually, errors tell you what the problem is. You will need to modify your configs to fix the issue, and verify the configuration again. Once, the configs are "error free", you can restart nagios, so that changes can take effect.

I would suggest that you try this on your own. We will help you if you get stuck on something.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked