Page 2 of 2

Re: NRPE: Command 'check_disk' not defined

Posted: Fri Apr 28, 2017 6:23 am
by dambaru
I have just installed nrpe in a client machine with RHEL 6.5 and instillation got successful . Now i could see the service is not configured also nrpe is core dumping .
below is master document followed for client https://support.nagios.com/kb/article.php?id=515

[root@nagiosclient bin]# service nrpe start
nrpe: unrecognized service
[root@nagiosclient bin]#
[root@nagiosclient bin]# /usr/local/nagios/libexec/check_nrpe -H 127.0.0.1
Segmentation fault (core dumped)
[root@nagiosclient bin]# /usr/local/nagios/bin/nrpe -c /usr/local/nagios/etc/nrpe.cfg -f
Segmentation fault (core dumped)
[root@nagiosclient bin]#

Regards
Dambaru

Re: NRPE: Command 'check_disk' not defined

Posted: Fri Apr 28, 2017 7:52 am
by tacolover101
did you see any errors when compiling? was this binary transferred to the machine without compiling?

try running a strace in front of the command to see if that provides any further verbose information.

Re: NRPE: Command 'check_disk' not defined

Posted: Fri Apr 28, 2017 11:26 am
by tgriep
Thanks @tacolover101 for the tips.
Also, check the /var/log/messages file for any errors when you are trying to start up the NRPE Agent.
In the folder you compiled the NRPE Agent is a file called config.log, can you post that so we can view it?

Re: NRPE: Command 'check_disk' not defined

Posted: Sun Apr 30, 2017 10:00 am
by dambaru
1. i was not finding any issue while compiling .
2. file was transferred from other linux using scp command .. hope this is fine only .

Pls find the strace log as below .

Code: Select all

strace /usr/local/nagios/libexec/check_nrpe -H 127.0.0.1
execve("/usr/local/nagios/libexec/check_nrpe", ["/usr/local/nagios/libexec/check_"..., "-H", "127.0.0.1"], [/* 31 vars */]) = 0
brk(0)                                  = 0x1b1b000
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f511df06000
access("/etc/ld.so.preload", R_OK)      = -1 ENOENT (No such file or directory)
open("/etc/ld.so.cache", O_RDONLY)      = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=169301, ...}) = 0
mmap(NULL, 169301, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7f511dedc000
close(3)                                = 0
open("/usr/lib64/libssl.so.10", O_RDONLY) = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\320\203\1\0\0\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=445432, ...}) = 0
mmap(NULL, 2540808, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f511da7b000
mprotect(0x7f511dadd000, 2097152, PROT_NONE) = 0
mmap(0x7f511dcdd000, 45056, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x62000) = 0x7f511dcdd000
close(3)                                = 0
open("/usr/lib64/libcrypto.so.10", O_RDONLY) = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\300\234\6\0\0\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=1967392, ...}) = 0
mmap(NULL, 4079480, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f511d697000
mprotect(0x7f511d851000, 2093056, PROT_NONE) = 0
mmap(0x7f511da50000, 159744, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1b9000) = 0x7f511da50000
mmap(0x7f511da77000, 16248, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7f511da77000
close(3)                                = 0
open("/lib64/libnsl.so.1", O_RDONLY)    = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0p@\0\0\0\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=113904, ...}) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f511dedb000
mmap(NULL, 2198192, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f511d47e000
mprotect(0x7f511d494000, 2093056, PROT_NONE) = 0
mmap(0x7f511d693000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x15000) = 0x7f511d693000
mmap(0x7f511d695000, 6832, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7f511d695000
close(3)                                = 0
open("/lib64/libc.so.6", O_RDONLY)      = 3
read(3, "\177ELF\2\1\1\3\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0000\356\1\0\0\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=1924768, ...}) = 0
mmap(NULL, 3750184, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f511d0ea000
mprotect(0x7f511d274000, 2097152, PROT_NONE) = 0
mmap(0x7f511d474000, 24576, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x18a000) = 0x7f511d474000
mmap(0x7f511d47a000, 14632, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7f511d47a000
close(3)                                = 0
open("/lib64/libgssapi_krb5.so.2", O_RDONLY) = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0000\254@B4\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=280520, ...}) = 0
mmap(0x3442400000, 2373600, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x3442400000
mprotect(0x3442441000, 2097152, PROT_NONE) = 0
mmap(0x3442641000, 12288, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x41000) = 0x3442641000
close(3)                                = 0
open("/lib64/libkrb5.so.3", O_RDONLY)   = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0000\264\201A4\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=944712, ...}) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f511deda000
mmap(0x3441800000, 3037856, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x3441800000
mprotect(0x34418db000, 2093056, PROT_NONE) = 0
mmap(0x3441ada000, 49152, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0xda000) = 0x3441ada000
close(3)                                = 0
open("/lib64/libcom_err.so.2", O_RDONLY) = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\360\23\0@4\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=17256, ...}) = 0
mmap(0x3440000000, 2109872, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x3440000000
mprotect(0x3440003000, 2093056, PROT_NONE) = 0
mmap(0x3440202000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x2000) = 0x3440202000
close(3)                                = 0
open("/lib64/libk5crypto.so.3", O_RDONLY) = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\320C@A4\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=177520, ...}) = 0
mmap(0x3441400000, 2273704, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x3441400000
mprotect(0x3441429000, 2097152, PROT_NONE) = 0
mmap(0x3441629000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x29000) = 0x3441629000
mmap(0x344162b000, 424, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x344162b000
close(3)                                = 0
open("/lib64/libdl.so.2", O_RDONLY)     = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\340\r\0\0\0\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=20024, ...}) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f511ded9000
mmap(NULL, 2109696, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f511cee6000
mprotect(0x7f511cee8000, 2097152, PROT_NONE) = 0
mmap(0x7f511d0e8000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x2000) = 0x7f511d0e8000
close(3)                                = 0
open("/lib64/libz.so.1", O_RDONLY)      = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0 !@94\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=91096, ...}) = 0
mmap(0x3439400000, 2183696, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x3439400000
mprotect(0x3439415000, 2093056, PROT_NONE) = 0
mmap(0x3439614000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x14000) = 0x3439614000
close(3)                                = 0
open("/lib64/libkrb5support.so.0", O_RDONLY) = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0@*\0A4\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=46368, ...}) = 0
mmap(0x3441000000, 2139216, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x3441000000
mprotect(0x344100a000, 2093056, PROT_NONE) = 0
mmap(0x3441209000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x9000) = 0x3441209000
close(3)                                = 0
open("/lib64/libkeyutils.so.1", O_RDONLY) = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\360\v\0B4\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=12592, ...}) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f511ded8000
mmap(0x3442000000, 2105424, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x3442000000
mprotect(0x3442002000, 2093056, PROT_NONE) = 0
mmap(0x3442201000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1000) = 0x3442201000
close(3)                                = 0
open("/lib64/libresolv.so.2", O_RDONLY) = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\00009\0\0\0\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=111440, ...}) = 0
mmap(NULL, 2202248, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f511cccc000
mprotect(0x7f511cce2000, 2097152, PROT_NONE) = 0
mmap(0x7f511cee2000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x16000) = 0x7f511cee2000
mmap(0x7f511cee4000, 6792, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7f511cee4000
close(3)                                = 0
open("/lib64/libpthread.so.0", O_RDONLY) = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0000^\0\0\0\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=143280, ...}) = 0
mmap(NULL, 2212848, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f511caaf000
mprotect(0x7f511cac6000, 2097152, PROT_NONE) = 0
mmap(0x7f511ccc6000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x17000) = 0x7f511ccc6000
mmap(0x7f511ccc8000, 13296, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7f511ccc8000
close(3)                                = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f511ded7000
open("/lib64/libselinux.so.1", O_RDONLY) = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0PX@:4\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=124624, ...}) = 0
mmap(0x343a400000, 2221912, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x343a400000
mprotect(0x343a41d000, 2093056, PROT_NONE) = 0
mmap(0x343a61c000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1c000) = 0x343a61c000
mmap(0x343a61e000, 1880, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x343a61e000
close(3)                                = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f511ded6000
mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f511ded4000
arch_prctl(ARCH_SET_FS, 0x7f511ded47c0) = 0
mprotect(0x343a61c000, 4096, PROT_READ) = 0
mprotect(0x7f511ccc6000, 4096, PROT_READ) = 0
mprotect(0x7f511cee2000, 4096, PROT_READ) = 0
mprotect(0x3442201000, 4096, PROT_READ) = 0
mprotect(0x3441209000, 4096, PROT_READ) = 0
mprotect(0x3439614000, 4096, PROT_READ) = 0
mprotect(0x7f511d0e8000, 4096, PROT_READ) = 0
mprotect(0x3441629000, 4096, PROT_READ) = 0
mprotect(0x3440202000, 4096, PROT_READ) = 0
mprotect(0x3441ada000, 40960, PROT_READ) = 0
mprotect(0x3442641000, 4096, PROT_READ) = 0
mprotect(0x7f511d474000, 16384, PROT_READ) = 0
mprotect(0x7f511d693000, 4096, PROT_READ) = 0
--- SIGSEGV (Segmentation fault) @ 0 (0) ---
+++ killed by SIGSEGV (core dumped) +++
Segmentation fault (core dumped)

Re: NRPE: Command 'check_disk' not defined

Posted: Sun Apr 30, 2017 10:45 am
by dambaru
Please find var/log/mesasge file content .

Code: Select all

Apr 30 21:13:23 nagiosclient abrtd: Directory 'ccpp-2017-04-30-21:13:23-18796' creation detected
Apr 30 21:13:23 nagiosclient abrt[18797]: Saved core dump of pid 18796 (/usr/local/nagios/libexec/check_nrpe) to /var/spool/abrt/ccpp-2017-04-30-21:13:23-18796 (626688 bytes)
Apr 30 21:13:23 nagiosclient abrt[18799]: Saved core dump of pid 18795 (/usr/bin/strace) to /var/spool/abrt/ccpp-2017-04-30-21:13:23-18795 (385024 bytes)
Apr 30 21:13:23 nagiosclient abrtd: Directory 'ccpp-2017-04-30-21:13:23-18795' creation detected
Apr 30 21:13:23 nagiosclient abrtd: Executable '/usr/local/nagios/libexec/check_nrpe' doesn't belong to any package and ProcessUnpackaged is set to 'no'
Apr 30 21:13:23 nagiosclient abrtd: 'post-create' on '/var/spool/abrt/ccpp-2017-04-30-21:13:23-18796' exited with 1
Apr 30 21:13:23 nagiosclient abrtd: Deleting problem directory '/var/spool/abrt/ccpp-2017-04-30-21:13:23-18796'
Apr 30 21:13:23 nagiosclient abrtd: Blacklisted package 'strace'
Apr 30 21:13:23 nagiosclient abrtd: 'post-create' on '/var/spool/abrt/ccpp-2017-04-30-21:13:23-18795' exited with 1
Apr 30 21:13:23 nagiosclient abrtd: Deleting problem directory '/var/spool/abrt/ccpp-2017-04-30-21:13:23-18795'

Re: NRPE: Command 'check_disk' not defined

Posted: Mon May 01, 2017 11:30 am
by tgriep
If the NRPE Agent and check_nrpe command was compiled on another system and then copied over, then that is the issue.
Both systems would have to have the same libraries installed, both running somewhat similar Linux Kernels, etc for the copy to work.
Can you compile the Agent on the remote server so you know it gets built correctly?

Re: NRPE: Command 'check_disk' not defined

Posted: Wed May 03, 2017 8:51 am
by dambaru
Hi

it was not copied from other system , same has been installed/compiled from tar.gz file .

Regards
Dambaru

Re: NRPE: Command 'check_disk' not defined

Posted: Wed May 03, 2017 9:26 am
by tgriep
From your earlier post you said
2. file was transferred from other linux using scp command .. hope this is fine only .
What do you mean by that, just the check_disk command was copied over?

The check_nrpe command segfaulting, we would have to see the config.log file to see how it was compiled.

Re: NRPE: Command 'check_disk' not defined

Posted: Sat May 06, 2017 9:28 am
by dambaru
i had just scp below files from a linux system (using this files only i had installed nagios in other linux client ) and followed the steps (https://support.nagios.com/kb/article.php?id=515) to install nagios client .

nrpe-3.0.1.tar.gz
nagios-plugins-2.2.0.tar.gz
linux-nrpe-agent.tar.gz

Regards
Dambaru

Re: NRPE: Command 'check_disk' not defined

Posted: Mon May 08, 2017 9:49 am
by tgriep
Thanks for clearing up the confusion on what was copied over, Copying the source using SCP should be OK.

You posted that you copied the new NRPE agent (3.0.1) and the old agent (linux-nrpe-agent.tar.gz), did install both of them by mistake?
If so, remove the older NRPE Agent and reinstall the new one and see if that cures the segfault when it starts up.

If you are still having issues, can you run the following commands as root and post the output from that remote system?

Code: Select all

/usr/local/nagios/bin/nrpe
ls -l /usr/local/nagios/libexec
cat /usr/local/nagios/etc/nrpe.cfg