cannot install netxms agent generic

Started by teddymills, March 31, 2011, 11:57:33 PM

Previous topic - Next topic

teddymills

https://www.netxms.org/download/

I see the AGENT PACKAGES Generic Unix.

They are in the .APKG format. I have no idea what format this is.
If I download the file, the first 100 lines are text, then the rest of the file is either encoded or gibberish.

Every distro I have used, Centos/RHEL/Fedora/Ubuntu/ has no idea how to use .APGK

How do I install these NETXMS Generic agents on Centos/Fedora/RHEL/Ubuntu?

TIA

Teddy




Victor Kirhenshtein

Hi!

APKG file is an installer script with embedded archive, which mostly intended for centralized agent upgrades. Generic UNIX package is a source package, and using it is equivalent to just get source .tar.gz archive, unpack it, and run

./configure --with-agent
make
make install

For Ubuntu you can use Debian packages (netxms-base_1.0.11_i386.deb and netxms-agent_1.0.11_i386.deb).
For CentOS/RHEL and others you have to compile agent from sources.

Best regards,
Victor

teddymills


Hi Victor,

I must be missing something very simple.

I am logged in as root
cd /root
wget https://www.netxms.org/download/agent_packages/nxagent-1.0.11.apkg

I have the file now.
I cannot tar -xvf, or gunzip...nothing works at this point.

Am I supposed to rename the file to nxagent.tar.gz?

Teddy




I

teddymills


I also
chmod 700 nxagent.apkg

./nxagent.apkg   <--that does not work well either...not sure how to uncompress this archive :)

Victor Kirhenshtein

Hi!

I see that this is a bit confusing... You should get netxms-1.0.11.tar.gz (common source package), unpack it, and run

./configure --with-agent
make
make install

Best regards,
Victor

teddymills

Okay making some progress..
Downloaded the entire source.tar.gz for netxms

gunzip netxms.tar.gz
tar -xvf netxms.tar

./configure --with-agent
make
make install

all that went fine without error.

How does one stop+start the agent?
Where is the agent configuration file?

Teddy

Victor Kirhenshtein

Default configuration file name is /etc/nxagentd.conf. There are configuration file example with comments in source package: contrib/nxagentd.conf-dist. You can copy it to /etc/nxagentd.conf and modify as needed, or use as reference. There are also startup scripts for various platforms under contrib/startup.

Best regards,
Victor

teddymills


Thanks Victor,

You have build an amazing network monitor.
Thanks for having the patience in dealing with us newbies.

I do have Cacti up and running,
but if I can get NetXMS running with agents, I believe it will be a far better network monitor than Cacti.
I think an agent is a better solution than using only SNMP.

I dont know if you have ever tangled with Cacti, but it has issues with polling+RRA/RRD graphs.

Teddy


testos

Hi Victor.

QuoteYou should get netxms-1.0.11.tar.gz (common source package), unpack it, and run

./configure --with-agent
make
make install

Best regards,
Victor

Compiling single agent on CentOS / RHEL systems requires install development tools (compiler, linker, etc.).
Due to corporate requirements sometimes this is not possible.
I think it's necessary to have a netxms-agent_1.1.3_i386.rpm packet for rapidly deploy agents without configure, compile and install steps.

Sometimes I dream with an .rpm package NetXMS agent. ;D


Best regards.

Victor Kirhenshtein

I agree that rpm packages are necessary, but unfortunately I'm not familiar with rpm creation, so it probably will take lot of time for me. And if somebody will make them, that will be great.

Best regards,
Victor

jdowney

Really would love to have the rpm too as we have a few SUSE servers that we want to get the agent installed on on asap. We don't have and don't plan to install development tools (compiler, linker, etc.).

Do you think we could get get Debian packages installed on SUSE? Or is there another way round this?

Cheers

JDowney

Victor Kirhenshtein

Hi!

I can package RedHat/CentOS (I have development CentOS machine and can build agent on it right now) agent binaries as simple .tar.gz expandable into /opt/netxms (or any other location). Most likely they will run on SUSE as well.

Best regards,
Victor

jdowney

#12
Would be brilliant if you could build it as a .tar.gz to try on SUSE. We have a couple of redhat boxes too might be tempted to try the agent on them too.

Cheers

JDowney

testos

#13
QuoteI agree that rpm packages are necessary, but unfortunately I'm not familiar with rpm creation, so it probably will take lot of time for me. And if somebody will make them, that will be great.

Best regards,
Victor


OK Victor, I give the hint ... ;)

I am trying to build a .rpm netxms agent package on a x86_64 machine unsuccessfully. To build a netxms agent package in a Centos/RHEL box we must take following steps:

1.- First all, we must install a minimal packages if not installed yet. The rpm-build package contains the scripts and executable programs that are used to build packages using the RPM Package Manager:
   # /usr/bin/yum -y install gcc* automake* autoconf* gnupg rpm-build

2.-  Create a new "dummy user" specifically for building rpm packages. That way, if something goes terribly wrong, the program or build process can't trash our files. At the very least, no one should build packages as root. Create a new unprivileged user is essential since building RPMs as root might damage our system. To create a new unprivileged user named "makerpm":
   # /usr/sbin/useradd makerpm

3.- Once we have logged in as the user who is creating packages, we must create the RPM building environment:
   # su makerpm
   # mkdir -p ~/rpmbuild/{BUILD,RPMS,SOURCES,SPECS,SRPMS}

4.- To build rpms, we need to have a .rpmmacros file in our home directory which configures our build tree location. We must create a "~/.rpmmacros" file:
Quote
cat <<'EOF' > ~/.rpmmacros
%_topdir %(echo $HOME)/rpmbuild
%debug_package %{nil}
%packager Ignacio Martín
%distribution NetXMS
%vendor www.netxms.org
%_tmppath %{_topdir}/tmp
%_builddir %{_tmppath}
%_rpmtopdir %{_topdir}
%_sourcedir %{_rpmtopdir}/SOURCES
%_specdir %{_rpmtopdir}
%_rpmdir %{_topdir}/RPMS
%_srcrpmdir %{_topdir}/SRPMS
%_rpmfilename %%{NAME}-%%{VERSION}-%%{RELEASE}.%%{ARCH}.rpm
EOF

5.- Now, we must download netxms sources in the "~/rpmbuild/SOURCES" directory.
   # cd  ~/rpmbuild/SOURCES/
   # wget https://www.netxms.org/download/netxms-1.1.5.tar.gz

6.- Create a ".spec" file in the "~/rpmbuild/SPECS" directory and call it "netxms-1.1.5.spec". At the heart of the rpm building process is the .spec file. It governs how a package is configured, what patches are applied, what files will be installed and where they'll be installed, and what system-level activity needs to take place before and after a package is installed. After a hard work I have created a complete .spec file which I attach it.

7.- Once we have create a spec file, say "netxms-1.1.5.spec", we must create source and binary RPMs by simply running these commands:
   # cd ~/rpmbuild/SPECS/
   # rpmbuild -ba netxms-1.1.5.spec


So far so good, but I get a permission error during make process because makerpm have not permission for move system x64 files:

Quotelibtool: install: warning: remember to run `libtool --finish /usr/lib64/netxms'
make  install-exec-hook
make[6]: Entering directory `/home/makerpm/rpmbuild/tmp/netxms-1.1.5/src/agent/subagents/portCheck'
if test "x`uname -s`" = "xAIX" ; then OBJECT_MODE= ar x /usr/lib64/netxms/portcheck.a /usr/lib64/netxms/portcheck.so ; rm -f /usr/lib64/netxms/portcheck.a ; fi
mv /usr/lib64/netxms/portcheck.so /usr/lib64/netxms/portcheck.nsm
mv: cannot move `/usr/lib64/netxms/portcheck.so' to `/usr/lib64/netxms/portcheck.nsm': Permission denied
make[6]: *** [install-exec-hook] Error 1

Always I've compiled my netxms agents as root so I never got this error, but when trying to compile it with a unprivileged user also I get permission denied in the same way.

Best regards.

testos

Hi again.

I've also tried an i386 machine and this is the result:
Quote
...
libtool: install: warning: remember to run `libtool --finish /usr/lib/netxms'
make  install-exec-hook
make[6]: se ingresa al directorio `/home/makerpm/rpmbuild/tmp/netxms-1.1.5/src/agent/subagents/portCheck'
if test "x`uname -s`" = "xAIX" ; then OBJECT_MODE= ar x /usr/lib/netxms/portcheck.a /usr/lib/netxms/portcheck.so ; rm -f /usr/lib/netxms/portcheck.a ; fi
mv /usr/lib/netxms/portcheck.so /usr/lib/netxms/portcheck.nsm
mv: can not be made `stat' in «/usr/lib/netxms/portcheck.so»: No such file or directory
make[6]: *** [install-exec-hook] Error 1
make[6]: se sale del directorio `/home/makerpm/rpmbuild/tmp/netxms-1.1.5/src/agent/subagents/portCheck'
make[5]: *** [install-exec-am] Error 2
make[5]: se sale del directorio `/home/makerpm/rpmbuild/tmp/netxms-1.1.5/src/agent/subagents/portCheck'
make[4]: *** [install-am] Error 2
make[4]: se sale del directorio `/home/makerpm/rpmbuild/tmp/netxms-1.1.5/src/agent/subagents/portCheck'
make[3]: *** [install-recursive] Error 1
make[3]: se sale del directorio `/home/makerpm/rpmbuild/tmp/netxms-1.1.5/src/agent/subagents'
make[2]: *** [install-recursive] Error 1
make[2]: se sale del directorio `/home/makerpm/rpmbuild/tmp/netxms-1.1.5/src/agent'
make[1]: *** [install-recursive] Error 1
make[1]: se sale del directorio `/home/makerpm/rpmbuild/tmp/netxms-1.1.5/src'
make: *** [install-recursive] Error 1


Best regards.