NRPE Customize configure

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: NRPE Customize configure

Post by tgriep »

Lets use this plugin as an example.
https://exchange.nagios.org/directory/P ... 29/details
You would download the check_folder_size.sh script to the remote system and put it in the /usr/local/nagios/libexec folder.
Then set the owner and permissions of it so it can be executed. Run this as root on the remote server.

Code: Select all

chown nagios.nagios /usr/local/nagios/libexec/check_folder_size.sh
chmod 777 /usr/local/nagios/libexec/check_folder_size.sh
Then you would edit the nrpe.cfg file and create a command line the example below

Code: Select all

command[check_folder_size]=/usr/local/nagios/libexec/check_folder_size.sh -f $ARG1$
Save the file and restart the NRPE Agent

Then on the Nagios Server you would edit the Tmp folder command and change $ARG1$ to

Code: Select all

check_folder_size
and $ARG2$ to the following

Code: Select all

-a '/tmp -s g -w 15 -c 20'
That will check the /tmp folder and return the output in Gigabytes with a warning level of 1.5 Gigabytes and critical over 2.0 Gigabytes
You can adjust the thresholds, etc. using the options below.

-s k (Kilobytes) m (megabytes) g (gigabytes)
-w Warning level
-c Critical level

Any questions, let us know.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Kevin.c
Posts: 37
Joined: Wed Mar 22, 2017 2:49 am

Re: NRPE Customize configure

Post by Kevin.c »

hi

it was still not working , do we need to do something about the agent , it's HP-UX server we monitoring
for nagios server show us "NRPE: Command 'check_folder_size' not defined"
You do not have the required permissions to view the files attached to this post.
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: NRPE Customize configure

Post by tgriep »

Did you copy the check_folder_size.sh to the HP-UX server and put it in the /usr/local/nagios/libexec folder and set the permission of the file so the nagios user can read and execute that script?

If so, then you will have to create the command in the nrpe.cfg file on the HP-UX server the example below.

Code: Select all

command[check_folder_size]=/usr/local/nagios/libexec/check_folder_size.sh -f $ARG1$
Save the file and restart the NRPE agent on the HP-UX server and see if the check works for you.
The command in XI looks good so that should not have to be changed.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked