I'm adding a service to existing host with currently working nrpe services. I can run the command locally on the host. When I try it remotely I get a couple different errors.
I tried running this manually from nagios server with multiple arguments including those on the KB article here https://support.nagios.com/kb/article/m ... s-774.html:
./check_nrpe -H x.x.x.x -t 30 -c custom_check_mem -a 'warn=free<20%' 'crit=free<10%'
Now I've tried this with multiple arguments and the "check_memory" command doesn't exist on the host nrpe client (but custom_check_mem does)
I get either "NRPE: Command 'custom_check_mem' not defined" or as with the exact command above "CHECK_NRPE: Receive header underflow - only 0 bytes received (4 expected)."
New to nagios - any help appreciated.
Error when setting up nrpe custom_check_mem
-
MechanicalPopsicle
- Posts: 2
- Joined: Wed Aug 14, 2019 9:35 am
-
scottwilkerson
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: Error when setting up nrpe custom_check_mem
Can you show the custom_check_mem configuration line in the nrpe.cfg file on the remote system?
this error makes it look like it doesn't exist
this error makes it look like it doesn't exist
Per the page you referencesMechanicalPopsicle wrote:I get either "NRPE: Command 'custom_check_mem' not defined"
Also, the command you are running is an example for checking memory on a Windows server with NSClient++Nagios Plugins does not include a memory plugin however the linux-nrpe-agent does provide custom_check_mem. The thresholds for the plugin are triggered if the free memory is less than the supplied value.
MechanicalPopsicle wrote: ./check_nrpe -H x.x.x.x -t 30 -c custom_check_mem -a 'warn=free<20%' 'crit=free<10%'
Re: Error when setting up nrpe custom_check_mem
Even though the plugin is installed on the remote server, there has to be a command defined in the nrpe.cfg file so it knows what to run when a command come in to the agent.
Typically, this is the command that is defined in the NRPE agents config file.
To test to see if the command is defined in the NRPE agents config files, try running the following example command from the Nagios server.
If it passes, then there is noting that has to be done on the remote agent.
Just create a service check in nagios.
FYI, the above example is different from yours as the one you were trying is for a Windows system running NSClient++.
If the test fails, you will have to add the command to the NRPE agents config file.
Typically the config file for NRPE is /usr/local/nagios/etc/nrpe.cfg and you can edit it and add the following command to it.
Save the change and restart NRPE and test it again from the Nagios server.
Typically, this is the command that is defined in the NRPE agents config file.
Code: Select all
command[check_mem]=/usr/local/nagios/libexec/custom_check_mem -n $ARG1$Code: Select all
./check_nrpe -H x.x.x.x -t 30 -c custom_check_mem -a '-w 20 -c 10'Just create a service check in nagios.
FYI, the above example is different from yours as the one you were trying is for a Windows system running NSClient++.
If the test fails, you will have to add the command to the NRPE agents config file.
Typically the config file for NRPE is /usr/local/nagios/etc/nrpe.cfg and you can edit it and add the following command to it.
Code: Select all
command[check_mem]=/usr/local/nagios/libexec/custom_check_mem -n $ARG1$Be sure to check out our Knowledgebase for helpful articles and solutions!
-
MechanicalPopsicle
- Posts: 2
- Joined: Wed Aug 14, 2019 9:35 am
Re: Error when setting up nrpe custom_check_mem
That was it! - I definied it on the remote server in the nrpe.cfg file and not it is working. I told you I'm new:) lesson learned - thanks
-
scottwilkerson
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: Error when setting up nrpe custom_check_mem
Great!MechanicalPopsicle wrote:That was it! - I definied it on the remote server in the nrpe.cfg file and not it is working. I told you I'm new:) lesson learned - thanks
Locking