problem when install Nagios agent in linux red hat 7.1

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
paltel
Posts: 64
Joined: Wed Jul 22, 2015 3:47 am

problem when install Nagios agent in linux red hat 7.1

Post by paltel »

hi
when I'm trying to install Nagios agent just take one second the get this message

[firas@SDE-QM-02 ~]$ cd /tmp
[firas@SDE-QM-02 tmp]$ wget https://assets.nagios.com/downloads/nagiosxi/agents/ linux-nrpe-agent.tar.gz
--2017-03-19 15:40:08-- https://assets.nagios.com/downloads/nagiosxi/agents/lin ux-nrpe-agent.tar.gz
Resolving assets.nagios.com (assets.nagios.com)... 72.14.181.71, 2600:3c00::f03c :91ff:fedf:b821
Connecting to assets.nagios.com (assets.nagios.com)|72.14.181.71|:443... connect ed.
HTTP request sent, awaiting response... 200 OK
Length: 3497641 (3.3M) [application/x-gzip]
Saving to: ‘linux-nrpe-agent.tar.gz.5’

100%[======================================>] 3,497,641 1.45MB/s in 2.3s

2017-03-19 15:40:11 (1.45 MB/s) - ‘linux-nrpe-agent.tar.gz.5’ saved [3497641/349 7641]

[firas@SDE-QM-02 tmp]$ sudo tar xzf linux-nrpe-agent.tar.gz
[firas@SDE-QM-02 tmp]$ cd linux-nrpe-agent
[firas@SDE-QM-02 linux-nrpe-agent]$ sudo ./fullinstall
============================
Nagios Linux Agent Installer
============================

This script will install the Nagios Linux Agent by executing all necessary
sub-scripts.

IMPORTANT: This script should only be used on a clean installed system:

RedHat Enterprise, CentOS, Fedora, or Oracle
OpenSUSE or SUSE Enterprise
Ubuntu or Debian

Do NOT use this on a system running any other distro or that
does not allow additional package installation.

Proceeding with installation...
Running './0-repos'...
Repos already configured - exiting.
RESULT=0
Running './1-prereqs'...
Prereqs already installed - skipping...
RESULT=0
Running './2-usersgroups'...
Users/groups already configured - skipping.
RESULT=0
Running './3-services'...
/etc/services already updated - skipping.
RESULT=0
Running './4-firewall'...
Firewall rules already configured - skipping.
RESULT=0
Running './A-subcomponents'...
Subcomponents already configured - skipping.
RESULT=0

##########################################################
### ###
### Nagios XI Linux Agent Installation Complete! ###
### ###
##########################################################

If you experience any problems, please attach the file install.log that was just created to any support requests.


NOTICE:
Your firewall configuration was skipped
You need to manually open ports 5666 and 5667 for TCP traffic

[firas@SDE-QM-02 linux-nrpe-agent]$ ^C
[firas@SDE-QM-02 linux-nrpe-agent]$


what is the problem??
and the error in Nagios web this error in this server
You do not have the required permissions to view the files attached to this post.
dwhitfield
Former Nagios Staff
Posts: 4583
Joined: Wed Sep 21, 2016 10:29 am
Location: NoLo, Minneapolis, MN
Contact:

Re: problem when install Nagios agent in linux red hat 7.1

Post by dwhitfield »

Can you please post the nrpe.cfg from the remote machine?

I suspect you need to just add the XI server IP to the list of allowed hosts, but the file will help us determine if that's the case. If that's not the case, it will help us determine the next step.
paltel
Posts: 64
Joined: Wed Jul 22, 2015 3:47 am

Re: problem when install Nagios agent in linux red hat 7.1

Post by paltel »

# default: on
# description: NRPE (Nagios Remote Plugin Executor)
service nrpe
{
flags = REUSE
socket_type = stream
port = 5666
wait = no
user = nagios
group = nagios
server = /usr/local/nagios/bin/nrpe
server_args = -c /usr/local/nagios/etc/nrpe.cfg --inetd
log_on_failure += USERID
disable = no
only_from = 172.19.2.65
dwhitfield
Former Nagios Staff
Posts: 4583
Joined: Wed Sep 21, 2016 10:29 am
Location: NoLo, Minneapolis, MN
Contact:

Re: problem when install Nagios agent in linux red hat 7.1

Post by dwhitfield »

Is 172.19.2.65 the Nagios server?

From the remote server, what's the output of the two following commands:

Code: Select all

nmap localhost -p 5667
nmap localhost -p 5666
You may also want to take a look at https://assets.nagios.com/downloads/nag ... utions.pdf
paltel
Posts: 64
Joined: Wed Jul 22, 2015 3:47 am

Re: problem when install Nagios agent in linux red hat 7.1

Post by paltel »

172.19.2.65: its Nagios server

[firas@SDE-QM-02 ~]$ sudo service nrpe restart
Redirecting to /bin/systemctl restart nrpe.service
Failed to restart nrpe.service: Unit not found.
[firas@SDE-QM-02 ~]$ nmap localhost -p 5667
-bash: nmap: command not found
[firas@SDE-QM-02 ~]$ nmap localhost -p 5666
-bash: nmap: command not found
[firas@SDE-QM-02 ~]$
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: problem when install Nagios agent in linux red hat 7.1

Post by lmiltchev »

Can you run the following commands on the client (remote machine), and show the output?

Code: Select all

find / -name nrpe
systemctl restart xinetd.service
systemctl status xinetd.service
Next, run the following commands on the Nagios XI server and show the output:

Code: Select all

/usr/local/nagios/libexec/check_nrpe -H <client ip>
nmap <client ip> -p 5666
Be sure to check out our Knowledgebase for helpful articles and solutions!
paltel
Posts: 64
Joined: Wed Jul 22, 2015 3:47 am

Re: problem when install Nagios agent in linux red hat 7.1

Post by paltel »

firas@SDE-QM-02 ~]$ sudo find / -name nrpe
/usr/local/nagios/etc/nrpe
/etc/xinetd.d/nrpe
/tmp/linux-nrpe-agent/subcomponents/nrpe
/tmp/linux-nrpe-agent/subcomponents/nrpe/mods/cfg/nrpe
/tmp/linux-nrpe-agent/subcomponents/nrpe/nrpe-2.15/package/solaris/pkg/nrpe
[firas@SDE-QM-02 ~]$ sudo systemctl restart xinetd.service
[firas@SDE-QM-02 ~]$ sudo systemctl status xinetd.service
● xinetd.service - Xinetd A Powerful Replacement For Inetd
Loaded: loaded (/usr/lib/systemd/system/xinetd.service; enabled; vendor preset: enabled)
Active: active (running) since Tue 2017-03-21 17:13:20 IST; 16s ago
Process: 8344 ExecStart=/usr/sbin/xinetd -stayalive -pidfile /var/run/xinetd.pid $EXTRAOPTIONS (code=exited, status=0/SUCCESS)
Main PID: 8345 (xinetd)
CGroup: /system.slice/xinetd.service
└─8345 /usr/sbin/xinetd -stayalive -pidfile /var/run/xinetd.pid

Mar 21 17:13:20 SDE-QM-02 xinetd[8345]: removing discard
Mar 21 17:13:20 SDE-QM-02 xinetd[8345]: removing discard
Mar 21 17:13:20 SDE-QM-02 xinetd[8345]: removing echo
Mar 21 17:13:20 SDE-QM-02 xinetd[8345]: removing echo
Mar 21 17:13:20 SDE-QM-02 xinetd[8345]: removing tcpmux
Mar 21 17:13:20 SDE-QM-02 xinetd[8345]: removing time
Mar 21 17:13:20 SDE-QM-02 xinetd[8345]: removing time
Mar 21 17:13:20 SDE-QM-02 xinetd[8345]: Must specify a server in nrpe
Mar 21 17:13:20 SDE-QM-02 xinetd[8345]: xinetd Version 2.3.15 started with libwrap loadavg labeled-networking options compiled in.
Mar 21 17:13:20 SDE-QM-02 xinetd[8345]: Started working: 1 available service
[firas@SDE-QM-02 ~]$
paltel
Posts: 64
Joined: Wed Jul 22, 2015 3:47 am

Re: problem when install Nagios agent in linux red hat 7.1

Post by paltel »

I think there is no problem form Nagios servers because I configured many servers client and no problem but the problem only on this servers

BR
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: problem when install Nagios agent in linux red hat 7.1

Post by lmiltchev »

You are missing the binary... There should be one more line in the output of the "find" command:

Code: Select all

/usr/local/nagios/bin/nrpe
Let's try installing NRPE again. Run the following commands, and show the output in case you run into some errors:

Code: Select all

cd /tmp/linux-nrpe-agent/subcomponents/nrpe
./install
Be sure to check out our Knowledgebase for helpful articles and solutions!
paltel
Posts: 64
Joined: Wed Jul 22, 2015 3:47 am

Re: problem when install Nagios agent in linux red hat 7.1

Post by paltel »

Code: Select all

[firas@SDE-QM-02 ~]$ cd /tmp/linux-nrpe-agent/subcomponents/nrpe
[firas@SDE-QM-02 nrpe]$ sudo ./install
NRPE
checking for a BSD-compatible install... /bin/install -c
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking for gcc... gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ANSI C... none needed
checking whether make sets $(MAKE)... yes
checking how to run the C preprocessor... gcc -E
checking for egrep... grep -E
checking for ANSI C header files... yes
checking whether time.h and sys/time.h may both be included... yes
checking for sys/wait.h that is POSIX.1 compatible... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking ctype.h usability... yes
checking ctype.h presence... yes
checking for ctype.h... yes
checking dirent.h usability... yes
checking dirent.h presence... yes
checking for dirent.h... yes
checking errno.h usability... yes
checking errno.h presence... yes
checking for errno.h... yes
checking fcntl.h usability... yes
checking fcntl.h presence... yes
checking for fcntl.h... yes
checking getopt.h usability... yes
checking getopt.h presence... yes
checking for getopt.h... yes
checking grp.h usability... yes
checking grp.h presence... yes
checking for grp.h... yes
checking for inttypes.h... (cached) yes
checking netdb.h usability... yes
checking netdb.h presence... yes
checking for netdb.h... yes
checking pwd.h usability... yes
checking pwd.h presence... yes
checking for pwd.h... yes
checking signal.h usability... yes
checking signal.h presence... yes
checking for signal.h... yes
checking for stdint.h... (cached) yes
checking for strings.h... (cached) yes
checking for string.h... (cached) yes
checking syslog.h usability... yes
checking syslog.h presence... yes
checking for syslog.h... yes
checking tcpd.h usability... no
checking tcpd.h presence... no
checking for tcpd.h... no
checking for unistd.h... (cached) yes
checking arpa/inet.h usability... yes
checking arpa/inet.h presence... yes
checking for arpa/inet.h... yes
checking netinet/in.h usability... yes
checking netinet/in.h presence... yes
checking for netinet/in.h... yes
checking socket.h usability... no
checking socket.h presence... no
checking for socket.h... no
checking for sys/types.h... (cached) yes
checking sys/time.h usability... yes
checking sys/time.h presence... yes
checking for sys/time.h... yes
checking sys/resource.h usability... yes
checking sys/resource.h presence... yes
checking for sys/resource.h... yes
checking for sys/wait.h... (cached) yes
checking sys/socket.h usability... yes
checking sys/socket.h presence... yes
checking for sys/socket.h... yes
checking for sys/stat.h... (cached) yes
checking for an ANSI C-conforming const... yes
checking whether struct tm is in sys/time.h or time.h... time.h
checking for mode_t... yes
checking for pid_t... yes
checking for size_t... yes
checking return type of signal handlers... void
checking for uid_t in sys/types.h... yes
checking type of array argument to getgroups... gid_t
checking for int... yes
checking size of int... 4
checking for short... yes
checking size of short... 2
checking for long... yes
checking size of long... 8
checking for uint32_t... yes
checking for u_int32_t... yes
checking for int32_t... yes
checking for va_copy... yes
checking for vsnprintf... yes
checking for snprintf... yes
checking for asprintf... yes
checking for vasprintf... yes
checking for C99 vsnprintf... yes
checking for getopt_long... yes
checking for main in -lnsl... yes
checking for socket in -lsocket... no
checking for main in -lwrap... no
checking for strdup... yes
checking for strstr... yes
checking for strtoul... yes
checking for initgroups... yes
checking for closesocket... no
checking for socklen_t... yes
checking for type of socket size... size_t
checking for SSL headers... SSL headers found in /usr
checking for SSL libraries... SSL libraries found in /usr/lib64

*** Generating DH Parameters for SSL/TLS ***
./configure: line 6748: /usr/bin/openssl: No such file or directory
checking for Kerberos include files... could not find include files
checking for perl... /bin/perl
configure: creating ./config.status
config.status: creating Makefile
config.status: creating subst
config.status: creating src/Makefile
config.status: creating package/solaris/Makefile
config.status: creating init-script
config.status: creating init-script.debian
config.status: creating init-script.suse
config.status: creating nrpe.spec
config.status: creating sample-config/nrpe.cfg
config.status: creating sample-config/nrpe.xinetd
config.status: creating include/config.h


*** Configuration summary for nrpe 2.15 09-06-2013 ***:

 General Options:
 -------------------------
 NRPE port:    5666
 NRPE user:    nagios
 NRPE group:   nagios
 Nagios user:  nagios
 Nagios group: nagios


Review the options above for accuracy.  If they look okay,
type 'make all' to compile the NRPE daemon and client.

cd ./src/; make ; cd ..
make[1]: Entering directory `/tmp/linux-nrpe-agent/subcomponents/nrpe/nrpe-2.15/src'
gcc -g -O2 -I/usr/include/openssl -I/usr/include -DHAVE_CONFIG_H -I ../include -I ./../include -o nrpe ./nrpe.c ./utils.c ./acl.c -L/usr/lib64  -lssl -lcrypto -lnsl
./nrpe.c: In function ‘main’:
./nrpe.c:269:5: warning: assignment makes pointer from integer without a cast [enabled by default]
   dh=get_dh512();
     ^
/tmp/cc3kIAXp.o: In function `main':
/tmp/linux-nrpe-agent/subcomponents/nrpe/nrpe-2.15/src/./nrpe.c:269: undefined reference to `get_dh512'
collect2: error: ld returned 1 exit status
make[1]: *** [nrpe] Error 1
make[1]: Leaving directory `/tmp/linux-nrpe-agent/subcomponents/nrpe/nrpe-2.15/src'

*** Compile finished ***

If the NRPE daemon and client compiled without any errors, you
can continue with the installation or upgrade process.

Read the PDF documentation (NRPE.pdf) for information on the next
steps you should take to complete the installation or upgrade.

cd ./src/ && make install-plugin
make[1]: Entering directory `/tmp/linux-nrpe-agent/subcomponents/nrpe/nrpe-2.15/src'
/bin/install -c -m 775 -o nagios -g nagios -d /usr/local/nagios/libexec
/bin/install -c -m 775 -o nagios -g nagios check_nrpe /usr/local/nagios/libexec
/bin/install: cannot stat ‘check_nrpe’: No such file or directory
make[1]: *** [install-plugin] Error 1
make[1]: Leaving directory `/tmp/linux-nrpe-agent/subcomponents/nrpe/nrpe-2.15/src'
make: *** [install-plugin] Error 2
NRPE-POST
[firas@SDE-QM-02 nrpe]$
Locked