Hi,
i am trying to make nagios monitoor filesystems on sevaral remote linux-servers.
On the command line(from the nagios-server) this works fine.
nagios-server:
/usr/lib64/nagios/plugins/check_nrpe -H on7p0021 -t 30 -c check_disk -a '-w 20% -c 10% -R /'
On the remote linux-server:
nrpe.cfg:
command[check_disk]=/usr/lib64/nagios/plugins/check_disk $ARG1$
But is use a services.cfg file, that looks like this:
define service {
use generic-service
host_name on7p0021
check_interval 300
service_description Check Disk Space Root
check_command check_disk!check_root
check_interval 15
retry_interval 1
It doesn't seem to be working. Nothing in the gui, no error calls in the logs..
I also use a basic.cfg, that looks like this:
define command{
command_name check_disk
command_line /usr/lib64/nagios/plugins/check_nrpe -H '$HOSTADDRESS$' -c check_disk -t 300 -a '$ARG1$' '$ARG2$' '$ARG3$' '$ARG4$'
}
What am i doing wrong...?? Please Help.
Regards Paul
command that works on the command line,but how in a cfg.file
-
- Support Tech
- Posts: 3457
- Joined: Mon May 15, 2017 5:00 pm
Re: command that works on the command line,but how in a cfg.
Hello, @welbp00. This is what your command looks like compiled.
This is what I recommend using instead:
In your service check, you're calling the check_disk command and after ! you have "check_root", meaning that the first $ARG1$ is going to be check_root. ! signs are used to separate arguments./usr/lib64/nagios/plugins/check_nrpe -H hostaddress_here -c check_disk -t 300 -a 'check_root'
This is what I recommend using instead:
define command{
command_name check_nrpe
command_line /usr/lib64/nagios/plugins/check_nrpe -H $HOSTADDRESS$ -t 300 -c $ARG1$ $ARG2$
}
define service {
use generic-service
host_name on7p0021
check_interval 300
service_description Check Disk Space Root
check_command check_nrpe!check_disk! -a '-w 20% -c 10% -R /'
check_interval 15
retry_interval 1
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Re: command that works on the command line,but how in a cfg.
Hello npolovenko, many thnx for your reply.
But i still don't get it to work. I am sure i am doing something wrong....
After the adjustments made given by you, i still don't see anything appear in the nagios gui. The logging is showing no errors.
Here is some more info.
i have a:
010.linux.basic.cfg
define command{
command_name check_disk
command_line /usr/lib64/nagios/plugins/check_nrpe -H '$HOSTADDRESS$' -t 300 -c $ARG1$ $ARG2$
}
-------------------------------------
and a 020.linux.hostgroups.cfg
and a 030.linux.hosts.cfg
and a 040.linux.services.cfg
containing:
define service {
use generic-service
host_name {{ db2Servers.db2primary1.name }}
check_interval 300
service_description Check Disk Space Root
check_command check_nrpe!check_disk! -a '-w 20% -c 10% -R /'
check_interval 15
retry_interval 1
}
What command line must i put in the nrpe.cfg?
Hope you can help this newbee out...
Thnx, and regards.
Paul.
But i still don't get it to work. I am sure i am doing something wrong....
After the adjustments made given by you, i still don't see anything appear in the nagios gui. The logging is showing no errors.
Here is some more info.
i have a:
010.linux.basic.cfg
define command{
command_name check_disk
command_line /usr/lib64/nagios/plugins/check_nrpe -H '$HOSTADDRESS$' -t 300 -c $ARG1$ $ARG2$
}
-------------------------------------
and a 020.linux.hostgroups.cfg
and a 030.linux.hosts.cfg
and a 040.linux.services.cfg
containing:
define service {
use generic-service
host_name {{ db2Servers.db2primary1.name }}
check_interval 300
service_description Check Disk Space Root
check_command check_nrpe!check_disk! -a '-w 20% -c 10% -R /'
check_interval 15
retry_interval 1
}
What command line must i put in the nrpe.cfg?
Hope you can help this newbee out...
Thnx, and regards.
Paul.
-
- Support Tech
- Posts: 3457
- Joined: Mon May 15, 2017 5:00 pm
Re: command that works on the command line,but how in a cfg.
@welbp00, You shouldn't use single quotes around $HOSTADDRESS$ because that will force nagios to import the string literal instead of the actual host name. Please change this:
Also, this is not going to work:
https://assets.nagios.com/downloads/nag ... e/NRPE.pdf
To this:define command{
command_name check_disk
command_line /usr/lib64/nagios/plugins/check_nrpe -H '$HOSTADDRESS$' -t 300 -c $ARG1$ $ARG2$
}
define command{
command_name check_disk
command_line /usr/lib64/nagios/plugins/check_nrpe -H $HOSTADDRESS$ -t 300 -c $ARG1$ $ARG2$
}
Also, this is not going to work:
You need to create host definitions for each host. You can find examples of host definitions in this tutorial:host_name {{ db2Servers.db2primary1.name }}
https://assets.nagios.com/downloads/nag ... e/NRPE.pdf
Then you need to create service definitions. You can find examples right after host examples in the same article.Section: " Create host and service definitions"
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Re: command that works on the command line,but how in a cfg.
Thnx npolovenko.
I will read the pdf, and configure the files.
I will let you know the progress.
Regards,
Paul.
I will read the pdf, and configure the files.
I will let you know the progress.
Regards,
Paul.
-
- Support Tech
- Posts: 3457
- Joined: Mon May 15, 2017 5:00 pm
Re: command that works on the command line,but how in a cfg.
@welbp00, Sounds good, keep us updated.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Re: command that works on the command line,but how in a cfg.
Got it working. Something about using two hosts.cfg... A collegua helped me and we worked it out.
Lack of experience was the problem.
Learning every day
Thnx for the support, you may close this topic.
Lack of experience was the problem.
Learning every day
Thnx for the support, you may close this topic.
-
- Support Tech
- Posts: 3457
- Joined: Mon May 15, 2017 5:00 pm
Re: command that works on the command line,but how in a cfg.
@welbp00, Glad you figured it out! Feel free to open new threads when something else comes up.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.