Installing on Solaris

From OpenNMS
Jump to navigation Jump to search
  • Description of installation on SunOS 5.9 (Solaris 9) on 64bit sparc system.
  • Solaris 10 user can use the pre-installed Postgres database. (see [1])

Prerequisites

general utilities

  • tested with gcc 3.4.6 installed in /usr/local
  • check your PATH - variable to contain
 /usr/local/bin for gcc
 /usr/ccs/bin for make
  • CAUTION: To avoid confusion with library paths etc. try to get the newest versions of all needed tools from http://www.sunfreeware.com. Almost all newer tools will install to /usr/local. Almost all problems described below were due to the mix of older and newer tools/librarys and vanished after updating those tools. If you already have older versions of the tools installed they may have been installed to different paths:
 /opt/sfw
 /opt/csw
 /usr/sfw
 /usr/local
  • check carefully messages from .configure to see if you included the appropriate paths and library paths! If some libraries are "elsewhere" you might try
 LD_LIBRARY_PATH=elswhere
 export LD_LIBRARY_PATH
  • download and unzip following tools from sun freeware:
 gcc
 java
 libiconv
 tar
 gzip
 bash
 libintl
 perl
 db
 readline
 zlib
 render
 xrender
 expat
 xft
 libpng
 libart_lgpl
 fontconfig
 freetype
  • install them with the following command for all downloaded files
 gunzip filename
 pkgadd -d filename

jicmp

  • download sources according to description in Jicmpto your installation-directory
  • cd to your installation-directory
  • run
./configure
./make
./make install
  • Libraries will be installed in /usr/local/lib
  • Program will be installed as /usr/local/share/java/jicmp.jar
  • if you get following error during make
In file included from /usr/include/string.h:18,
                from IcmpSocket.h:60,
                from IcmpSocket.c:55:
/usr/include/iso/string_iso.h:60: warning: conflicting types for built-in function `memcmp'
/usr/include/iso/string_iso.h:61: warning: conflicting types for built-in function `memcpy'
/usr/include/iso/string_iso.h:65: warning: conflicting types for built-in function `strcmp'
/usr/include/iso/string_iso.h:66: warning: conflicting types for built-in function `strcpy'
*** Error code 1
make: Fatal error: Command failed for target `IcmpSocket.lo'
Current working directory /usr/local/src/jicmp-1.0.7
*** Error code 1
make: Fatal error: Command failed for target `all'

try

CFLAGS=-fno-builtin ./configure
make
  • if you get errors during make like
In file included from IcmpSocket.c:56:
IcmpSocket.h:137:3: #error "not sure how to get an IP header struct on 
this platform!"
IcmpSocket.h:145:3: #error "not sure how to get an ICMP header struct on 
this platform!"

try

CFLAGS="-DHAVE_NETINET_IP_H -DHAVE_NETINET_IP_ICMP_H" ./configure
make

rrd

  • download rrd (and any required prerequisites) from http://www.sunfreeware.com to your installation-directory
  • cd to your installation-directory
  • REMARK: the compiled package didn't work for this configuration so rrd source code was installed, see below.
  • Installation of compiled package:
  • run
 gunzip filename.gz
 pkgadd -d filename
  • example: rrdtool-1.2.19-sol9-sparc-local.gz will install to /usr/local/rrdtool-1.2.19
  • this package didn't work together with jrrd, following error was generated when running configure for jrrd:
 checking for library containing rrd_create... no
 configure: error: cannot find rrd library with LDFLAGS = " -L/usr/local/rrdtool-1.2.19/lib"

Installation from source code:

  • download rrd source code(and any required prerequisites) from http://www.sunfreeware.com to your installation-directory
  • cd to your installation-directory
  • look where other prerequisited open source tools (like libfreetype) are installed in your system and change the path in the example below, here /usr/sfw was used
  • run
 LDFLAGS=-L/usr/sfw/lib CPPFLAGS=-I/usr/sfw/include ./configure
 make
  • if the make - job stops working with
 Making all in examples
 sed 's,@'exec_prefix@,/usr/local/rrdtool-1.2.19,' > cgi-demo.cgi

as last lines in output press CTRL-D (the job obviously tries to read from command line). cgi-demo will be empty...

 make install
  • example: rrdtool-1.2.19-sol9-sparc-local.gz will install to /usr/local/rrdtool-1.2.19

jRRD

  • download jrrd-1.0.1.tar.gz from http://sourceforge.net/project/showfiles.php?group_id=4141 to your installation-directory
  • cd to your installation-directory
  • replace the path to the rrdtool in the example below with the path to your rrdtool installation
  • replace the path to the java-jdk in the example below with the path to your java installation
  • run
gunzip -c jrrd-1.0.1.tar.gz | tar -xcf -
cd jrrd-1.0.1
./configure --with-rrd=/usr/local/rrdtool-1.2.19 --with-java=/usr/jdk/jdk1.5.0_15
make
make install
  • Libraries will be installed in /usr/local/lib
  • Program will be installed as /usr/local/share/java/jrrd.jar

PostgrSQL

 WARNING: at the moment (04/15/2008) postgresql-8.3.0 is available for download, but ist only supported in the latest nightly snapshots for opennms 1.6 (see bug http://bugzilla.opennms.org/show_bug.cgi?id=2277). So you may have to look for another way to get postgres 8.2
  • cd to your installation-directory
  • run
 gunzip postgresql-8.3.0-sol9-sparc-local.gz
 pkgadd -d postgresql-8.3.0-sol9-sparc-local
  • postgres should now be installed in /usr/local/pgsql
  • create start script /etc/init.d/postgres for start/stop of database
  • create link Snnpostgresql in /etc/rc3.d
  • make data directory according to your design
 mkdir /usr/local/pgsql/pgdata
 chown postgres /usr/local/pgsql/pgdata
  • initialize a new DB (target directory has to be empty!)
 /usr/local/pgsql/bin/initdb -D /usr/local/pgsql/pgdata
  • if you have problems starting postgres or any of it's tools with following error message:
 pg_ctl
 ld.so.1: pg_ctl: fatal: libgcc_s.so.1: open failed: No such file or directory
 Killed

then look for the path to this library libgcc_s.so.1 (comes with gcc compiler) and add the environment-variable (adjust the path to your needs)

 LD_LIBRARY_PATH=/usr/local/lib
 export LD_LIBRARY_PATH
  • read /documentation/InstallUnStable for configuring security etc.. The configuration files mentioned there should be in your data directory /usr/local/pgsql/pgdata after initializing the database with initdb as described above.

iplike

  • download iplike solaris package following the links for downloading opennms in Main_Pageto your installation-directory
  • cd to your installation-directory
  • run
 gunzip iplike-1.0.6-sol9-sparc-local.gz
 pkgadd -d iplike-1.0.6-sol9-sparc-local
  • iplike should now be installed in /usr/local/lib

opennms

  • download opennms[-snapshot]-version.zip to a temporarily directory.
  • after download cd to this temporarily directory.
  • run
 /usr/bin/unzip temp-directory/opennms[-snapshot]-version.zip 
  • this will create a new directory "opennms-installer"

login to your Solaris desktop environment or export your DISPLAY to a computer, this is needed because the installer now has a GUI.

  • open a commandprompt/terminalwindow
  • run
 temp-directory/opennms-installer/java -jar standalone-opennms-installer-*version*-*date*.jar

to start setup. (make sure you know your postgres passwords)

  • follow the directives in the installer, install OpenNMS on a slice where you have and will have enough room. /opt/OpenNMS is prefered.
  • now you should be able to start opennms
 /opt/OpenNMS/bin/opennms start
  • (you can get great benefit from starting OpenNMS with LD_PRELOAD_64=libumem.so ./bin/opennms start
  • If you installed OpenNMS as a Solaris package and are using svcadm to start and stop it you may run into a problem where it fails to start when you have a reasonable number of nodes in the database. This can be caused by it failing to completely start in within the default 5 minutes. To overcome this you will need to increase this value.
 svccfg -s opennms
   setprop start/timeout_seconds = 600
   listprop
   exit
 svcadm refresh opennms

Performance tips

  • Start OpenNMS with the following command: LD_PRELOAD_64=libumem.so ./bin/opennms start, this will preload the 64 bit environment.
  • if you installed OpenNMS on a slice like /opt you can have great benefits from altering the read/write buffering on this slice. Open /etc/vfstab and modify the slice accordingly: [example]

/dev/dsk/c1d0s5 /dev/rdsk/c1d0s5 /opt ufs 2 yes noatime,forcedirectio.

The settings noatime and forcedirectio will reduce the waitingtime for rrd to write his files. In my case the diskusage dropped from a steady 100% to 10% after setting these options on /opt and rebooting the system.

Running as a non-root user

On Solaris 10, it's possible to run OpenNMS as a non-root user, but it will be necessary to grant a couple of special permissions to the OpenNMS user:

Binding to udp/162 for Trapd

The permission needed for the OpenNMS trap receiver (Trapd) to bind to the standard snmp-trap port of udp/162 is:

net_privaddr

If this permission is missing, OpenNMS will fail to start up and you will get an exception trace like the following in output.log:

Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'daemon' defined in class path resource [META-INF/opennms/applicationContext-trapDaemon.xml]: Invocation of init method failed; nested exception is java.lang.reflect.UndeclaredThrowableException
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1420)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
	at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:291)
	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:288)
	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:190)
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:580)
	at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:895)
	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:425)
	at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:139)
	at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:105)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
	at java.lang.reflect.Constructor.newInstance(Unknown Source)
	at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:126)
	... 38 more
Caused by: java.lang.reflect.UndeclaredThrowableException
	at org.opennms.netmgt.trapd.Trapd.onInit(Trapd.java:188)
	at org.opennms.netmgt.daemon.AbstractServiceDaemon.init(AbstractServiceDaemon.java:356)
	at org.opennms.netmgt.daemon.AbstractServiceDaemon.afterPropertiesSet(AbstractServiceDaemon.java:58)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1477)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1417)
	... 54 more
Caused by: java.net.BindException: Permission denied
	at java.net.PlainDatagramSocketImpl.bind0(Native Method)
	at java.net.PlainDatagramSocketImpl.bind(Unknown Source)
	at java.net.DatagramSocket.bind(Unknown Source)
	at java.net.DatagramSocket.<init>(Unknown Source)
	at java.net.DatagramSocket.<init>(Unknown Source)
	at org.snmp4j.transport.DefaultUdpTransportMapping.<init>(DefaultUdpTransportMapping.java:99)
	at org.opennms.netmgt.snmp.snmp4j.Snmp4JStrategy.registerForTraps(Snmp4JStrategy.java:446)
	at org.opennms.netmgt.snmp.SnmpUtils.registerForTraps(SnmpUtils.java:165)
	at org.opennms.netmgt.trapd.Trapd.onInit(Trapd.java:177)
	... 58 more

Creating ICMP datagrams

OpenNMS normally does quite a bit of pinging, which requires another privilege on Solaris 10 in order to create raw ICMP datagrams:

net_icmpaccess

Without this privilege, OpenNMS may start up but it will be unable to perform any ping operations.