Discussion:
[Nagios-users] NRPE: Command 'check_swap' not defined
y***@agilent.com
2007-05-02 08:25:38 UTC
Permalink
Hi,

I've run into following NRPE issue.

NRPE: Command 'check_load' not defined

I've checked my remote client nrpe.cfg and the command definition is properly configured there.

command[check_load]=/usr/local/nagios/libexec/check_load -w 15,10,5 -c 30,25,20
...

Does anybody know what reason else can cause such issue? Thanks in advance.

Regards,

Yu Ting
t***@bt.com
2007-05-02 08:35:44 UTC
Permalink
Is the check load command specified on the nagios monitoring box

Here is how my config is defined.

Remote nrpe box. /usr/local/etc/nrpe.cfg

command[check_load]=/usr/local/nagios/libexec/check_load -w 15,10,5 -c
30,25,20
[mailto:] On Behalf Of
1970-01-01 00:00:00 UTC
Permalink
# ' check load on remote systems using nrpe
define command{
command_name check_nrpe_load
command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -c $ARG1$
}

This works fine for me.

Regards

Tom



-----Original Message-----
From: nagios-users-***@lists.sourceforge.net
[mailto:nagios-users-***@lists.sourceforge.net] On Behalf Of
yu-***@agilent.com
Sent: 02 May 2007 09:26
To: nagios-***@lists.sourceforge.net
Subject: [Nagios-users] NRPE: Command 'check_swap' not defined

Hi,=20

I've run into following NRPE issue.=20

NRPE: Command 'check_load' not defined

I've checked my remote client nrpe.cfg and the command definition is
properly configured there.

command[check_load]=3D/usr/local/nagios/libexec/check_load -w
15,10,5 -c 30,25,20
...

Does anybody know what reason else can cause such issue? Thanks in
advance.

Regards,=20

Yu Ting=20


------------------------------------------------------------------------
-
This SF.net email is sponsored by DB2 Express Download DB2 Express C -
the FREE version of DB2 express and take control of your XML. No limits.
Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Nagios-users mailing list
Nagios-***@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when
reporting any issue.=20
::: Messages without supporting info will risk being sent to /dev/null
y***@agilent.com
2007-05-02 08:49:57 UTC
Permalink
Hi, all,

I just manually run command for testing purpose on my monitor server:

/usr/local/nagios/check_nrpe -H remote_host_name -c check_load

I've not configured it in Nagios configuration files yet.

Regards,

Yu Ting

-----Original Message-----
From: ***@bt.com [mailto:***@bt.com]
Sent: Wednesday, May 02, 2007 4:36 PM
To: yu-***@agilent.com; nagios-***@lists.sourceforge.net
Subject: RE: [Nagios-users] NRPE: Command 'check_swap' not defined

Is the check load command specified on the nagios monitoring box

Here is how my config is defined.

Remote nrpe box. /usr/local/etc/nrpe.cfg

command[check_load]=/usr/local/nagios/libexec/check_load -w 15,10,5 -c 30,25,20
[mailto:] On Behalf Of =
1970-01-01 00:00:00 UTC
Permalink
# ' check load on remote systems using nrpe define command{
command_name check_nrpe_load
command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -c $ARG1$
}

This works fine for me.

Regards

Tom



-----Original Message-----
From: nagios-users-***@lists.sourceforge.net
[mailto:nagios-users-***@lists.sourceforge.net] On Behalf Of =
yu-***@agilent.com
Sent: 02 May 2007 09:26
To: nagios-***@lists.sourceforge.net
Subject: [Nagios-users] NRPE: Command 'check_swap' not defined

Hi,=20

I've run into following NRPE issue.=20

NRPE: Command 'check_load' not defined

I've checked my remote client nrpe.cfg and the command definition is =
properly configured there.

command[check_load]=3D/usr/local/nagios/libexec/check_load -w
15,10,5 -c 30,25,20
...

Does anybody know what reason else can cause such issue? Thanks in =
advance.

Regards,=20

Yu Ting=20


------------------------------------------------------------------------
-
This SF.net email is sponsored by DB2 Express Download DB2 Express C - =
the FREE version of DB2 express and take control of your XML. No limits.
Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Nagios-users mailing list
Nagios-***@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when =
reporting any issue.=20
::: Messages without supporting info will risk being sent to /dev/null
t***@bt.com
2007-05-02 09:01:17 UTC
Permalink
Hi

When you run the command manually does it work?

Here is what I get when I run my command

***@usel:/usr/local/nagios/libexec> ./check_nrpe -H test_server_1 -c
check_load
OK - load average: 1.09, 1.04, 1.01|load1=1.090;15.000;30.000;0;
load5=1.040;10.000;25.000;0; load15=1.010;5.000;20.000;0;

Can you run the command and post the output if you are still getting
problems?

Have you turned on debugging on the nrpe.cfg file and looked at the
output when you have ran the command. This is very helpful diagnostic
tool.

Here is the output from /var/log/messages with debug turned on in
nrpe.cfg

May 2 09:59:34 h12oiap nrpe[4469]: Host is asking for command
'check_load' to be run...
May 2 09:59:34 h12oiap nrpe[4469]: Running command:
/usr/local/nagios/libexec/check_load -w 15,10,5 -c 30,25,20
May 2 09:59:34 h12oiap nrpe[4469]: Command completed with return code 0
and output: OK - load average: 0.17, 0.15,
0.10|load1=0.170;15.000;30.000;0; load5=0.150;10.000;25.000;0;
load15=0.100;5.000;20.000;0;
May 2 09:59:34 h12oiap nrpe[4469]: Return Code: 0, Output: OK - load
average: 0.17, 0.15, 0.10|load1=0.170;15.000;30.000;0;
load5=0.150;10.000;25.000;0; load15=0.100;5.000;20.000;0;

What do you get when you run yours?

Regards

Tom

-----Original Message-----
From: yu-***@agilent.com [mailto:yu-***@agilent.com]
Sent: 02 May 2007 09:50
To: Welsh,T,Tom,XSL4A C
Cc: nagios-***@lists.sourceforge.net
Subject: RE: [Nagios-users] NRPE: Command 'check_swap' not defined

Hi, all,

I just manually run command for testing purpose on my monitor server:

/usr/local/nagios/check_nrpe -H remote_host_name -c check_load

I've not configured it in Nagios configuration files yet.

Regards,

Yu Ting

-----Original Message-----
From: ***@bt.com [mailto:***@bt.com]
Sent: Wednesday, May 02, 2007 4:36 PM
To: yu-***@agilent.com; nagios-***@lists.sourceforge.net
Subject: RE: [Nagios-users] NRPE: Command 'check_swap' not defined

Is the check load command specified on the nagios monitoring box

Here is how my config is defined.

Remote nrpe box. /usr/local/etc/nrpe.cfg

command[check_load]=/usr/local/nagios/libexec/check_load -w 15,10,5 -c
30,25,20
[mailto:] On Behalf Of
1970-01-01 00:00:00 UTC
Permalink
# ' check load on remote systems using nrpe define command{
command_name check_nrpe_load
command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -c $ARG1$
}

This works fine for me.

Regards

Tom



-----Original Message-----
From: nagios-users-***@lists.sourceforge.net
[mailto:nagios-users-***@lists.sourceforge.net] On Behalf Of
yu-***@agilent.com
Sent: 02 May 2007 09:26
To: nagios-***@lists.sourceforge.net
Subject: [Nagios-users] NRPE: Command 'check_swap' not defined

Hi,=20

I've run into following NRPE issue.=20

NRPE: Command 'check_load' not defined

I've checked my remote client nrpe.cfg and the command definition is
properly configured there.

command[check_load]=3D/usr/local/nagios/libexec/check_load -w
15,10,5 -c 30,25,20
...

Does anybody know what reason else can cause such issue? Thanks in
advance.

Regards,=20

Yu Ting=20


------------------------------------------------------------------------
-
This SF.net email is sponsored by DB2 Express Download DB2 Express C -
the FREE version of DB2 express and take control of your XML. No limits.
Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Nagios-users mailing list
Nagios-***@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when
reporting any issue.=20
::: Messages without supporting info will risk being sent to /dev/null
y***@agilent.com
2007-05-02 09:23:37 UTC
Permalink
Hi,

No, I even can't run check_nrpe command successfully in command line. Below is the running command and output:

-sh-3.00$ ./check_nrpe -H remote_client_name -c check_load
NRPE: Command 'check_load' not defined

I've turned on the debug in my remote client nrpe.cfg file but no message outputs to my system log file at all - /var/adm/syslog/syslog.log. That's also puzzle me. I'm using nrpe.cfg sample file to config and nrpe daemon is running as below on the client.

nagios 14891 1 0 16:18:47 ? 0:00 /usr/local/nagios/bin/nrpe -c /usr/local/nagios/etc/nrpe.cfg -d

Regards,

Yu Ting

-----Original Message-----
From: ***@bt.com [mailto:***@bt.com]
Sent: Wednesday, May 02, 2007 5:01 PM
To: yu-***@agilent.com
Cc: nagios-***@lists.sourceforge.net
Subject: RE: [Nagios-users] NRPE: Command 'check_swap' not defined

Hi

When you run the command manually does it work?

Here is what I get when I run my command

***@usel:/usr/local/nagios/libexec> ./check_nrpe -H test_server_1 -c check_load OK - load average: 1.09, 1.04, 1.01|load1=1.090;15.000;30.000;0; load5=1.040;10.000;25.000;0; load15=1.010;5.000;20.000;0;

Can you run the command and post the output if you are still getting problems?

Have you turned on debugging on the nrpe.cfg file and looked at the output when you have ran the command. This is very helpful diagnostic tool.

Here is the output from /var/log/messages with debug turned on in nrpe.cfg

May 2 09:59:34 h12oiap nrpe[4469]: Host is asking for command 'check_load' to be run...
May 2 09:59:34 h12oiap nrpe[4469]: Running command:
/usr/local/nagios/libexec/check_load -w 15,10,5 -c 30,25,20 May 2 09:59:34 h12oiap nrpe[4469]: Command completed with return code 0 and output: OK - load average: 0.17, 0.15, 0.10|load1=0.170;15.000;30.000;0; load5=0.150;10.000;25.000;0; load15=0.100;5.000;20.000;0; May 2 09:59:34 h12oiap nrpe[4469]: Return Code: 0, Output: OK - load
average: 0.17, 0.15, 0.10|load1=0.170;15.000;30.000;0; load5=0.150;10.000;25.000;0; load15=0.100;5.000;20.000;0;

What do you get when you run yours?

Regards

Tom

-----Original Message-----
From: yu-***@agilent.com [mailto:yu-***@agilent.com]
Sent: 02 May 2007 09:50
To: Welsh,T,Tom,XSL4A C
Cc: nagios-***@lists.sourceforge.net
Subject: RE: [Nagios-users] NRPE: Command 'check_swap' not defined

Hi, all,

I just manually run command for testing purpose on my monitor server:

/usr/local/nagios/check_nrpe -H remote_host_name -c check_load

I've not configured it in Nagios configuration files yet.

Regards,

Yu Ting

-----Original Message-----
From: ***@bt.com [mailto:***@bt.com]
Sent: Wednesday, May 02, 2007 4:36 PM
To: yu-***@agilent.com; nagios-***@lists.sourceforge.net
Subject: RE: [Nagios-users] NRPE: Command 'check_swap' not defined

Is the check load command specified on the nagios monitoring box

Here is how my config is defined.

Remote nrpe box. /usr/local/etc/nrpe.cfg

command[check_load]=/usr/local/nagios/libexec/check_load -w 15,10,5 -c 30,25,20
Thomas Guyot-Sionnest
2007-05-02 09:38:49 UTC
Permalink
Are you sure you're hitting the right client? What happens if you shut
down the remote nrpe client and try running check_nrpe again?

Thomas
Post by y***@agilent.com
Hi,
-sh-3.00$ ./check_nrpe -H remote_client_name -c check_load
NRPE: Command 'check_load' not defined
I've turned on the debug in my remote client nrpe.cfg file but no message outputs to my system log file at all - /var/adm/syslog/syslog.log. That's also puzzle me. I'm using nrpe.cfg sample file to config and nrpe daemon is running as below on the client.
nagios 14891 1 0 16:18:47 ? 0:00 /usr/local/nagios/bin/nrpe -c /usr/local/nagios/etc/nrpe.cfg -d
Regards,
Yu Ting
-----Original Message-----
Sent: Wednesday, May 02, 2007 5:01 PM
Subject: RE: [Nagios-users] NRPE: Command 'check_swap' not defined
Hi
When you run the command manually does it work?
Here is what I get when I run my command
Can you run the command and post the output if you are still getting problems?
Have you turned on debugging on the nrpe.cfg file and looked at the output when you have ran the command. This is very helpful diagnostic tool.
Here is the output from /var/log/messages with debug turned on in nrpe.cfg
May 2 09:59:34 h12oiap nrpe[4469]: Host is asking for command 'check_load' to be run...
/usr/local/nagios/libexec/check_load -w 15,10,5 -c 30,25,20 May 2 09:59:34 h12oiap nrpe[4469]: Command completed with return code 0 and output: OK - load average: 0.17, 0.15, 0.10|load1=0.170;15.000;30.000;0; load5=0.150;10.000;25.000;0; load15=0.100;5.000;20.000;0; May 2 09:59:34 h12oiap nrpe[4469]: Return Code: 0, Output: OK - load
average: 0.17, 0.15, 0.10|load1=0.170;15.000;30.000;0; load5=0.150;10.000;25.000;0; load15=0.100;5.000;20.000;0;
What do you get when you run yours?
Regards
Tom
-----Original Message-----
Sent: 02 May 2007 09:50
To: Welsh,T,Tom,XSL4A C
Subject: RE: [Nagios-users] NRPE: Command 'check_swap' not defined
Hi, all,
/usr/local/nagios/check_nrpe -H remote_host_name -c check_load
I've not configured it in Nagios configuration files yet.
Regards,
Yu Ting
-----Original Message-----
Sent: Wednesday, May 02, 2007 4:36 PM
Subject: RE: [Nagios-users] NRPE: Command 'check_swap' not defined
Is the check load command specified on the nagios monitoring box
Here is how my config is defined.
Remote nrpe box. /usr/local/etc/nrpe.cfg
command[check_load]=/usr/local/nagios/libexec/check_load -w 15,10,5 -c 30,25,20
[mailto:] On Behalf Of =
1970-01-01 00:00:00 UTC
Permalink
# ' check load on remote systems using nrpe define command{
command_name check_nrpe_load
command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -c $ARG1$
}

This works fine for me.

Regards

Tom



-----Original Message-----
From: nagios-users-***@lists.sourceforge.net
[mailto:nagios-users-***@lists.sourceforge.net] On Behalf Of =
yu-***@agilent.com
Sent: 02 May 2007 09:26
To: nagios-***@lists.sourceforge.net
Subject: [Nagios-users] NRPE: Command 'check_swap' not defined

Hi,=20

I've run into following NRPE issue.=20

NRPE: Command 'check_load' not defined

I've checked my remote client nrpe.cfg and the command definition is =
properly configured there.

command[check_load]=3D/usr/local/nagios/libexec/check_load -w
15,10,5 -c 30,25,20
...

Does anybody know what reason else can cause such issue? Thanks in =
advance.

Regards,=20

Yu Ting=20


------------------------------------------------------------------------
-
This SF.net email is sponsored by DB2 Express Download DB2 Express C - =
the FREE version of DB2 express and take control of your XML. No limits.
Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Nagios-users mailing list
Nagios-***@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when =
reporting any issue.=20
::: Messages without supporting info will risk being sent to /dev/null
t***@bt.com
2007-05-02 09:47:34 UTC
Permalink
Ok Lets take it from the top.

1. About the software you have installed

1a. What OS are you using

1b. What version of Nagios and nagios Plugins are you using?

1c. What version of nrpe are you using?

1d. Is Nagios and the Plugins configured?

1e. If you run nagios -v ./nagios.cfg does it pass the pre-flight check?

1f. What user are you running the check_nrpe command as?

2. On remote nrpe box

2a. Is nrpe defined in /etc/services?

nrpe 5666/tcp Nagios Remote Plugin Executor

2b. Is nrpe defined in inetd/xinetd?

2c. Is nrpe listening to the port

Test_Server_1:~ # netstat -a |grep nrpe
tcp 0 0 *:nrpe *:*
LISTEN

2d. Can you telnet from the nagios host to the remote nrpe port?

***@usel:~> telnet Test_Server_1 5666
Trying 132.146.185.160...
Connected to h12oiap.btvsu.net.
Escape character is '^]'

2e. Check the definition of check_swap in your nrpe.cfg file

command[check_swap]=/usr/local/nagios/libexec/check_swap -w 30% -c
20%

If all off section 2 is working and you can telnet to the port then nrpe
is configured to listen correctly


3. Checking nagios install on local nagios monitoring host.

3a. Is nagios running?

3b. Does the nagios pre-flight check pass ok

/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg

---------<SNIP>--------
Total Warnings: 0
Total Errors: 0

Things look okay - No serious problems were detected during the
pre-flight check
---------<SNIP>--------

3c. Lets look at your /usr/local/nagios/etc/checkcommand.cfg file
Have you specified a check_load or as I like to define different
local and remote
commands check_nrpe_swap in the file above. If you haven't you will
get an error
like you are seeing.

# ' check swap space usage on remote systems
define command{
command_name check_nrpe_swap
command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -c $ARG1$
}


I have run through the above and when I run the check_nrpe command on
the command line I get the following

***@usel:/usr/local/nagios/libexec> ./check_nrpe -H Test_Server_1 -c
check_swap
SWAP OK - 100% free (5137 MB out of 5137 MB)
|swap=5137MB;1541;1027;0;5137

And like an epiphany, I just read your post title, it looks like you
need to define the check swap in your checkcommands.cfg file first.

Hope this helps.

Tom

-----Original Message-----
From: yu-***@agilent.com [mailto:yu-***@agilent.com]
Sent: 02 May 2007 10:24
To: Welsh,T,Tom,XSL4A C
Cc: nagios-***@lists.sourceforge.net
Subject: RE: [Nagios-users] NRPE: Command 'check_swap' not defined

Hi,

No, I even can't run check_nrpe command successfully in command line.
Below is the running command and output:

-sh-3.00$ ./check_nrpe -H remote_client_name -c check_load
NRPE: Command 'check_load' not defined

I've turned on the debug in my remote client nrpe.cfg file but no
message outputs to my system log file at all -
/var/adm/syslog/syslog.log. That's also puzzle me. I'm using nrpe.cfg
sample file to config and nrpe daemon is running as below on the client.

nagios 14891 1 0 16:18:47 ? 0:00
/usr/local/nagios/bin/nrpe -c /usr/local/nagios/etc/nrpe.cfg -d

Regards,

Yu Ting

-----Original Message-----
From: ***@bt.com [mailto:***@bt.com]
Sent: Wednesday, May 02, 2007 5:01 PM
To: yu-***@agilent.com
Cc: nagios-***@lists.sourceforge.net
Subject: RE: [Nagios-users] NRPE: Command 'check_swap' not defined

Hi

When you run the command manually does it work?

Here is what I get when I run my command

***@usel:/usr/local/nagios/libexec> ./check_nrpe -H test_server_1 -c
check_load OK - load average: 1.09, 1.04,
1.01|load1=1.090;15.000;30.000;0; load5=1.040;10.000;25.000;0;
load15=1.010;5.000;20.000;0;

Can you run the command and post the output if you are still getting
problems?

Have you turned on debugging on the nrpe.cfg file and looked at the
output when you have ran the command. This is very helpful diagnostic
tool.

Here is the output from /var/log/messages with debug turned on in
nrpe.cfg

May 2 09:59:34 h12oiap nrpe[4469]: Host is asking for command
'check_load' to be run...
May 2 09:59:34 h12oiap nrpe[4469]: Running command:
/usr/local/nagios/libexec/check_load -w 15,10,5 -c 30,25,20 May 2
09:59:34 h12oiap nrpe[4469]: Command completed with return code 0 and
output: OK - load average: 0.17, 0.15, 0.10|load1=0.170;15.000;30.000;0;
load5=0.150;10.000;25.000;0; load15=0.100;5.000;20.000;0; May 2
09:59:34 h12oiap nrpe[4469]: Return Code: 0, Output: OK - load
average: 0.17, 0.15, 0.10|load1=0.170;15.000;30.000;0;
load5=0.150;10.000;25.000;0; load15=0.100;5.000;20.000;0;

What do you get when you run yours?

Regards

Tom

-----Original Message-----
From: yu-***@agilent.com [mailto:yu-***@agilent.com]
Sent: 02 May 2007 09:50
To: Welsh,T,Tom,XSL4A C
Cc: nagios-***@lists.sourceforge.net
Subject: RE: [Nagios-users] NRPE: Command 'check_swap' not defined

Hi, all,

I just manually run command for testing purpose on my monitor server:

/usr/local/nagios/check_nrpe -H remote_host_name -c check_load

I've not configured it in Nagios configuration files yet.

Regards,

Yu Ting

-----Original Message-----
From: ***@bt.com [mailto:***@bt.com]
Sent: Wednesday, May 02, 2007 4:36 PM
To: yu-***@agilent.com; nagios-***@lists.sourceforge.net
Subject: RE: [Nagios-users] NRPE: Command 'check_swap' not defined

Is the check load command specified on the nagios monitoring box

Here is how my config is defined.

Remote nrpe box. /usr/local/etc/nrpe.cfg

command[check_load]=/usr/local/nagios/libexec/check_load -w 15,10,5 -c
30,25,20
Jonathan Murray
2007-05-30 22:48:31 UTC
Permalink
I've been staring at this for a long time, likely pilot error, but maybe
someone has suggestions or sees something I don't...thanks.

Nagios server version 2.8, (OS debian)
Nagios plugin version 1.4.7 (Red Hat Enterprise Linux WS release 4)
NRPE version 2.7.1

other plugins work (check_swap, check_load)

On nagios server:

/usr/local/nagios/etc/checkcommands.cfg

<-snip->

# check_disk
define command{
command_name check_disk
command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -c check_disk
}

<-snip->

On the machine I'm trying to monitor, the one running nrpe 2.7.1 with
the Nagios plugin version 1.4.7 (Red Hat Enterprise Linux WS release 4),
in /usr/local/nagios/libexec/etc/nrpe.cfg:

[***@paleo etc]# ls -la
total 28
drwxr-xr-x 2 nagios nagios 4096 May 30 17:03 .
drwxr-xr-x 6 nagios nagios 4096 May 30 17:13 ..
-rwxr-xr-x 1 nagios nagios 7536 May 30 17:03 nrpe.cfg

<-snip->

command[check_disk]=/usr/local/nagios/libexec/check_disk -w 20 -c 10 -p
/dev/sda5

<-snip->

when I test it from the server "nagios" it works fine:

***@nagios:/usr/local/nagios/libexec# ./check_nrpe -H paleo -c check_disk
DISK OK - free space: / 201921 MB (93% inode=99%);|
/=14918MB;228424;228434;0;22 8444

on the system running nrpe "paleo":

[***@paleo etc]# /usr/local/nagios/libexec/check_disk -w 20 -c 10 -p
/dev/sda5
DISK OK - free space: / 201921 MB (93% inode=99%);|
/=14918MB;228424;228434;0;228444

If NRPE, Command 'check_disk' not defined as the web interface reports,
then where should it be defined? I thought I needed to define the
command in the checkcommands.cfg on the server, then define the command
on the client that is running nrpe daemon.

thanks for any ideas,

Jonathan Murray
[mailto:] On Behalf Of
1970-01-01 00:00:00 UTC
Permalink
# ' check load on remote systems using nrpe define command{
command_name check_nrpe_load
command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -c $ARG1$
}

This works fine for me.

Regards

Tom



-----Original Message-----
From: nagios-users-***@lists.sourceforge.net
[mailto:nagios-users-***@lists.sourceforge.net] On Behalf Of
yu-***@agilent.com
Sent: 02 May 2007 09:26
To: nagios-***@lists.sourceforge.net
Subject: [Nagios-users] NRPE: Command 'check_swap' not defined

Hi,=20

I've run into following NRPE issue.=20

NRPE: Command 'check_load' not defined

I've checked my remote client nrpe.cfg and the command definition is
properly configured there.

command[check_load]=3D/usr/local/nagios/libexec/check_load -w
15,10,5 -c 30,25,20
...

Does anybody know what reason else can cause such issue? Thanks in
advance.

Regards,=20

Yu Ting=20


------------------------------------------------------------------------
-
This SF.net email is sponsored by DB2 Express Download DB2 Express C -
the FREE version of DB2 express and take control of your XML. No limits.
Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Nagios-users mailing list
Nagios-***@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when
reporting any issue.=20
::: Messages without supporting info will risk being sent to /dev/null
y***@agilent.com
2007-05-03 02:24:10 UTC
Permalink
Hi, Thomas,

Yes, the client hostname is definitely correct. If I shutdown nrpe daemon on client, the output of check_nrpe on monitor host is:

# /usr/local/nagios/libexec/check_nrpe -H dadsrv -c check_load
Connection refused by host

And my defined check_load command can run successfully on my client as below:

$ /usr/local/nagios/libexec/check_load -w 15,10,5 -c 30,25,20
load average: 0.00, 0.00, 0.00

Thanks & Regards,

Yu Ting

-----Original Message-----
From: Thomas Guyot-Sionnest [mailto:***@aei.ca]
Sent: Wednesday, May 02, 2007 5:39 PM
To: yu-***@agilent.com
Cc: nagios-***@lists.sourceforge.net
Subject: Re: [Nagios-users] NRPE: Command 'check_swap' not defined

Are you sure you're hitting the right client? What happens if you shut down the remote nrpe client and try running check_nrpe again?

Thomas
Post by y***@agilent.com
Hi,
-sh-3.00$ ./check_nrpe -H remote_client_name -c check_load
NRPE: Command 'check_load' not defined
I've turned on the debug in my remote client nrpe.cfg file but no message outputs to my system log file at all - /var/adm/syslog/syslog.log. That's also puzzle me. I'm using nrpe.cfg sample file to config and nrpe daemon is running as below on the client.
nagios 14891 1 0 16:18:47 ? 0:00 /usr/local/nagios/bin/nrpe -c /usr/local/nagios/etc/nrpe.cfg -d
Regards,
Yu Ting
-----Original Message-----
Sent: Wednesday, May 02, 2007 5:01 PM
Subject: RE: [Nagios-users] NRPE: Command 'check_swap' not defined
Hi
When you run the command manually does it work?
Here is what I get when I run my command
-c check_load OK - load average: 1.09, 1.04,
1.01|load1=1.090;15.000;30.000;0; load5=1.040;10.000;25.000;0;
load15=1.010;5.000;20.000;0;
Can you run the command and post the output if you are still getting problems?
Have you turned on debugging on the nrpe.cfg file and looked at the output when you have ran the command. This is very helpful diagnostic tool.
Here is the output from /var/log/messages with debug turned on in
nrpe.cfg
May 2 09:59:34 h12oiap nrpe[4469]: Host is asking for command 'check_load' to be run...
/usr/local/nagios/libexec/check_load -w 15,10,5 -c 30,25,20 May 2
09:59:34 h12oiap nrpe[4469]: Command completed with return code 0 and
output: OK - load average: 0.17, 0.15,
0.10|load1=0.170;15.000;30.000;0; load5=0.150;10.000;25.000;0;
Return Code: 0, Output: OK - load
average: 0.17, 0.15, 0.10|load1=0.170;15.000;30.000;0;
load5=0.150;10.000;25.000;0; load15=0.100;5.000;20.000;0;
What do you get when you run yours?
Regards
Tom
-----Original Message-----
Sent: 02 May 2007 09:50
To: Welsh,T,Tom,XSL4A C
Subject: RE: [Nagios-users] NRPE: Command 'check_swap' not defined
Hi, all,
/usr/local/nagios/check_nrpe -H remote_host_name -c check_load
I've not configured it in Nagios configuration files yet.
Regards,
Yu Ting
-----Original Message-----
Sent: Wednesday, May 02, 2007 4:36 PM
Subject: RE: [Nagios-users] NRPE: Command 'check_swap' not defined
Is the check load command specified on the nagios monitoring box
Here is how my config is defined.
Remote nrpe box. /usr/local/etc/nrpe.cfg
command[check_load]=/usr/local/nagios/libexec/check_load -w 15,10,5 -c
30,25,20
n***@wipro.com
2007-05-03 04:36:07 UTC
Permalink
Have you restarted the nrpe deamon on the client system after adding the new commands?
Regards,
Naren

________________________________

From: nagios-users-***@lists.sourceforge.net on behalf of yu-***@agilent.com
Sent: Thu 5/3/2007 7:54 AM
To: ***@aei.ca
Cc: nagios-***@lists.sourceforge.net
Subject: Re: [Nagios-users] NRPE: Command 'check_swap' not defined



Hi, Thomas,

Yes, the client hostname is definitely correct. If I shutdown nrpe daemon on client, the output of check_nrpe on monitor host is:

# /usr/local/nagios/libexec/check_nrpe -H dadsrv -c check_load
Connection refused by host

And my defined check_load command can run successfully on my client as below:

$ /usr/local/nagios/libexec/check_load -w 15,10,5 -c 30,25,20
load average: 0.00, 0.00, 0.00

Thanks & Regards,

Yu Ting

-----Original Message-----
From: Thomas Guyot-Sionnest [mailto:***@aei.ca]
Sent: Wednesday, May 02, 2007 5:39 PM
To: yu-***@agilent.com
Cc: nagios-***@lists.sourceforge.net
Subject: Re: [Nagios-users] NRPE: Command 'check_swap' not defined

Are you sure you're hitting the right client? What happens if you shut down the remote nrpe client and try running check_nrpe again?

Thomas
Post by y***@agilent.com
Hi,
-sh-3.00$ ./check_nrpe -H remote_client_name -c check_load
NRPE: Command 'check_load' not defined
I've turned on the debug in my remote client nrpe.cfg file but no message outputs to my system log file at all - /var/adm/syslog/syslog.log. That's also puzzle me. I'm using nrpe.cfg sample file to config and nrpe daemon is running as below on the client.
nagios 14891 1 0 16:18:47 ? 0:00 /usr/local/nagios/bin/nrpe -c /usr/local/nagios/etc/nrpe.cfg -d
Regards,
Yu Ting
-----Original Message-----
Sent: Wednesday, May 02, 2007 5:01 PM
Subject: RE: [Nagios-users] NRPE: Command 'check_swap' not defined
Hi
When you run the command manually does it work?
Here is what I get when I run my command
-c check_load OK - load average: 1.09, 1.04,
1.01|load1=1.090;15.000;30.000;0; load5=1.040;10.000;25.000;0;
load15=1.010;5.000;20.000;0;
Can you run the command and post the output if you are still getting problems?
Have you turned on debugging on the nrpe.cfg file and looked at the output when you have ran the command. This is very helpful diagnostic tool.
Here is the output from /var/log/messages with debug turned on in
nrpe.cfg
May 2 09:59:34 h12oiap nrpe[4469]: Host is asking for command 'check_load' to be run...
/usr/local/nagios/libexec/check_load -w 15,10,5 -c 30,25,20 May 2
09:59:34 h12oiap nrpe[4469]: Command completed with return code 0 and
output: OK - load average: 0.17, 0.15,
0.10|load1=0.170;15.000;30.000;0; load5=0.150;10.000;25.000;0;
Return Code: 0, Output: OK - load
average: 0.17, 0.15, 0.10|load1=0.170;15.000;30.000;0;
load5=0.150;10.000;25.000;0; load15=0.100;5.000;20.000;0;
What do you get when you run yours?
Regards
Tom
-----Original Message-----
Sent: 02 May 2007 09:50
To: Welsh,T,Tom,XSL4A C
Subject: RE: [Nagios-users] NRPE: Command 'check_swap' not defined
Hi, all,
/usr/local/nagios/check_nrpe -H remote_host_name -c check_load
I've not configured it in Nagios configuration files yet.
Regards,
Yu Ting
-----Original Message-----
Sent: Wednesday, May 02, 2007 4:36 PM
Subject: RE: [Nagios-users] NRPE: Command 'check_swap' not defined
Is the check load command specified on the nagios monitoring box
Here is how my config is defined.
Remote nrpe box. /usr/local/etc/nrpe.cfg
command[check_load]=/usr/local/nagios/libexec/check_load -w 15,10,5 -c
30,25,20
y***@agilent.com
2007-05-05 15:53:21 UTC
Permalink
Hi, Tom,

Thank you for your detailed configuration steps.

My configuration has no problem. I've verified that the "command not defined" issue is caused by the incompatibility between the NRPE and Plugins running on my remote client.

The version of NRPE is 2.8b1, which I downloaded from Nagios website and compiled. When I ran "check_nrpe -H remote_client" on monitor host, it returns the result of NRPE version of remote client. So the check_nrpe on monitor host can talk to NRPE daemon on remote client properly.

But the plugins is the version 1.4, is the pre-compiled one which I directly downloaded from internet, as I had problem on compiling nagios-plugins-1.4.8 on my HP-UX box. While I compiled the package nagios-plugins-1.4.8, it's passed the configure step, but failed at make with following error messages:

........
gcc -g -O2 -o check_swap check_swap.o utils.o popen.o -L/tmp/nagios-plugins-1.4.8/plugins -L/opt/openssl/lib -lm ../lib/libnagiosplug.a ../gl/libgnu.a /usr/loc
al/lib/libintl.sl -L/usr/local/lib /usr/local/lib/libiconv.sl -lc -Wl,+b -Wl,/usr/local/lib
/usr/ccs/bin/ld: Unsatisfied symbols:
floorf (code)
collect2: ld returned 1 exit status
gmake[2]: *** [check_swap] Error 1
gmake[2]: Leaving directory `/tmp/nagios-plugins-1.4.8/plugins'
gmake[1]: *** [all-recursive] Error 1
gmake[1]: Leaving directory `/tmp/nagios-plugins-1.4.8'
gmake: *** [all] Error 2
...........

I even have problem to compile nrpe-2.8b1 on some other HP-UX boxes as well. Does anybody have any experience on using Nagios on HP-UX platform and have any idea on it? Thanks in advance.

Regards,

Yu Ting


-----Original Message-----
From: ***@bt.com [mailto:***@bt.com]
Sent: Wednesday, May 02, 2007 5:48 PM
To: yu-***@agilent.com
Cc: nagios-***@lists.sourceforge.net
Subject: RE: [Nagios-users] NRPE: Command 'check_swap' not defined

Ok Lets take it from the top.

1. About the software you have installed

1a. What OS are you using

1b. What version of Nagios and nagios Plugins are you using?

1c. What version of nrpe are you using?

1d. Is Nagios and the Plugins configured?

1e. If you run nagios -v ./nagios.cfg does it pass the pre-flight check?

1f. What user are you running the check_nrpe command as?

2. On remote nrpe box

2a. Is nrpe defined in /etc/services?

nrpe 5666/tcp Nagios Remote Plugin Executor

2b. Is nrpe defined in inetd/xinetd?

2c. Is nrpe listening to the port

Test_Server_1:~ # netstat -a |grep nrpe
tcp 0 0 *:nrpe *:*
LISTEN

2d. Can you telnet from the nagios host to the remote nrpe port?

***@usel:~> telnet Test_Server_1 5666
Trying 132.146.185.160...
Connected to h12oiap.btvsu.net.
Escape character is '^]'

2e. Check the definition of check_swap in your nrpe.cfg file

command[check_swap]=/usr/local/nagios/libexec/check_swap -w 30% -c 20%

If all off section 2 is working and you can telnet to the port then nrpe is configured to listen correctly


3. Checking nagios install on local nagios monitoring host.

3a. Is nagios running?

3b. Does the nagios pre-flight check pass ok

/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg

---------<SNIP>--------
Total Warnings: 0
Total Errors: 0

Things look okay - No serious problems were detected during the pre-flight check
---------<SNIP>--------

3c. Lets look at your /usr/local/nagios/etc/checkcommand.cfg file
Have you specified a check_load or as I like to define different local and remote
commands check_nrpe_swap in the file above. If you haven't you will get an error
like you are seeing.

# ' check swap space usage on remote systems
define command{
command_name check_nrpe_swap
command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -c $ARG1$
}


I have run through the above and when I run the check_nrpe command on the command line I get the following

***@usel:/usr/local/nagios/libexec> ./check_nrpe -H Test_Server_1 -c check_swap SWAP OK - 100% free (5137 MB out of 5137 MB)
|swap=5137MB;1541;1027;0;5137

And like an epiphany, I just read your post title, it looks like you need to define the check swap in your checkcommands.cfg file first.

Hope this helps.

Tom

-----Original Message-----
From: yu-***@agilent.com [mailto:yu-***@agilent.com]
Sent: 02 May 2007 10:24
To: Welsh,T,Tom,XSL4A C
Cc: nagios-***@lists.sourceforge.net
Subject: RE: [Nagios-users] NRPE: Command 'check_swap' not defined

Hi,

No, I even can't run check_nrpe command successfully in command line.
Below is the running command and output:

-sh-3.00$ ./check_nrpe -H remote_client_name -c check_load
NRPE: Command 'check_load' not defined

I've turned on the debug in my remote client nrpe.cfg file but no message outputs to my system log file at all - /var/adm/syslog/syslog.log. That's also puzzle me. I'm using nrpe.cfg sample file to config and nrpe daemon is running as below on the client.

nagios 14891 1 0 16:18:47 ? 0:00
/usr/local/nagios/bin/nrpe -c /usr/local/nagios/etc/nrpe.cfg -d

Regards,

Yu Ting

-----Original Message-----
From: ***@bt.com [mailto:***@bt.com]
Sent: Wednesday, May 02, 2007 5:01 PM
To: yu-***@agilent.com
Cc: nagios-***@lists.sourceforge.net
Subject: RE: [Nagios-users] NRPE: Command 'check_swap' not defined

Hi

When you run the command manually does it work?

Here is what I get when I run my command

***@usel:/usr/local/nagios/libexec> ./check_nrpe -H test_server_1 -c check_load OK - load average: 1.09, 1.04, 1.01|load1=1.090;15.000;30.000;0; load5=1.040;10.000;25.000;0; load15=1.010;5.000;20.000;0;

Can you run the command and post the output if you are still getting problems?

Have you turned on debugging on the nrpe.cfg file and looked at the output when you have ran the command. This is very helpful diagnostic tool.

Here is the output from /var/log/messages with debug turned on in nrpe.cfg

May 2 09:59:34 h12oiap nrpe[4469]: Host is asking for command 'check_load' to be run...
May 2 09:59:34 h12oiap nrpe[4469]: Running command:
/usr/local/nagios/libexec/check_load -w 15,10,5 -c 30,25,20 May 2
09:59:34 h12oiap nrpe[4469]: Command completed with return code 0 and
output: OK - load average: 0.17, 0.15, 0.10|load1=0.170;15.000;30.000;0; load5=0.150;10.000;25.000;0; load15=0.100;5.000;20.000;0; May 2
09:59:34 h12oiap nrpe[4469]: Return Code: 0, Output: OK - load
average: 0.17, 0.15, 0.10|load1=0.170;15.000;30.000;0; load5=0.150;10.000;25.000;0; load15=0.100;5.000;20.000;0;

What do you get when you run yours?

Regards

Tom

-----Original Message-----
From: yu-***@agilent.com [mailto:yu-***@agilent.com]
Sent: 02 May 2007 09:50
To: Welsh,T,Tom,XSL4A C
Cc: nagios-***@lists.sourceforge.net
Subject: RE: [Nagios-users] NRPE: Command 'check_swap' not defined

Hi, all,

I just manually run command for testing purpose on my monitor server:

/usr/local/nagios/check_nrpe -H remote_host_name -c check_load

I've not configured it in Nagios configuration files yet.

Regards,

Yu Ting

-----Original Message-----
From: ***@bt.com [mailto:***@bt.com]
Sent: Wednesday, May 02, 2007 4:36 PM
To: yu-***@agilent.com; nagios-***@lists.sourceforge.net
Subject: RE: [Nagios-users] NRPE: Command 'check_swap' not defined

Is the check load command specified on the nagios monitoring box

Here is how my config is defined.

Remote nrpe box. /usr/local/etc/nrpe.cfg

command[check_load]=/usr/local/nagios/libexec/check_load -w 15,10,5 -c 30,25,20
[mailto:] On Behalf Of =
1970-01-01 00:00:00 UTC
Permalink
# ' check load on remote systems using nrpe define command{
command_name check_nrpe_load
command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -c $ARG1$
}

This works fine for me.

Regards

Tom



-----Original Message-----
From: nagios-users-***@lists.sourceforge.net
[mailto:nagios-users-***@lists.sourceforge.net] On Behalf Of =
yu-***@agilent.com
Sent: 02 May 2007 09:26
To: nagios-***@lists.sourceforge.net
Subject: [Nagios-users] NRPE: Command 'check_swap' not defined

Hi,=20

I've run into following NRPE issue.=20

NRPE: Command 'check_load' not defined

I've checked my remote client nrpe.cfg and the command definition is =
properly configured there.

command[check_load]=3D/usr/local/nagios/libexec/check_load -w
15,10,5 -c 30,25,20
...

Does anybody know what reason else can cause such issue? Thanks in =
advance.

Regards,=20

Yu Ting=20


------------------------------------------------------------------------
-
This SF.net email is sponsored by DB2 Express Download DB2 Express C - =
the FREE version of DB2 express and take control of your XML. No limits.
Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Nagios-users mailing list
Nagios-***@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when =
reporting any issue.=20
::: Messages without supporting info will risk being sent to /dev/null
Sebastian Ganame
2007-05-31 14:40:12 UTC
Permalink
Hi John,
Your problem is that you're trying to invoke a service that is not local, thus it shouldn be defined not only in your Nagios server configuration files, but also in the nrpe.cfg file used when the nrpe daemon starts on the target machine.
I'll try to explain just a little bit what I did since I suffered the same situation:

1) Define a new service in Nagios Engine for monitoring non-local disks, as follows:

define service{
use local-service ;Name of service template to use
host_name [the servers in which you have nrpe installed]
service_description Remote check disk
check_command check_nrpe!check_hda1!20%!10%!/
}

2) I used check_hda1 instead of check_disk to identify the way I use this in the target machines. Then you need to include this type of call in your target machine's nrpe.cfg file, as follows (at the very end):

# The following examples use hardcoded command arguments...
command[check_hda1]=/usr/local/nagios/libexec/check_disk -w 20 -c 10 -p /dev/hda1

This way, nrpe tells the target machine to call it's /usr/local/nagios/libexec/check_disk command when the Nagios core engine calls check_nrpe!check_hda1 on this target machine.

Hope it helps, and most important that you understand what I tried to tell you ;-)
Regards,


Sebastian Ganame


-----Original Message-----
From: nagios-users-***@lists.sourceforge.net [mailto:nagios-users-***@lists.sourceforge.net] On Behalf Of Jonathan Murray
Sent: Miércoles, 30 de Mayo de 2007 07:49 p.m.
To: nagios-***@lists.sourceforge.net
Subject: [Nagios-users] NRPE: Command 'check_disk' not defined

I've been staring at this for a long time, likely pilot error, but maybe
someone has suggestions or sees something I don't...thanks.

Nagios server version 2.8, (OS debian)
Nagios plugin version 1.4.7 (Red Hat Enterprise Linux WS release 4)
NRPE version 2.7.1

other plugins work (check_swap, check_load)

On nagios server:

/usr/local/nagios/etc/checkcommands.cfg

<-snip->

# check_disk
define command{
command_name check_disk
command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -c check_disk
}

<-snip->

On the machine I'm trying to monitor, the one running nrpe 2.7.1 with
the Nagios plugin version 1.4.7 (Red Hat Enterprise Linux WS release 4),
in /usr/local/nagios/libexec/etc/nrpe.cfg:

[***@paleo etc]# ls -la
total 28
drwxr-xr-x 2 nagios nagios 4096 May 30 17:03 .
drwxr-xr-x 6 nagios nagios 4096 May 30 17:13 ..
-rwxr-xr-x 1 nagios nagios 7536 May 30 17:03 nrpe.cfg

<-snip->

command[check_disk]=/usr/local/nagios/libexec/check_disk -w 20 -c 10 -p
/dev/sda5

<-snip->

when I test it from the server "nagios" it works fine:

***@nagios:/usr/local/nagios/libexec# ./check_nrpe -H paleo -c check_disk
DISK OK - free space: / 201921 MB (93% inode=99%);|
/=14918MB;228424;228434;0;22 8444

on the system running nrpe "paleo":

[***@paleo etc]# /usr/local/nagios/libexec/check_disk -w 20 -c 10 -p
/dev/sda5
DISK OK - free space: / 201921 MB (93% inode=99%);|
/=14918MB;228424;228434;0;228444

If NRPE, Command 'check_disk' not defined as the web interface reports,
then where should it be defined? I thought I needed to define the
command in the checkcommands.cfg on the server, then define the command
on the client that is running nrpe daemon.

thanks for any ideas,

Jonathan Murray






-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Nagios-users mailing list
Nagios-***@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



---------------------------------
Preguntá. Respondé. Descubrí.
Todo lo que querías saber, y lo que ni imaginabas,
está en Yahoo! Respuestas (Beta).
Probalo ya!
Jonathan Murray
2007-05-31 16:47:00 UTC
Permalink
Interesting. I'm still not getting it, or I'm doing something
incorrectly. I have other commands set up the same way, and they work:

for example,

on nagios "engine"

in checkcommands.cfg:

# 'check_disk_c1'
define command{
command_name check_disk_c1
command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -c
check_disk_c1
}

in services.cfg:

define service{
use generic-service ; Name of service template to use
host_name varuna
service_description Check /raid/c1 space
retry_check_interval 2
contact_groups linux-admin
notification_options w,c,r
check_command check_disk_c1
}

on machine I am trying to monitor, in /usr/local/nagios/etc/nrpe.cfg:

command[check_disk_c1]=/usr/local/nagios/libexec/check_disk -w 20 -c 10
-p /raid
/c1

On the web interface, in the status column I see the following:
varuna Check /raid/c1 space
OK 05-31-2007 12:21:11 2d 5h 56m 0s 1/3 DISK OK - free space:
/raid/c1 114527 MB (16% inode=99%):

So in this case, which is the same as the earlier description, it works.
Here the machine being monitored is a debian system, but I didn't
think that would make such a difference.

I have also set up the command as you specified, or how I interpreted
what you specified, I hope I was accurate here:

Nagios "engine"
in services.cfg:

define service{
use generic-service ; Name of service template to use
host_name paleo
service_description check disk sda5
retry_check_interval 2
contact_groups linux-admin
notification_options w,u,c,r
check_command check_nrpe!check_disk_sda5!20%!10%!/
}

In the above, I don't know what that / is doing after the !, but it was
in your mail, so I thought it was needed.

in checkcommands.cfg:

'check_disk_sda5'
define command{
command_name check_disk_sda5
command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -c
check_disk_sda5
}

On the machine I am trying to get information on the disk sda5,
command[check_disk_sda5]=/usr/local/nagios/libexec/check_disk -w 20 -c
10 -p /dev/sda5

It would seem here that on the machine being monitored, the command
"check_disk_sda5" would use the local plugin
/usr/local/nagios/libexec/check_disk with the options:
-w 20 -c 10 -p /dev/sda5

run locally, this is indeed what it seems to do. However, the server
doesn't seem to use the command I have placed in the nrpe.cfg file.

On the web interface, this returns, in the "Status" column:

NRPE v2.7.1

What do you use for your entries in you checkcommands.cfg for your
commands? I was under the impression that I had to define the commands
there and nagios would use them.

Perhaps these questions are getting too basic?

Thanks,

Jonathan
Post by Sebastian Ganame
Hi John,
Your problem is that you're trying to invoke a service that is not
local, thus it shouldn be defined not only in your Nagios server
configuration files, but also in the nrpe.cfg file used when the nrpe
daemon starts on the target machine.
define service{
use local-service ;Name of service template to use
host_name /[the servers in which you have nrpe
installed]/
/ /service_description Remote check disk
check_command check_nrpe!check_hda1!20%!10%!/
}
2) I used check_hda1 instead of check_disk to identify the way I
use this in the target machines. Then you need to include this type of
# The following examples use hardcoded command arguments...
command[check_hda1]=/usr/local/nagios/libexec/check_disk -w 20 -c 10 -p /dev/hda1
This way, nrpe tells the target machine to call it's
/usr/local/nagios/libexec/check_disk command when the Nagios core engine
calls check_nrpe!check_hda1 on this target machine.
Hope it helps, and most important that you understand what I tried to tell you ;-)
Regards,
Sebastian Ganame
-----Original Message-----
Jonathan Murray
Sent: Miércoles, 30 de Mayo de 2007 07:49 p.m.
Subject: [Nagios-users] NRPE: Command 'check_disk' not defined
I've been staring at this for a long time, likely pilot error, but maybe
someone has suggestions or sees something I don't...thanks.
Nagios server version 2.8, (OS debian)
Nagios plugin version 1.4.7 (Red Hat Enterprise Linux WS release 4)
NRPE version 2.7.1
other plugins work (check_swap, check_load)
/usr/local/nagios/etc/checkcommands.cfg
<-snip->
# check_disk
define command{
command_name check_disk
command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -c check_disk
}
<-snip->
On the machine I'm trying to monitor, the one running nrpe 2.7.1 with
the Nagios plugin version 1.4.7 (Red Hat Enterprise Linux WS release 4),
total 28
drwxr-xr-x 2 nagios nagios 4096 May 30 17:03 .
drwxr-xr-x 6 nagios nagios 4096 May 30 17:13 ..
-rwxr-xr-x 1 nagios nagios 7536 May 30 17:03 nrpe.cfg
<-snip->
command[check_disk]=/usr/local/nagios/libexec/check_disk -w 20 -c 10 -p
/dev/sda5
<-snip->
DISK OK - free space: / 201921 MB (93% inode=99%);|
/=14918MB;228424;228434;0;22 8444
/dev/sda5
DISK OK - free space: / 201921 MB (93% inode=99%);|
/=14918MB;228424;228434;0;228444
If NRPE, Command 'check_disk' not defined as the web interface reports,
then where should it be defined? I thought I needed to define the
command in the checkcommands.cfg on the server, then define the command
on the client that is running nrpe daemon.
thanks for any ideas,
Jonathan Murray
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Nagios-users mailing list
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
Sebastian Ganame
2007-05-31 17:45:39 UTC
Permalink
Hi John,
I think your problem is that you're defining "check_disk_sda5" in your checkcommands.cfg file, while it should be only in your "nrpe.cfg" file in each monitored instance.
The only checkcommand you should have for nrpe redirection is the following one:

define command{
command_name check_nrpe
command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -c $ARG1$
}

This tells the system that for each service defined with a check_command like “check_nrpe!...” it should be redirected using that line.

After this server side configuration, you should only define the check_disk_sda5 in your target system (the one that would end up reporting the metric), and it should work.

Hope you make it with these information.
Regards,

Sebastian Ganame


-----Original Message-----
From: Jonathan Murray [mailto:***@whoi.edu]
Sent: Jueves, 31 de Mayo de 2007 01:47 p.m.
To: Sebastian Ganame
Cc: nagios-***@lists.sourceforge.net
Subject: Re: [Nagios-users] NRPE: Command 'check_disk' not defined

Interesting. I'm still not getting it, or I'm doing something
incorrectly. I have other commands set up the same way, and they work:

for example,

on nagios "engine"

in checkcommands.cfg:

# 'check_disk_c1'
define command{
command_name check_disk_c1
command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -c
check_disk_c1
}

in services.cfg:

define service{
use generic-service ; Name of service template to use
host_name varuna
service_description Check /raid/c1 space
retry_check_interval 2
contact_groups linux-admin
notification_options w,c,r
check_command check_disk_c1
}

on machine I am trying to monitor, in /usr/local/nagios/etc/nrpe.cfg:

command[check_disk_c1]=/usr/local/nagios/libexec/check_disk -w 20 -c 10
-p /raid
/c1

On the web interface, in the status column I see the following:
varuna Check /raid/c1 space
OK 05-31-2007 12:21:11 2d 5h 56m 0s 1/3 DISK OK - free space:
/raid/c1 114527 MB (16% inode=99%):

So in this case, which is the same as the earlier description, it works.
Here the machine being monitored is a debian system, but I didn't
think that would make such a difference.

I have also set up the command as you specified, or how I interpreted
what you specified, I hope I was accurate here:

Nagios "engine"
in services.cfg:

define service{
use generic-service ; Name of service template to use
host_name paleo
service_description check disk sda5
retry_check_interval 2
contact_groups linux-admin
notification_options w,u,c,r
check_command check_nrpe!check_disk_sda5!20%!10%!/
}

In the above, I don't know what that / is doing after the !, but it was
in your mail, so I thought it was needed.

in checkcommands.cfg:

'check_disk_sda5'
define command{
command_name check_disk_sda5
command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -c
check_disk_sda5
}

On the machine I am trying to get information on the disk sda5,
command[check_disk_sda5]=/usr/local/nagios/libexec/check_disk -w 20 -c
10 -p /dev/sda5

It would seem here that on the machine being monitored, the command
"check_disk_sda5" would use the local plugin
/usr/local/nagios/libexec/check_disk with the options:
-w 20 -c 10 -p /dev/sda5

run locally, this is indeed what it seems to do. However, the server
doesn't seem to use the command I have placed in the nrpe.cfg file.

On the web interface, this returns, in the "Status" column:

NRPE v2.7.1

What do you use for your entries in you checkcommands.cfg for your
commands? I was under the impression that I had to define the commands
there and nagios would use them.

Perhaps these questions are getting too basic?

Thanks,

Jonathan
Post by Sebastian Ganame
Hi John,
Your problem is that you're trying to invoke a service that is not
local, thus it shouldn be defined not only in your Nagios server
configuration files, but also in the nrpe.cfg file used when the nrpe
daemon starts on the target machine.
I'll try to explain just a little bit what I did since I suffered
1) Define a new service in Nagios Engine for monitoring non-local
define service{
use local-service ;Name of service
template to use
host_name /[the servers in which you have nrpe
installed]/
/ /service_description Remote check disk
check_command check_nrpe!check_hda1!20%!10%!/
}
2) I used check_hda1 instead of check_disk to identify the way I
use this in the target machines. Then you need to include this type of
# The following examples use hardcoded command arguments...
command[check_hda1]=/usr/local/nagios/libexec/check_disk -w 20 -c 10 -p
/dev/hda1
This way, nrpe tells the target machine to call it's
/usr/local/nagios/libexec/check_disk command when the Nagios core engine
calls check_nrpe!check_hda1 on this target machine.
Hope it helps, and most important that you understand what I tried
to tell you ;-)
Regards,
Sebastian Ganame
-----Original Message-----
Jonathan Murray
Sent: Miércoles, 30 de Mayo de 2007 07:49 p.m.
Subject: [Nagios-users] NRPE: Command 'check_disk' not defined
I've been staring at this for a long time, likely pilot error, but maybe
someone has suggestions or sees something I don't...thanks.
Nagios server version 2.8, (OS debian)
Nagios plugin version 1.4.7 (Red Hat Enterprise Linux WS release 4)
NRPE version 2.7.1
other plugins work (check_swap, check_load)
/usr/local/nagios/etc/checkcommands.cfg
<-snip->
# check_disk
define command{
command_name check_disk
command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -c check_disk
}
<-snip->
On the machine I'm trying to monitor, the one running nrpe 2.7.1 with
the Nagios plugin version 1.4.7 (Red Hat Enterprise Linux WS release 4),
total 28
drwxr-xr-x 2 nagios nagios 4096 May 30 17:03 .
drwxr-xr-x 6 nagios nagios 4096 May 30 17:13 ..
-rwxr-xr-x 1 nagios nagios 7536 May 30 17:03 nrpe.cfg
<-snip->
command[check_disk]=/usr/local/nagios/libexec/check_disk -w 20 -c 10 -p
/dev/sda5
<-snip->
DISK OK - free space: / 201921 MB (93% inode=99%);|
/=14918MB;228424;228434;0;22 8444
/dev/sda5
DISK OK - free space: / 201921 MB (93% inode=99%);|
/=14918MB;228424;228434;0;228444
If NRPE, Command 'check_disk' not defined as the web interface reports,
then where should it be defined? I thought I needed to define the
command in the checkcommands.cfg on the server, then define the command
on the client that is running nrpe daemon.
thanks for any ideas,
Jonathan Murray
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Nagios-users mailing list
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
---------------------------------
Preguntá. Respondé. Descubrí.
Todo lo que querías saber, y lo que ni imaginabas,
está en Yahoo! Respuestas (Beta).
Probalo ya!
Jonathan Murray
2007-06-01 18:50:30 UTC
Permalink
Thanks Sebastian, the error was a result of two machines having the same
IP address in the hosts.cfg file. As usual, my error. Now that I have
eliminated my ridiculous oversight, everything is fine.

Thanks for your help, as a result of this process, the checkcommands.cfg
issue was resolved too.

-Jonathan
Post by Sebastian Ganame
Hi John,
I think your problem is that you're defining "check_disk_sda5"
in your checkcommands.cfg file, while it should be only in your
"nrpe.cfg" file in each monitored instance.
/define command{/
/ command_name check_nrpe/
/ command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -c
$ARG1$/
/}/
This tells the system that for each service defined with a
check_command like “check_nrpe!...” it should be redirected using that line.
After this server side configuration, you should only define
the check_disk_sda5 in your target system (the one that would end up
reporting the metric), and it should work.
Hope you make it with these information.
Regards,
Sebastian Ganame
-----Original Message-----
Sent: Jueves, 31 de Mayo de 2007 01:47 p.m.
To: Sebastian Ganame
Subject: Re: [Nagios-users] NRPE: Command 'check_disk' not defined
Interesting. I'm still not getting it, or I'm doing something
for example,
on nagios "engine"
# 'check_disk_c1'
define command{
command_name check_disk_c1
command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -c
check_disk_c1
}
define service{
use
generic-service ; Name of service template to use
host_name varuna
service_description Check /raid/c1 space
retry_check_interval 2
contact_groups linux-admin
notification_options w,c,r
check_command check_disk_c1
}
command[check_disk_c1]=/usr/local/nagios/libexec/check_disk -w 20 -c 10
-p /raid
/c1
varuna Check /raid/c1 space
So in this case, which is the same as the earlier description, it works.
Here the machine being monitored is a debian system, but I didn't
think that would make such a difference.
I have also set up the command as you specified, or how I interpreted
Nagios "engine"
define service{
use
generic-service ; Name of service template to use
host_name paleo
service_description check disk sda5
retry_check_interval 2
contact_groups linux-admin
notification_options w,u,c,r
check_command
check_nrpe!check_disk_sda5!20%!10%!/
}
In the above, I don't know what that / is doing after the !, but it was
in your mail, so I thought it was needed.
'check_disk_sda5'
define command{
command_name check_disk_sda5
command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -c
check_disk_sda5
}
On the machine I am trying to get information on the disk sda5,
command[check_disk_sda5]=/usr/local/nagios/libexec/check_disk -w 20 -c
10 -p /dev/sda5
It would seem here that on the machine being monitored, the command
"check_disk_sda5" would use the local plugin
-w 20 -c 10 -p /dev/sda5
run locally, this is indeed what it seems to do. However, the server
doesn't seem to use the command I have placed in the nrpe.cfg file.
NRPE v2.7.1
What do you use for your entries in you checkcommands.cfg for your
commands? I was under the impression that I had to define the commands
there and nagios would use them.
Perhaps these questions are getting too basic?
Thanks,
Jonathan
Post by Sebastian Ganame
Hi John,
Your problem is that you're trying to invoke a service that is not
local, thus it shouldn be defined not only in your Nagios server
configuration files, but also in the nrpe.cfg file used when the nrpe
daemon starts on the target machine.
I'll try to explain just a little bit what I did since I suffered
1) Define a new service in Nagios Engine for monitoring non-local
define service{
use local-service ;Name of service
template to use
host_name /[the servers in which you have nrpe
installed]/
/ /service_description Remote check disk
check_command check_nrpe!check_hda1!20%!10%!/
}
2) I used check_hda1 instead of check_disk to identify the way I
use this in the target machines. Then you need to include this type of
call in your target machine's nrpe.cfg file, as follows (at the very
# The following examples use hardcoded command arguments...
command[check_hda1]=/usr/local/nagios/libexec/check_disk -w 20 -c 10 -p
/dev/hda1
This way, nrpe tells the target machine to call it's
/usr/local/nagios/libexec/check_disk command when the Nagios core engine
calls check_nrpe!check_hda1 on this target machine.
Hope it helps, and most important that you understand what I tried
to tell you ;-)
Regards,
Sebastian Ganame
-----Original Message-----
Jonathan Murray
Sent: Miércoles, 30 de Mayo de 2007 07:49 p.m.
Subject: [Nagios-users] NRPE: Command 'check_disk' not defined
I've been staring at this for a long time, likely pilot error, but maybe
someone has suggestions or sees something I don't...thanks.
Nagios server version 2.8, (OS debian)
Nagios plugin version 1.4.7 (Red Hat Enterprise Linux WS release 4)
NRPE version 2.7.1
other plugins work (check_swap, check_load)
/usr/local/nagios/etc/checkcommands.cfg
<-snip->
# check_disk
define command{
command_name check_disk
command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -c
check_disk
Post by Sebastian Ganame
}
<-snip->
On the machine I'm trying to monitor, the one running nrpe 2.7.1 with
the Nagios plugin version 1.4.7 (Red Hat Enterprise Linux WS release 4),
total 28
drwxr-xr-x 2 nagios nagios 4096 May 30 17:03 .
drwxr-xr-x 6 nagios nagios 4096 May 30 17:13 ..
-rwxr-xr-x 1 nagios nagios 7536 May 30 17:03 nrpe.cfg
<-snip->
command[check_disk]=/usr/local/nagios/libexec/check_disk -w 20 -c 10 -p
/dev/sda5
<-snip->
check_disk
Post by Sebastian Ganame
DISK OK - free space: / 201921 MB (93% inode=99%);|
/=14918MB;228424;228434;0;22 8444
/dev/sda5
DISK OK - free space: / 201921 MB (93% inode=99%);|
/=14918MB;228424;228434;0;228444
If NRPE, Command 'check_disk' not defined as the web interface reports,
then where should it be defined? I thought I needed to define the
command in the checkcommands.cfg on the server, then define the command
on the client that is running nrpe daemon.
thanks for any ideas,
Jonathan Murray
Loading...