NCPA 2.3.1 Agent Fails Install on Solaris Server

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
J.A.K
Posts: 103
Joined: Wed Aug 05, 2020 11:39 am

NCPA 2.3.1 Agent Fails Install on Solaris Server

Post by J.A.K »

Not really an XI specific issue, but couldn't see any forum for just the NCPA plugin. Using the newly released agent on Solaris we get install errors:

[0]fjus166:Packages/NAGIOS> sudo pkgadd -d ncpa-2.3.1.sol10.sparc.pkg
Password:

The following packages are available:
1 ncpa A monitoring agent (Nagios Cross-Platform Agent) for Nagios.
(sun4) Dev Release 02/12/2021

Select package(s) you wish to process (or 'all' to process
all packages). (default: all) [?,??,q]: y
ERROR: Entry does not match available menu selection. Enter the number
of the menu item you wish to select, or the token which is associated
with the menu item, or a partial string which uniquely identifies the
token for the menu item. Enter ?? to reprint the menu.

Select package(s) you wish to process (or 'all' to process
all packages). (default: all) [?,??,q]: y
ERROR: Entry does not match available menu selection. Enter the number
of the menu item you wish to select, or the token which is associated
with the menu item, or a partial string which uniquely identifies the
token for the menu item. Enter ?? to reprint the menu.

Select package(s) you wish to process (or 'all' to process
all packages). (default: all) [?,??,q]: all

Processing package instance <ncpa> from </jmp00p10/jumpstart/Packages/NAGIOS/ncpa-2.3.1.sol10.sparc.pkg>

A monitoring agent (Nagios Cross-Platform Agent) for Nagios.(sun4) Dev Release 02/12/2021

This appears to be an attempt to install the same architecture and
version of a package which is already installed. This installation
will attempt to overwrite this package.

Using </usr/local> as the package base directory.
## Processing package information.
## Processing system information.
160 package pathnames are already properly installed.
## Verifying disk space requirements.
## Checking for conflicts with packages already installed.
## Checking for setuid/setgid programs.

This package contains scripts which will be executed with super-user
permission during the process of installing this package.

Do you want to continue with the installation of <ncpa> [y,n,?] y

Installing A monitoring agent (Nagios Cross-Platform Agent) for Nagios. as <ncpa>

## Executing preinstall script.
/var/sadm/pkg/ncpa/install/preinstall: !: not found
/var/sadm/pkg/ncpa/install/preinstall: !: not found
## Installing part 1 of 1.
pkgadd: ERROR: unable to create package object </usr/local/ncpa/etc>.
group name <nagios> not found in group table(s)
owner name <nagios> not found in passwd table(s)
/usr/local/ncpa/etc <attribute change only>
/usr/local/ncpa/etc/ncpa.cfg <attribute change only>
pkgadd: ERROR: unable to create package object </usr/local/ncpa/etc/ncpa.cfg.d>.
group name <nagios> not found in group table(s)
owner name <nagios> not found in passwd table(s)
/usr/local/ncpa/etc/ncpa.cfg.d <attribute change only>
/usr/local/ncpa/etc/ncpa.cfg.d/README.txt <attribute change only>
/usr/local/ncpa/etc/ncpa.cfg.d/example.cfg <attribute change only>
/usr/local/ncpa/etc/ncpa.cfg.sample <attribute change only>
/usr/local/ncpa/ncpa_listener.xml
/usr/local/ncpa/ncpa_passive.xml
pkgadd: ERROR: unable to create package object </usr/local/ncpa/var>.
group name <nagios> not found in group table(s)
owner name <nagios> not found in passwd table(s)
/usr/local/ncpa/var <attribute change only>
[ verifying class <none> ]
ERROR: attribute verification of </usr/local/ncpa/etc> failed
group name <nagios> not found in group table(s)
owner name <nagios> not found in passwd table(s)
ERROR: attribute verification of </usr/local/ncpa/etc/ncpa.cfg> failed
group name <nagios> not found in group table(s)
owner name <nagios> not found in passwd table(s)
ERROR: attribute verification of </usr/local/ncpa/etc/ncpa.cfg.d> failed
group name <nagios> not found in group table(s)
owner name <nagios> not found in passwd table(s)
ERROR: attribute verification of </usr/local/ncpa/etc/ncpa.cfg.d/README.txt> failed
group name <nagios> not found in group table(s)
owner name <nagios> not found in passwd table(s)
ERROR: attribute verification of </usr/local/ncpa/etc/ncpa.cfg.d/example.cfg> failed
group name <nagios> not found in group table(s)
owner name <nagios> not found in passwd table(s)
ERROR: attribute verification of </usr/local/ncpa/etc/ncpa.cfg.sample> failed
group name <nagios> not found in group table(s)
owner name <nagios> not found in passwd table(s)
ERROR: attribute verification of </usr/local/ncpa/var> failed
group name <nagios> not found in group table(s)
owner name <nagios> not found in passwd table(s)
## Executing postinstall script.

Installation of <ncpa> partially failed.


Seems like the /var/sadm/pkg/ncpa/install/preinstall script does not exists and that is what is used to create owner and groups for the install?
dchurch
Posts: 858
Joined: Wed Oct 07, 2020 12:46 pm
Location: Yo mama

Re: NCPA 2.3.1 Agent Fails Install on Solaris Server

Post by dchurch »

J.A.K wrote:Not really an XI specific issue, but couldn't see any forum for just the NCPA plugin.
The usual place for submitting issues with the NCPA agent is at its GitHub project, under "Issues". In addition to this forum post, I'd suggest making an issue there if it turns out to be a bug.

I can help diagnose the issue to determine if this is in fact a bug.

Questions:
  • What version of Solaris are you installing this on?
  • What's the output from

    Code: Select all

    ls -la /bin/sh
    sh --version
From my investigations, it looks like all the "preinstall" script is supposed to do is add the group nagios, then add the user nagios with its primary group being nagios:

Code: Select all

# Add nagios user/group if it doesn't exist
if ! getent group nagios > /dev/null; then
    groupadd nagios
fi
if ! getent passwd nagios > /dev/null; then
    useradd -g nagios nagios
fi
Unfortunately it's erring out likely due to a syntax error:

Code: Select all

## Executing preinstall script.
/var/sadm/pkg/ncpa/install/preinstall: !: not found
/var/sadm/pkg/ncpa/install/preinstall: !: not found
If you didn't get an 8% raise over the course of the pandemic, you took a pay cut.

Discussion of wages is protected speech under the National Labor Relations Act, and no employer can tell you you can't disclose your pay with your fellow employees.
J.A.K
Posts: 103
Joined: Wed Aug 05, 2020 11:39 am

Re: NCPA 2.3.1 Agent Fails Install on Solaris Server

Post by J.A.K »

Thank you I went ahead and made a post there although it doesn't look like issues get answered very often on the repo. I'll try to get that information for you tomorrow. I verified when installing the package the preinstall script is not being added by the package but weirdly /var/sadm/pkg/ncpa/install/postinstall DOES exist.
J.A.K
Posts: 103
Joined: Wed Aug 05, 2020 11:39 am

Re: NCPA 2.3.1 Agent Fails Install on Solaris Server

Post by J.A.K »

ls -al /bin/sh
lrwxrwxrwx 1 root root 13 Dec 13 2017 /bin/sh -> ../../sbin/sh*

/bin/sh --version
$

Version command came back empty, but we're on Solaris 10. SunOS 5.10 Generic_153153-01 sun4u sparc SUNW,SPARC-Enterprise
dchurch
Posts: 858
Joined: Wed Oct 07, 2020 12:46 pm
Location: Yo mama

Re: NCPA 2.3.1 Agent Fails Install on Solaris Server

Post by dchurch »

The empty "--version" query makes me think this is busybox.

What's the output from the following commands?

Code: Select all

realpath /bin/sh
readlink -f /bin/sh
uname -a
uname -v
uname -m
If you didn't get an 8% raise over the course of the pandemic, you took a pay cut.

Discussion of wages is protected speech under the National Labor Relations Act, and no employer can tell you you can't disclose your pay with your fellow employees.
J.A.K
Posts: 103
Joined: Wed Aug 05, 2020 11:39 am

Re: NCPA 2.3.1 Agent Fails Install on Solaris Server

Post by J.A.K »

It looks like this may have been an error on our server team. According to them "There was a "nagios" entry in /etc/user_attr". I believe from a previous install of NPRE from Nagios Core. After removing that entry it installed correctly. Sorry for the confusion.
dchurch
Posts: 858
Joined: Wed Oct 07, 2020 12:46 pm
Location: Yo mama

Re: NCPA 2.3.1 Agent Fails Install on Solaris Server

Post by dchurch »

Glad to hear you were able to install it properly. :-) If you have any more issues, feel free to start a new topic on the forums.
If you didn't get an 8% raise over the course of the pandemic, you took a pay cut.

Discussion of wages is protected speech under the National Labor Relations Act, and no employer can tell you you can't disclose your pay with your fellow employees.
Locked