# How to install NRPE2 on FreeBSD 9.1?



## littlesandra88 (Apr 22, 2013)

Hello all 

I would like to install NRPE2 on my FreeBSD 9.1, but I am asked to remove the current version of Perl, which seems somewhat risky to me. What would the preferred way be to install NRPE2? 


```
# export PACKAGESITE="ftp://ftp.freebsd.org/pub/FreeBSD/ports/amd64/packages-9-stable/Latest/"
# pkg_add -r nrpe2
Fetching ftp://ftp.freebsd.org/pub/FreeBSD/ports/amd64/packages-9-stable/Latest/nrpe2.tbz... Done.
Fetching ftp://ftp.freebsd.org/pub/FreeBSD/ports/amd64/packages-9-stable/All/perl-5.14.2_3.tbz... Done.
pkg_add: package 'perl-5.14.2_3' conflicts with perl-5.12.4_3
pkg_add: please use pkg_delete first to remove conflicting package(s) or -f to force installation
pkg_add: pkg_add of dependency 'perl-5.14.2_3' failed!
Fetching ftp://ftp.freebsd.org/pub/FreeBSD/ports/amd64/packages-9-stable/All/nagios-plugins-1.4.16,1.tbz... Done.
pkg_add: could not find package perl-5.14.2_3 !
pkg_add: pkg_add of dependency 'nagios-plugins-1.4.16,1' failed!
#
```


----------



## cpm@ (Apr 22, 2013)

Mmm... Install from packages don't like your current dependencies, for that reason, run `# cd /usr/ports/net-mgmt/nrpe2 && make install clean`

Remember, read always /usr/ports/UPDATING before perform an update.

I prefer to use a ports manager to doing that rutinary stuff. To choose you have: portmaster(8) or portupgrade(1)


----------



## littlesandra88 (Apr 22, 2013)

I looked at portmaster and portupgrade, but I am terrified about their many options =)  Would they be able to install it without any problems? When I do the make install clean I get this error:

```
Making install in src
test -z "/usr/local/bin" || ../build-aux/install-sh -c -d "/usr/local/bin"
  install  -s -o root -g wheel -m 555 m4 '/usr/local/bin/./gm4'
Making install in doc
test -z "/usr/local/info" || ../build-aux/install-sh -c -d "/usr/local/info"
 install  -o root -g wheel -m 444 ./m4.info ./m4.info-1 ./m4.info-2 '/usr/local/info'
 install-info --info-dir='/usr/local/info' '/usr/local/info/m4.info'
test -z "/usr/local/man/man1" || ../build-aux/install-sh -c -d "/usr/local/man/man1"
 install  -o root -g wheel -m 444 './m4.1' '/usr/local/man/man1/gm4.1'
Making install in checks
Making install in tests
make  install-recursive
Making install in .
install  -o root -g wheel -m 444 /usr/ports/devel/m4/work/m4-1.4.16/examples/*.m4 /usr/local/share/examples/gm4
install-info --quiet /usr/local/info/m4.info /usr/local/info/dir
===>   Compressing manual pages for m4-1.4.16,1
===>   Registering installation for m4-1.4.16,1
===>   Returning to build of autoconf-2.68
===>   autoconf-2.68 depends on executable: help2man - not found
===>    Verifying install for help2man in /usr/ports/misc/help2man
===>  Vulnerability check disabled, database not found
===>  License GPLv3 accepted by the user
=> help2man-1.40.4.tar.gz doesn't seem to exist in /usr/ports/distfiles/.
=> Attempting to fetch http://ftp.gnu.org/gnu/help2man/help2man-1.40.4.tar.gz
help2man-1.40.4.tar.gz                        100% of  173 kB  242 kBps
===>  Extracting for help2man-1.40.4
=> SHA256 Checksum OK for help2man-1.40.4.tar.gz.
===>   help2man-1.40.4 depends on file: /usr/local/bin/perl5.12.4 - found
===>  Patching for help2man-1.40.4
===>   help2man-1.40.4 depends on file: /usr/local/bin/perl5.12.4 - found
===>   help2man-1.40.4 depends on file: /usr/local/lib/perl5/site_perl/5.12.4/mach/Locale/gettext.pm - not found
===>    Verifying install for /usr/local/lib/perl5/site_perl/5.12.4/mach/Locale/gettext.pm in /usr/ports/devel/p5-Locale-gettext
===>  Vulnerability check disabled, database not found
===>  License check disabled, port has not defined LICENSE
=> gettext-1.05.tar.gz doesn't seem to exist in /usr/ports/distfiles/.
=> Attempting to fetch ftp://ftp.cpan.org/pub/CPAN/modules/by-module/Locale/gettext-1.05.tar.gz
gettext-1.05.tar.gz                           100% of 7693  B 7424 kBps
===>  Extracting for p5-Locale-gettext-1.05_3
=> SHA256 Checksum OK for gettext-1.05.tar.gz.
===>   p5-Locale-gettext-1.05_3 depends on file: /usr/local/bin/perl5.12.4 - found
===>  Patching for p5-Locale-gettext-1.05_3
===>   p5-Locale-gettext-1.05_3 depends on file: /usr/local/bin/perl5.12.4 - found
===>   p5-Locale-gettext-1.05_3 depends on file: /usr/local/bin/perl5.12.4 - found
===>   p5-Locale-gettext-1.05_3 depends on shared library: intl - found
===>  Configuring for p5-Locale-gettext-1.05_3
checking for gettext... no
checking for gettext in -lintl... no
gettext function not found. Please install libintl at ./Makefile.PL line 18.
*** [do-configure] Error code 2

Stop in /usr/ports/devel/p5-Locale-gettext.
*** [build-depends] Error code 1

Stop in /usr/ports/misc/help2man.
*** [build-depends] Error code 1

Stop in /usr/ports/devel/autoconf.
*** [build-depends] Error code 1

Stop in /usr/ports/devel/automake.
*** [build-depends] Error code 1

Stop in /usr/ports/net-mgmt/nagios-plugins.
*** [/usr/ports/net-mgmt/nagios-plugins/work/.configure_done.nagios-plugins._usr_local] Error code 1

Stop in /usr/ports/net-mgmt/nagios-plugins.
*** [install] Error code 1

Stop in /usr/ports/net-mgmt/nagios-plugins.
*** [run-depends] Error code 1

Stop in /usr/ports/net-mgmt/nrpe2.
*** [install] Error code 1

Stop in /usr/ports/net-mgmt/nrpe2.
[root@nas3 /usr/ports/net-mgmt/nrpe2]#
```


----------



## cpm@ (Apr 22, 2013)

Sure, install ports-mgmt/portmaster, and use this portmaster.rc that should be placed in /usr/local/etc directory:

```
# $FreeBSD$
#
# Sample portmaster rc file.
# Place in $HOME/.portmasterrc or /usr/local/etc/portmaster.rc
#
# Please read the portmaster man page for more information on
# these options.
#
# Do not create temporary backup packages before pkg_delete (-B)
# NO_BACKUP=Bopt
#
# Always save the backup packages of the old port (-b)
BACKUP=bopt
#
# Make and save a package of the new port (-g)
# MAKE_PACKAGE=gopt
#
# Do not preclean the port's build directory (-C)
# DONT_PRE_CLEAN=Copt
#
# Do not clean the port's build directory after installation (-K)
# DONT_POST_CLEAN=Kopt
#
# Never search for stale distfiles to delete (-D)
# DONT_SCRUB_DISTFILES=Dopt
#
# Always delete stale distfiles without prompting (-d)
ALWAYS_SCRUB_DISTFILES=dopt
#
# Do not run 'make config' for ports that need updating (-G)
# PM_NO_MAKE_CONFIG=Gopt
#
# Hide the build and install processes in a log file (-H)
# HIDE_BUILD=Hopt
#
# Arguments to pass to make (-m)
PM_MAKE_ARGS='-DFORCE_PKG_REGISTER'
#
# Recurse through every dependency, and child dependencies (-t)
#
# NOTE:	USE OF THIS OPTION IN YOUR CONFIG FILE IS NOT RECOMMENDED
#	IT IS ONLY NEEDED IN SPECIAL CIRCUMSTANCES, AND SHOULD BE
#	USED FROM THE COMMAND LINE.
#
# RECURSE_THOROUGH=topt
#
# Be verbose (-v)
# PM_VERBOSE=vopt
#
# Save copies of old shared libraries (recommended) (-w)
SAVE_SHARED=wopt
#
# Install a package if available (-P or --packages)
# PM_PACKAGES=first
#
# Only install packages (-PP or --packages-only)
# PM_PACKAGES=only
#
# Install packages for build-only dependencies (--packages-build)
# PM_PACKAGES_BUILD=pmp_build
#
# Delete build-only dependencies when finished (--delete-build-only)
# PM_DEL_BUILD_ONLY=pm_dbo
#
# Use packages if they are newer than installed (--packages-newer)
# PM_PACKAGES=newer
# PM_PACKAGES_NEWER=pmp_newer
#
# Always fetch new package files (--always-fetch)
# PM_ALWAYS_FETCH=pm_always_fetch
#
# Specify a local package repository (--local-packagedir)
# LOCAL_PACKAGEDIR=<path>
#
# Only use packages from --local-packagedir (--packages-local)
# PM_PACKAGES_LOCAL=pmp_local
#
# Delete packages after they are installed (--delete-packages)
# PM_DELETE_PACKAGES=pm_delete_packages
#
# Suppress the build confirmation message (--no-confirm)
# PM_NO_CONFIRM=pm_no_confirm
#
# Do not update the xterm title bar (--no-term-title)
# PM_NO_TERM_TITLE=pm_no_term_title
#
# Do not fetch the INDEX file (--no-index-fetch)
# PM_NO_INDEX_FETCH=pm_no_index_fetch
#
# Use only the INDEX file to check if a port is out of date (--index)
# PM_INDEX=pm_index
#
# Use the INDEX file first, then check /usr/ports (--index-first)
# PM_INDEX=pm_index
# PM_INDEX_FIRST=pm_index_first
#
# Use the INDEX file instead of /usr/ports (--index-only)
# PM_INDEX=pm_index
# PM_INDEX_ONLY=pm_index_only
#
#
# The following options are available for the rc file only:
#
# Log actions taken by portmaster with a date/time stamp
PM_LOG=/var/log/portmaster.log
#
# Do not prompt the user for failed backup package creation
# PM_IGNORE_FAILED_BACKUP_PACKAGE=pm_ignore_failed_backup_package
#
# List of files to preserve across upgrades, and the ports that install them.
# You can convert category/portname to the right pattern for the _files variable
# by using the following: echo category/portname | sed 's#[-+/\.]#_#g'
# PM_PRESERVE_PORTS="dns/p5-Net-DNS"
# dns_p5_Net_DNS_files="/usr/local/share/doc/p5-Net-DNS/TODO"
```

To install nrpe2, just run `# portmaster net-mgmt/nrpe2` and goodbye to missing dependencies errors :e


----------



## wblock@ (Apr 22, 2013)

There will probably be outdated packages installed that have to be updated.  Following the procedure to rebuild all ports at the end of portmaster(8) will get that all up to date.


----------



## littlesandra88 (Apr 23, 2013)

@wblock@, you mean `portmaster -a`? All ports are up to date, it says.


----------



## littlesandra88 (Apr 23, 2013)

@cpu82, when I do `portmaster net-mgmt/nrpe2` I get:


```
===>  Cleaning for p5-Locale-gettext-1.05_3
===>  Vulnerability check disabled, database not found
===>  License check disabled, port has not defined LICENSE
===>  Extracting for p5-Locale-gettext-1.05_3
=> SHA256 Checksum OK for gettext-1.05.tar.gz.
===>   p5-Locale-gettext-1.05_3 depends on file: /usr/local/bin/perl5.12.4 - found
===>  Patching for p5-Locale-gettext-1.05_3
===>   p5-Locale-gettext-1.05_3 depends on file: /usr/local/bin/perl5.12.4 - found
===>   p5-Locale-gettext-1.05_3 depends on file: /usr/local/bin/perl5.12.4 - found
===>   p5-Locale-gettext-1.05_3 depends on shared library: intl - found
===>  Configuring for p5-Locale-gettext-1.05_3
checking for gettext... no
checking for gettext in -lintl... no
gettext function not found. Please install libintl at ./Makefile.PL line 18.
*** [do-configure] Error code 2

Stop in /usr/ports/devel/p5-Locale-gettext.

===>>> make failed for devel/p5-Locale-gettext
===>>> Aborting update

===>>> Update for devel/p5-Locale-gettext failed
===>>> Aborting update

===>>> Update for misc/help2man failed
===>>> Aborting update

===>>> Update for devel/autoconf failed
===>>> Aborting update

===>>> Update for net-mgmt/nagios-plugins failed
===>>> Aborting update

Terminated

===>>> You can restart from the point of failure with this command line:
       portmaster <flags> net-mgmt/nrpe2 net-mgmt/nagios-plugins devel/autoconf devel/autoconf-wrapper misc/help2man devel/p5-Locale-gettext devel/automake devel/automake-wrapper devel/libtool
```

Full output here.

I have added your config file. Any idea what could be wrong?


----------



## cpm@ (Apr 23, 2013)

The configure is failing because /usr/local/lib/libintl.so is missing. 

Reinstall devel/gettext port. 

```
20130316:
  AFFECTS: users of converters/libiconv and devel/gettext
  AUTHOR: bapt@FreeBSD.org

  libiconv now handles the lib/charset.alias file instead of devel/gettext.
  If you are using pkgng 'and' upgrading from source with portupgrade or
  portmaster, first delete gettext, upgrade libiconv, then reinstall gettext.

  # pkg delete -f devel/gettext
  # portmaster converters/libiconv devel/gettext
    or
  # pkg delete -f devel/gettext
  # portupgrade converters/libiconv devel/gettext
```


----------



## wblock@ (Apr 23, 2013)

littlesandra88 said:
			
		

> @wblock@, you mean `portmaster -a`



No.  portmaster(8) means "the portmaster man page, section 8."  There is a procedure at the end for rebuilding all ports.

This requires updating the ports tree.  It appears yours is still an old version.  Before continuing, please see the ports section of the Handbook.

I also have a short article on updating ports, Upgrading FreeBSD Ports.


----------



## littlesandra88 (Apr 24, 2013)

@wblock@ and @cpu82

Ahhh. I see. Now it works =)


----------



## cpm@ (Apr 24, 2013)

littlesandra88 said:
			
		

> @wblock@ and @cpu82
> 
> Ahhh. I see. Now it works =)



Ta-Daaa! Case closed :e

PS. Almost closed...


----------



## littlesandra88 (Apr 25, 2013)

Almost =) When I had to reproduce the same on another host, I forgot to select SSL support when compiling NRPE.

According to this, I should be able to reconfigure NRPE by

`cd /usr/ports/net-mgmt/nrpe2 && make install clean`

but I don't get the GUI. It just recompiles.

How can I get to the configuration menu at this point and then compile?


----------



## littlesandra88 (Apr 25, 2013)

Nevermind =)

`make rmconfig`


----------



## wblock@ (Apr 25, 2013)

Or just `make config`.  Otherwise, the options screens are only shown if options have not been set before or have changed in the latest version of the port.


----------

