Page 1 of 1

Errors with installing linux-nrpe-agent on CentOS 7.4

Posted: Tue Feb 20, 2018 1:20 pm
by PhilG
Hello:
Slowly working out issues with trying to install the linux-nrpe-agent on a CentOS 7.4 server.
At this time, I'm running into errors regarding "configure: error: no acceptable C compiler found in $PATH"
Is there a particular version that the agent requires? I don't have the developer tools installed on the server and trying to get "gcc-c++" installed, but that's running into dependency issues, too.
Thanks.

Re: Errors with installing linux-nrpe-agent on CentOS 7.4

Posted: Tue Feb 20, 2018 1:45 pm
by bolson
Are you installing using this document as a guide:

https://assets.nagios.com/downloads/nag ... _Agent.pdf

This method should take care of dependency installation for you.

If installing from source using this guide:

https://support.nagios.com/kb/article.php?id=515#CentOS

Have you followed the instructions under Prerequisites?

Re: Errors with installing linux-nrpe-agent on CentOS 7.4

Posted: Tue Feb 20, 2018 2:10 pm
by PhilG
Yes to the first link. Thanks for the 2nd link since I didn't know about that one.
Gcc is not installed, but yum identifies "No package gcc available" and "No package openssl-devel available".
I need to troubleshoot the repositories.
bolson wrote:Are you installing using this document as a guide:

https://assets.nagios.com/downloads/nag ... _Agent.pdf

This method should take care of dependency installation for you.

If installing from source using this guide:

https://support.nagios.com/kb/article.php?id=515#CentOS

Have you followed the instructions under Prerequisites?

Re: Errors with installing linux-nrpe-agent on CentOS 7.4

Posted: Tue Feb 20, 2018 4:12 pm
by npolovenko
@PhilG,
I need to troubleshoot the repositories.
That's right. What is the output of:

Code: Select all

yum repolist
and

Code: Select all

ls  /etc/yum.repos.d/
Please navigate to:

Code: Select all

/etc/yum.repos.d/
Then nano into epel.repo
Find:

Code: Select all

Extra Packages for Enterprise Linux 7 
and make sure that enabled is set to 1

Then nano into the nagios-7.repo
And make sure that [nagios-base] and [nagiosxi-deps] has enabled = 1.

Re: Errors with installing linux-nrpe-agent on CentOS 7.4

Posted: Tue Feb 20, 2018 5:00 pm
by PhilG
Figured it out.
1). Disabled our local repo and then renamed the <local>.repo file.
2). Got the latest Public Repo and then enabled that .repo file.
3). Updated and then upgraded all that was needed.
4). Installed gcc, etc. as per the 2nd document link information.
5). Installed the linux-nrpe-agent doing an interactive install/setup.

This works now.

Problem that I will encounter: The non-interactive (unattended) install for the linux-nrpe-agent assumes some defaults (that appear to be RedHat chosen). Since I'm not using RedHat, what are the defaults that I need to modify (other than adding my own Nagios XI's server's IP in the "install.sh" file). I noticed that the "get-os-info" script uses command "lsb-release", however, that is not installed on Oracle Enterprise Linux 7.x.

npolovenko wrote:@PhilG,
I need to troubleshoot the repositories.
That's right. What is the output of:

Code: Select all

yum repolist
and

Code: Select all

ls  /etc/yum.repos.d/
Please navigate to:

Code: Select all

/etc/yum.repos.d/
Then nano into epel.repo
Find:

Code: Select all

Extra Packages for Enterprise Linux 7 
and make sure that enabled is set to 1

Then nano into the nagios-7.repo
And make sure that [nagios-base] and [nagiosxi-deps] has enabled = 1.

Re: Errors with installing linux-nrpe-agent on CentOS 7.4

Posted: Wed Feb 21, 2018 12:37 pm
by PhilG
As per following:
https://gamblisfx.com/how-to-fix-lsb_re ... entos-7-3/

it appears that the linux-nrpe-agent uses a command, lsb_release, that derives from RedHat somehow. I find this to be quite frustrating. I may have to re-engineer or be forced to install the lsb_release package. UGH!

UPDATE: More supported information:
https://linuxconfig.org/how-to-check-centos-version


PhilG wrote:Figured it out.
1). Disabled our local repo and then renamed the <local>.repo file.
2). Got the latest Public Repo and then enabled that .repo file.
3). Updated and then upgraded all that was needed.
4). Installed gcc, etc. as per the 2nd document link information.
5). Installed the linux-nrpe-agent doing an interactive install/setup.

This works now.

Problem that I will encounter: The non-interactive (unattended) install for the linux-nrpe-agent assumes some defaults (that appear to be RedHat chosen). Since I'm not using RedHat, what are the defaults that I need to modify (other than adding my own Nagios XI's server's IP in the "install.sh" file). I noticed that the "get-os-info" script uses command "lsb-release", however, that is not installed on Oracle Enterprise Linux 7.x.

npolovenko wrote:@PhilG,
I need to troubleshoot the repositories.
That's right. What is the output of:

Code: Select all

yum repolist
and

Code: Select all

ls  /etc/yum.repos.d/
Please navigate to:

Code: Select all

/etc/yum.repos.d/
Then nano into epel.repo
Find:

Code: Select all

Extra Packages for Enterprise Linux 7 
and make sure that enabled is set to 1

Then nano into the nagios-7.repo
And make sure that [nagios-base] and [nagiosxi-deps] has enabled = 1.

Re: Errors with installing linux-nrpe-agent on CentOS 7.4

Posted: Wed Feb 21, 2018 3:04 pm
by lmiltchev
it appears that the linux-nrpe-agent uses a command, lsb_release, that derives from RedHat somehow. I find this to be quite frustrating. I may have to re-engineer or be forced to install the lsb_release package. UGH!
The "get-os-info" script uses lsb_release only if present... For example, lsb_release is NOT installed on my test box:

Code: Select all

which lsb_release
/usr/bin/which: no lsb_release in (/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin)
When the lsb_release is not installed, the script will check if "/etc/oracle-release" file is present in order to determine if it is a Oracle Server. I do have the file on my machine:

Code: Select all

ls -la /etc/oracle-release
-rw-r--r--. 1 root root 32 Aug  4  2017 /etc/oracle-release
The version number is determined by running a sed command - example:

Code: Select all

sed 's/.*release \([0-9.]\+\).*/\1/' /etc/redhat-release
7.4
See the entire section of the code below:

Code: Select all

# Get OS & version
if which lsb_release &>/dev/null; then
	distro=`lsb_release -si`
	version=`lsb_release -sr`
elif [ -r /etc/redhat-release ]; then

	if rpm -q centos-release; then
		distro=CentOS
	elif rpm -q sl-release; then
		distro=Scientific
	elif [ -r /etc/oracle-release ]; then
		distro=OracleServer
	elif rpm -q cloudlinux-release; then
		distro=CloudLinux
    elif rpm -q fedora-release; then
		distro=Fedora
	elif rpm -q redhat-release || rpm -q redhat-release-server; then
		distro=RedHatEnterpriseServer
	fi >/dev/null

	version=`sed 's/.*release \([0-9.]\+\).*/\1/' /etc/redhat-release`
else
	# Release is not RedHat or CentOS, let's start by checking for SuSE
	# or we can just make the last-ditch effort to find out the OS by sourcing os-release if it exists
	if [ -r /etc/os-release ]; then
		source /etc/os-release
		if [ -n "$NAME" ]; then
			distro=$NAME
			version=$VERSION_ID
		fi
	fi
fi
I ran 'fullinstall -n' on my test Oracle Linux server, and the linux agent got installed without any issues...
################################################################################
### ###
### NRPE is currently set to allow connections only from these IP addresses: ###
### ###
### 127.0.0.1 ###
### ###
### If you would like to change this list, enter all IP addresses to allow, ###
### separated by spaces only, and then press Enter. ###
### (Put the address(es) of your Nagios XI servers(s) here.) ###
### ###
################################################################################

Allow from: x.x.x.x

Subcomponents installed OK
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.
Hope this helps. Let us know if you have any more questions. Thank you!

Re: Errors with installing linux-nrpe-agent on CentOS 7.4

Posted: Wed Feb 21, 2018 4:56 pm
by PhilG
Working now. Issues are resolved. Here's the information:
1). Test server had a local Yum repo. I had to disable that, get the latest Public Oracle repo and then enable that repo.
2). Test server needed updates, so did a yum update and yum upgrade (might as well).
3). Test server needed to have "gcc" and other needed pieces installed to satisfy C compiler error. Completed.
4). Installed lsb_release. It didn't hurt anything.
5). Added my Nagios XI's monitoring server's IP address into "../linux-nrpe-agent/subcomponents/install.cfg"
6). Ran "./fullinstall -n". All appears to working.

When the time comes, I will modify/update "/etc/xinetd.d/nrpe" with the new Nagios XI monitoring server's IP address, as per
https://support.nagios.com/kb/article/n ... e-615.html

Next task, doing backup on existing Nagios XI monitoring server, then attempt to import the backup into new Nagios XI monitoring server.
Existing server is running a Nagios XI minor version lower than the newer server at this time. I believe this shouldn't be an issue, but, existing server is on RHEL 6.5, too.

Re: Errors with installing linux-nrpe-agent on CentOS 7.4

Posted: Wed Feb 21, 2018 5:10 pm
by bolson
May we close this topic?

Re: Errors with installing linux-nrpe-agent on CentOS 7.4

Posted: Thu Feb 22, 2018 9:21 am
by PhilG
Yes.
bolson wrote:May we close this topic?