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.
Whatever command you define in that top service (check_cpu in this example) needs to be defined in your nsclient.ini on the Windows server.
-- Note: This example is assuming you want to run a check through NRPE from NagiosB to PCClient1B, if you are just trying to check a port or something on PCClient1B by using check_http or something like that then you wouldn't need NagiosB to PCClient1B NRPE communication but they are achieving different goals, you may have a mix of them, it depends on how the plugin you are trying to use is meant to be run. Some are meant to be run from the Nagios server, some are meant to be run through NRPE or another agent on the remote machine's system.
[root@TestNagiosB]# /usr/local/nagios/libexec/check_nrpe -t 90 -H IPofPCClient1B -n -c check_cpu 'show-all'
OK: CPU load is ok.|'total 5m'=0%;80;90 'total 1m'=0%;80;90 'total 5s'=0%;80;90
You're searching for plugins on TestNagiosB when you should be looking for check_cpu and check_users in your Client1B nsclient.ini file, that check_cpu command is being run by ClientPC1B.
Thanks for the answer, and the explanation. Yes it as explained,some of the check are from NagiosB and others are run on the client PC locally.
I managed to execute the commands on the remote PCs at the location B, and get the data to Nagios A server. I have not managed to get the syntax of the define service
define host {
use windows-server
host_name LocationBLocalPCs
alias Location B PCs
address IPofNagiosB
max_check_attempts 3
check_period workhours
check_command check-host-alive
check_interval 3
notification_interval 60
notification_period workhours2
}
define service {
use generic-service
host_name LocatioBLocalPCs
service_description Disks at Local PC1
check_period workhours2
check_command check_nrpe_ext_remote_cpu_LocalBPC1
}
#############################################################################
# Definition of the check_nrpe_external in the Remote host is
# command[check_nrpe_external]=/usr/local/nagios/libexec/check_nrpe -t 90 -H $ARG1$ -n -c $ARG2$ $ARG3$
# with 3 Arguments and the -n option already given
##############################################################################
#
#
# Test Disk Status
define command {
command_name check_nrpe_ext_remote_cpu_LocalBPC1
command_line $USER1$/check_nrpe -t 90 -H IPofNagiosB -c check_nrpe_external -t 90 -a IPofClient1B alias_test
}
Could you please suggest me a better definition for the syntax to specify the commands for this example using alias_test.
define host {
use windows-server
host_name LocationBLocalPCs
alias Location B PCs
address IPofNagiosB
max_check_attempts 3
check_period workhours
check_command check-host-alive
check_interval 3
notification_interval 60
notification_period workhours2
}
define service {
use generic-service
host_name LocatioBLocalPCs
service_description Disks at Local PC1
check_period workhours2
check_command check_nrpe_ext_remote_cpu_LocalBPC1
}
#############################################################################
# Definition of the check_nrpe_external in the Remote host is
# command[check_nrpe_external]=/usr/local/nagios/libexec/check_nrpe -t 90 -H $ARG1$ -n -c $ARG2$ $ARG3$
# with 3 Arguments and the -n option already given
##############################################################################
#
#
# Test Disk Status
define command {
command_name check_nrpe_ext_remote_cpu_LocalBPC1
command_line $USER1$/check_nrpe -t 90 -H IPofNagiosB -c check_nrpe_external -t 90 -a IPofClient1B alias_test
}
I am pinging SERVERB, as defined host, a Linux server, from SERVERA
and executing the remote commands in SERVERB for checking the PC clients at Location B, or locally the commands which are in the nsclient.ini file on the Local PC clients located on the location B.
Is there anything missconfigured, or not understood at my side?
Yes, it does work. thanks for explanation and the example. I was a bit "worried" about the question in defining other commands in ServerB.
I am considering this post a nice learning experience for NRPE, and now it works, with the proper syntax and the understanding.
thanks for the help. if there is no more other remarks for this topic we may close this question and set-up as resolved.