NRPE: Command not defined
-
- Posts: 108
- Joined: Wed Nov 18, 2015 11:19 pm
NRPE: Command not defined
Not sure why I'm getting this error. can you provide some guidance?
[nagios]$ /usr/local/nagios/libexec/check_nrpe -H x.x.x.x -t 3 0 -c check_mailq -a -w 100 -c 200
NRPE: Command 'check_mailq' not defined
however I clearly see it in /usr/local/nagios/etc/commands.cfg
define command {
command_name check_mailq
command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -t 30 -c $ARG1$ $ARG2$
}
[nagios]$ /usr/local/nagios/libexec/check_nrpe -H x.x.x.x -t 3 0 -c check_mailq -a -w 100 -c 200
NRPE: Command 'check_mailq' not defined
however I clearly see it in /usr/local/nagios/etc/commands.cfg
define command {
command_name check_mailq
command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -t 30 -c $ARG1$ $ARG2$
}
Re: NRPE: Command not defined
hi
Please send us your system profile.
1. Login to the Nagios XI GUI using a web browser.
2. Click the "Admin" > "System Profile" Menu
3. Click the "Download Profile" button
4. Save the profile.zip file and share the file in a private message and then
reply to this post to bring it up in the queue.
Thanks
Please send us your system profile.
1. Login to the Nagios XI GUI using a web browser.
2. Click the "Admin" > "System Profile" Menu
3. Click the "Download Profile" button
4. Save the profile.zip file and share the file in a private message and then
reply to this post to bring it up in the queue.
Thanks
Re: NRPE: Command not defined
Hi
When I loaded your System Profile I see this when I go to Configure, CCM, Commands:
In /usr/local/nagios/etc/commands.cfg:
The check_mailq command should be calling out the check_mailq plugin, so it should look something like this:
And then the service definition should look something like this:
Note: I hard-coded the arguments in the command definition, and didn't provide for them
in the Service definition to save time. If you want me to reconfigure the command and
service to do this please let me know.
Let me know if you run into anything else.
Thanks
When I loaded your System Profile I see this when I go to Configure, CCM, Commands:
In /usr/local/nagios/etc/commands.cfg:
Code: Select all
define command {
command_name check_mailq
command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -t 30 -c $ARG1$ $ARG2$
}
in the Service definition to save time. If you want me to reconfigure the command and
service to do this please let me know.
Let me know if you run into anything else.
Thanks
You do not have the required permissions to view the files attached to this post.
-
- Posts: 108
- Joined: Wed Nov 18, 2015 11:19 pm
Re: NRPE: Command not defined
this was working before we switched mail servers.
we are using nrpe checks and nrpe agent to trigger the check on the remote hosts with sudo
we are using nrpe checks and nrpe agent to trigger the check on the remote hosts with sudo
-
- Posts: 108
- Joined: Wed Nov 18, 2015 11:19 pm
Re: NRPE: Command not defined
[nagios@ ~]$ /usr/local/nagios/libexec/check_nrpe -H x.x.x.x -t 30 -c check_mailqJSL
I tried creating a new check per your instructions, but still can not reach my server through nrpe.
I tried creating a new check per your instructions, but still can not reach my server through nrpe.
Re: NRPE: Command not defined
Hi
On the remote server try:
Also make sure port 5666 is open on the remote system:
If it's not listed then:
If it's still not connecting please send me the error message you are getting.
Thanks
On the remote server try:
Code: Select all
systemctl enable nrpe
systemctl status nrpe
Code: Select all
firewall-cmd --list-ports
Code: Select all
firewall-cmd --add-port=5666/tcp --permanent
firewall-cmd --reload
firewall-cmd --list-ports
Thanks
-
- Posts: 108
- Joined: Wed Nov 18, 2015 11:19 pm
Re: NRPE: Command not defined
we are running nrpe through xinetd
[root]# cd /etc/xinetd.d
[root]# ls
xxxxx nrpe xxxxx
[root]# service xinetd status
Redirecting to /bin/systemctl status xinetd.service
● xinetd.service - Xinetd A Powerful Replacement For Inetd
Loaded: loaded (/usr/lib/systemd/system/xinetd.service; enabled; vendor preset: enabled)
Active: active (running) since Mon 2021-11-08 16:05:41 PST; 2 days ago
AND we are not running any firewall AND all other checks on this server work.
[root]# firewall-cmd --list-ports
FirewallD is not running
[root]# cd /etc/xinetd.d
[root]# ls
xxxxx nrpe xxxxx
[root]# service xinetd status
Redirecting to /bin/systemctl status xinetd.service
● xinetd.service - Xinetd A Powerful Replacement For Inetd
Loaded: loaded (/usr/lib/systemd/system/xinetd.service; enabled; vendor preset: enabled)
Active: active (running) since Mon 2021-11-08 16:05:41 PST; 2 days ago
AND we are not running any firewall AND all other checks on this server work.
[root]# firewall-cmd --list-ports
FirewallD is not running
Re: NRPE: Command not defined
Hi
Please send the host cfg for the server that you are trying to run check_mailq on from
/usr/local/nagios/etc on the Nagios server.
Thanks!
Please send the host cfg for the server that you are trying to run check_mailq on from
/usr/local/nagios/etc on the Nagios server.
Thanks!
-
- Posts: 108
- Joined: Wed Nov 18, 2015 11:19 pm
Re: NRPE: Command not defined
I am running the check_nrpe -c check_mailq from the nagios server
Below is the host config. looks like I have 2 for the local box
[]$ more localhost.cfg
###############################################################################
#
# Hosts configuration file
#
# Created by: Nagios CCM 3.1.4
# Date: 2021-11-09 11:42:15
# Version: Nagios Core 4.x
#
# --- DO NOT EDIT THIS FILE BY HAND ---
# Nagios CCM will overwrite all manual settings during the next update if you
# would like to edit files manually, place them in the 'static' directory or
# import your configs into the CCM by placing them in the 'import' directory.
#
###############################################################################
define host {
host_name localhost
use linux-server
alias localhost
address 127.0.0.1
register 1
}
###############################################################################
#
# Hosts configuration file
#
# END OF FILE
#
###############################################################################
and another one, just in case
[]$ more NagiosXI_Local_Server.cfg
###############################################################################
#
# Hosts configuration file
#
# Created by: Nagios CCM 3.1.4
# Date: 2021-11-09 11:42:16
# Version: Nagios Core 4.x
#
# --- DO NOT EDIT THIS FILE BY HAND ---
# Nagios CCM will overwrite all manual settings during the next update if you
# would like to edit files manually, place them in the 'static' directory or
# import your configs into the CCM by placing them in the 'import' directory.
#
###############################################################################
define host {
host_name NagiosXI_Local_Server
use linux-server
alias NagiosXI_Local_Server
display_name NagiosXI_Local_Server
address 127.0.0.1
register 1
}
###############################################################################
#
# Hosts configuration file
#
# END OF FILE
#
###############################################################################
Below is the host config. looks like I have 2 for the local box
[]$ more localhost.cfg
###############################################################################
#
# Hosts configuration file
#
# Created by: Nagios CCM 3.1.4
# Date: 2021-11-09 11:42:15
# Version: Nagios Core 4.x
#
# --- DO NOT EDIT THIS FILE BY HAND ---
# Nagios CCM will overwrite all manual settings during the next update if you
# would like to edit files manually, place them in the 'static' directory or
# import your configs into the CCM by placing them in the 'import' directory.
#
###############################################################################
define host {
host_name localhost
use linux-server
alias localhost
address 127.0.0.1
register 1
}
###############################################################################
#
# Hosts configuration file
#
# END OF FILE
#
###############################################################################
and another one, just in case
[]$ more NagiosXI_Local_Server.cfg
###############################################################################
#
# Hosts configuration file
#
# Created by: Nagios CCM 3.1.4
# Date: 2021-11-09 11:42:16
# Version: Nagios Core 4.x
#
# --- DO NOT EDIT THIS FILE BY HAND ---
# Nagios CCM will overwrite all manual settings during the next update if you
# would like to edit files manually, place them in the 'static' directory or
# import your configs into the CCM by placing them in the 'import' directory.
#
###############################################################################
define host {
host_name NagiosXI_Local_Server
use linux-server
alias NagiosXI_Local_Server
display_name NagiosXI_Local_Server
address 127.0.0.1
register 1
}
###############################################################################
#
# Hosts configuration file
#
# END OF FILE
#
###############################################################################