On Apr 2, 2009, at 3:25 PM, Steve Shepherd wrote: > I'm trying to configure a service check via NRPE and having some > difficulty. > > From the monitoring server, I can successfully execute NRPE via CLI: > > [r...@mon01 etc]# /usr/local/nagios/libexec/check_nrpe -H > 10.140.122.51 -c check_prov > FILE_AGE OK: /var/log/prov.log is 4 seconds old and 8033817 bytes > > All my hosts are in /usr/local/nagios/etc/hosts, with service_checks > defined in them. I defined this NRPE check as: > > define service{
> [snip] > check_command check_nrpe!check_prov > } > # 'check_ccprov' command definition > define command{ > command_name check_prov > command_line $USER1$/check_nrpe -H $HOSTADDRESS -c > check_prov > } > > Nagios is giving me an error: > > Checking services... > Error: Service check command 'check_nrpe' specified in service > 'check_ccprov' for host 'servername.serverdomain' not defined > anywhere! > > But it is defined?! No, you defined the command 'check_prov', not 'check_nrpe'. Nagios is correctly telling you that there is no command{} definition with a command_name of check_nrpe. > From the documentation the check_command should be "check_nrpe! > $service" within service definition? You're mixing a few things seemingly without really understanding how they go together. A service{} definition with a check_command of 'check_nrpe!check_prov' will look for a command{} definition named 'check_nrpe' and expect to pass to it a $ARG1$ of 'check_prov' -- define command{ command_name check_nrpe command_line $USER1$/check_nrpe -H $HOSTADDRESS -c $ARG1$ } http://nagios.sourceforge.net/docs/3_0/objectdefinitions.html#command http://nagios.sourceforge.net/docs/3_0/macros.html - Example 2 Nagios will interpret the above command_line and execute '/path/to/ plugins/check_nrpe -H <address from host{} definition> -c check_prov. check_nrpe will contact the NRPE daemon running on <address from host{} definition> and ask it to run the command 'check_prov', which must be defined in the nrpe.cfg file on that remote host. The results are automatically returned to nagios by the check_nrpe daemon. HTH, -- Marc ------------------------------------------------------------------------------ _______________________________________________ Nagios-users mailing list Nagios-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/nagios-users ::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. ::: Messages without supporting info will risk being sent to /dev/null