OpenNMS port for FreeBSD

The port is for the current stable version, v1.6.2. It is in its very early stages, there are still some issues which need to be ironed out:

* The port will install just fine except that it complains about some files listed in the pkg-plist which are not there, well they are there but the files named are dynamically generated everytime a build is attempted (jetty-webapps & webapps cache files) so this will need to be fixed.

* As there are issues with these filenames in the pkg-plist, make package fails.

* A problems with the jicmp dependency, it fails to detect that jicmp is installed & attempts to build & install it no-matter what & obviously fails if it is.

All previous issues with the port listed above have been resolved, the port now just needs to be tested before submission for inclusion in ports.

You can grab the port here

11/5/09
Port updated to version 1.6.4, use the link above to fetch a new copy of the port.
There is an issue with the packing list as it currently doesn’t take into account new files that are created from things such as availability reports, which means when you come to remove the package some files are left behind as well as empty directories, this will be solved in the next revision when I’ll separate out the location the data resides from the binary & config files.

17/5/09
Port updated to version 1.6.5, again use the link above to fetch a new copy of the port.
The issue with the packing list still existed in this version.

3/8/09
Updated the packing list so that it now includes some files which I missed before.
There are issues with the packing list which still need to be resolved.

5/1/10
Updated the port to 1.6.8, if you have a previous version of the port installed, backup your opennms directory before doing the upgrade as files will be removed.
I have a been working on separating the config files, logs & rrd data from the libraries & binaries etc, the OpenNMS build mechanism has support for this, allowing one to pass -Dinstall.etc.dir=/confdir/opennms-data/etc -Dopennms.home=/opt/opennms -Dinstall.logs.dir=/var/log to build.sh
Unfortunately the source code doesn’t, there are 2 major hurdles which need be passed before this will work correctly
1) some files ignore some of the variables passed to build.sh, most important one being install.etc.dir, see bug report
2) source files are hardcoded to look for files/directories under $opennms.home eg the etc directory.
I have a whole bunch of diffs which I need to go over again as I’ve hit a wall, I would’ve included the patches with this update but, all the diffs manage to do is break things, so I removed them from this version.
The port now use openjdk as it doesn’t suffer from the SIGSEGV issue experienced by some, including myself, a workaround if you want to remain with diablo or sunjdk is to disable IPv6 support in the JDK. You will also need to remove the if condition from the OpenNMS port Makefile aswell.
I’ve also created a seperate port for iplike here

18/3/10
Thanks to David Okeby for updating the port to version 1.6.9 & sharing a link in the comments section below, I’ve mirrored a copy of the port on this site & updated the download link, the original had resource files inside which I’ve removed.

6/4/10
Updated to version 1.6.10, as mentioned before, backup your opennms directory before upgrading to prevent data loss.

9/6/10
Update to version 1.8.0, the port now requires openjdk 1.6 to run

Tags: , ,

30 Responses to “OpenNMS port for FreeBSD”

  1. Hey,

    I just saw this on the twitter log, I am so sorry I did not reply earlier.
    We all thank you so much! Would you mind describing this on this OpenNMS wiki?
    And if we collaborate, we may just make a final ports?

  2. Tested this on FreeBSD 7.1/i386 and it works great, plan on doing the same on FreeBSD 7.1/amd64. One problem though, after installing OpenNMS I had to edit the runjava file with some help from #OpenNMS on Freenode, to change the “egrep ‘^Sun Java\(TM\)’” bits to: “egrep ‘^(Diablo )Sun Java\(TM\)’” … after that, all was good. Now up and monitoring like a trooper.

  3. Venture37 says:

    Jeremy, yes, I spoke to Ben, who’s one of the OpenNMS developers yesterday as I saw that it was announced that support for Diablo JDK was added, I’ve included a patch to solve this in the copy of the port I have stored locally, I just haven’t made it public yet.

  4. Nicola says:

    I upgrade an existing 1.5.92 installation withe the new port. I use rrdtool 1.3 and change the Makefile accordingly.
    Everything works fine. Thanks for your work !!! Now it is less pain to install opennms on FreeBSD.

  5. pilot513 says:

    I’m try run this port (opennms-162-freebsd-port.tgz) on 7.0-RELEASE-p2 FreeBSD 7.0-RELEASE-p2 with jdk-1.6.0.3p4_7 port installed.
    All build & install successful. But when i run, i get follow error:
    [DEBUG] System property ‘opennms.library.jicmp’ set to ‘/usr/local/lib/libjicmp.so. Attempting to load jicmp library from this location.
    [INFO] Successfully loaded jicmp library.
    07.05.2009 20:27:33 java.util.prefs.FileSystemPreferences$2 run
    INFO: Created user preferences directory.
    An error occurred while attempting to start the “OpenNMS:Name=Trapd” service (class org.opennms.netmgt.trapd.jmx.Trapd). Shutting down and exiting.
    If can, mail me (for help). Also, i’m try build & run on 7.1/7.2 RELEASE

  6. Venture37 says:

    please make sure the hostname that your system is configured with is resolvable either via dns or locally via /etc/hosts

  7. jeffg says:

    @pilot513 you probably have a trap daemon (perhaps from a Net-SNMP package) bound to port 162. Stop it and you should be good.

  8. Erik says:

    I’ve been building this on 6.4, and it’s been sitting at this screen for 3 hours:
    [INFO] Scanning for projects…

    This box has two quad core processors – I’ve NEVER seen a compile take this long on this machine….

    I hope this EVENTUALLY finishes

    I can’t believe the sad state of f/oss NMS projects – every single one of them is shit, I might need to break down and buy or write something to do this…sigh…

    Also, who the hell uses java for anything?!

  9. Venture37 says:

    Erik, I’ve gone from a fresh install of 6.4 i386 on a vm with a single core allocated to running OpenNMS 1.6.5 in under 45mins. Are you using the 1.6.5 port?
    http://www.geeklan.co.uk/files/opennms/opennms-165-freebsd-port.tgz

  10. Tom says:

    I just tried to install opennms on FreeBSD 7.2-RELEASE

    # cd /usr/local/ports/net-mgnt/opennms/
    baal2# make
    ===> Building for opennms-1.6.5
    cd /usr/local/ports/net-mgnt/opennms/work/opennms-1.6.5-1/source && /usr/bin/env JAVA_HOME=/usr/local/diablo-jdk1.6.0 WRKSRC=/usr/local/ports/net-mgnt/opennms/work/opennms-1.6.5-1/source MAVEN_OPTS=”-Xmx1024m -XX:PermSize=384m” ./build.sh -Dorg.apache.maven.global-settings=/usr/local/ports/net-mgnt/opennms/work/opennms-1.6.5-1/source/maven/conf/settings.xml -Dopennms.home=/usr/local/opennms install assembly:attached
    Error occurred during initialization of VM
    Could not reserve enough space for object heap
    #
    # An unexpected error has been detected by Java Runtime Environment:
    #
    # SIGSEGV (0xb) at pc=0x281064fc, pid=77877, tid=0×28201150
    #
    # Java VM: Diablo Java HotSpot(TM) Client VM (10.0-b23 mixed mode bsd-x86)
    # Problematic frame:
    # C [libc.so.7+0x644fc] free+0x4c
    #
    # An error report file with more information is saved as:
    # /usr/local/ports/net-mgnt/opennms/work/opennms-1.6.5-1/source/hs_err_pid77877.log
    #
    # Please submit bug reports to freebsd-java@FreeBSD.org
    #
    Abort trap (core dumped)
    *** Error code 134

    Stop in /usr/local/ports/net-mgnt/opennms.

    the following starts building …
    # cd /usr/local/ports/net-mgnt/opennms/work/opennms-1.6.5-1/source
    # setenv JAVA_HOME /usr/local/diablo-jdk1.6.0
    # setenv WRKSRC /usr/local/ports/net-mgnt/opennms/work/opennms-1.6.5-1
    # setenv MAVEN_OPTS “-Xmx512m -XX:PermSize=384m”
    # ./build.sh -Dorg.apache.maven.global-settings=/usr/local/ports/net-mgnt/opennms/work/opennms-1.6.5-1/source/maven/conf/settings.xml -Dopennms.home=/usr/local/opennms install assembly:attached

    do you realy need 1GB RAM for building?

  11. Tom says:

    Error while building:

    Downloading: http://repo.opennms.org/maven2/xerces/xerces/1.4.0/xerces-1.4.0.pom
    Downloading: http://repository.codehaus.org/xerces/xerces/1.4.0/xerces-1.4.0.pom
    Downloading: http://repo.opennms.org/maven2/xerces/xerces/1.4.0/xerces-1.4.0.pom
    Downloading: http://repo.opennms.org/releases/xerces/xerces/1.4.0/xerces-1.4.0.pom
    Downloading: https://maven-repository.dev.java.net/nonav/repository/xerces/poms/xerces-1.4.0.pom
    Downloading: https://maven2-repository.dev.java.net/nonav/repository/xerces/xerces/1.4.0/xerces-1.4.0.pom
    358b downloaded
    [WARNING] *** CHECKSUM FAILED – Checksum failed on download: local = ’49b895cf11575746cdeb309e310b1de4e465219b’; remote = ‘<!DOCTYPE’ – RETRYING
    Downloading: https://maven2-repository.dev.java.net/nonav/repository/xerces/xerces/1.4.0/xerces-1.4.0.pom
    358b downloaded
    [WARNING] *** CHECKSUM FAILED – Checksum failed on download: local = ’49b895cf11575746cdeb309e310b1de4e465219b’; remote = ‘<!DOCTYPE’ – IGNORING
    [WARNING] POM for ‘xerces:xerces:pom:1.4.0:runtime’ is invalid. It will be ignored for artifact resolution. Reason: Not a v4.0.0 POM. for project xerces:xerces at /usr/local/apache/m2/repository/xerces/xerces/1.4.0/xerces-1.4.0.pom
    [WARNING] POM for ‘xerces:xerces:pom:1.4.0:runtime’ is invalid. It will be ignored for artifact resolution. Reason: Not a v4.0.0 POM. for project xerces:xerces at /usr/local/apache/m2/repository/xerces/xerces/1.4.0/xerces-1.4.0.pom
    [WARNING] POM for ‘commons-logging:commons-logging:pom:1.1:runtime’ is invalid. It will be ignored for artifact resolution. Reason: Not a v4.0.0 POM. for project commons-logging:commons-logging at /usr/local/apache/m2/repository/commons-logging/commons-logging/1.1/commons-logging-1.1.pom
    [WARNING] POM for ‘commons-logging:commons-logging:pom:1.1:runtime’ is invalid. It will be ignored for artifact resolution. Reason: Not a v4.0.0 POM. for project commons-logging:commons-logging at /usr/local/apache/m2/repository/commons-logging/commons-logging/1.1/commons-logging-1.1.pom
    Downloading: http://repo.opennms.org/maven2/xerces/xerces/1.4.0/xerces-1.4.0.jar
    Downloading: http://repository.codehaus.org/xerces/xerces/1.4.0/xerces-1.4.0.jar
    Downloading: http://repo.opennms.org/maven2/xerces/xerces/1.4.0/xerces-1.4.0.jar
    Downloading: http://repo.opennms.org/releases/xerces/xerces/1.4.0/xerces-1.4.0.jar
    Downloading: https://maven-repository.dev.java.net/nonav/repository/xerces/jars/xerces-1.4.0.jar
    Downloading: https://maven2-repository.dev.java.net/nonav/repository/xerces/xerces/1.4.0/xerces-1.4.0.jar
    358b downloaded
    [WARNING] *** CHECKSUM FAILED – Checksum failed on download: local = ’835b110a340b6146d12b094ad58b461466fa8da6′; remote = ‘<!DOCTYPE’ – RETRYING
    Downloading: https://maven2-repository.dev.java.net/nonav/repository/xerces/xerces/1.4.0/xerces-1.4.0.jar
    358b downloaded
    [WARNING] *** CHECKSUM FAILED – Checksum failed on download: local = ’835b110a340b6146d12b094ad58b461466fa8da6′; remote = ‘<!DOCTYPE’ – IGNORING
    [INFO] [castor:generate {execution: default}]
    [INFO] Processing /usr/local/ports/net-mgnt/opennms/work/opennms-1.6.5-1/source/opennms-config/src/main/castor/nsclient-config.xsd
    [INFO] ————————————————————————
    [ERROR] BUILD ERROR
    [INFO] ————————————————————————
    [INFO] Castor execution failed

    Embedded error: An Exception occurred processing /usr/local/ports/net-mgnt/opennms/work/opennms-1.6.5-1/source/opennms-config/src/main/castor/nsclient-config.xsd
    Could not instantiate parser org.apache.xerces.parsers.SAXParser: java.lang.ClassNotFoundException: org.apache.xerces.parsers.SAXParser

  12. Michael Ratcliffe says:

    Is there a fix for this build problem … I have the same problem and have seen references elsewhere indicating that its due to some of the dependencies being used in Maven pointing to old URLs.

    Thanks

  13. Justin Chmiel says:

    http://mirrors.ibiblio.org/pub/mirrors/maven2/xerces/xerces/1.4.0/

    download the jar and pom and replace the ones that tried to download in the broken script.

    Then rerun “make install”.

  14. Thanos says:

    I confirm that manually replacing the files worked for me. I had to do that for:
    xerces/1.4.0/
    commons-logging/1.1/
    log4j/1.2.13

    I took them from http://mirrors.ibiblio.org/pub/mirrors/maven2/
    I’m following http://www.opennms.org/wiki/Building_On_FreeBSD6.1 but I’m doing it on FreeBSD 7.1

    Like Justin Chmiel said, just put both files in /usr/ports/net-mgmt/opennms/work/opennms-1.6.5-1/source/m2/repository/$PATH_TO_THE_GOOD_FOLDER.
    Make sure you get rid of the corrupted ones before.

  15. marcus says:

    Hi, just wanted to say keep up the good work. We are running FreeBSD 7.2 in all our servers and had a hard time using OpenNMS before, but you saved us a lot of work with job you have done. Thanks!

  16. pilot513 says:

    Hi. I’m try install opennms-165-freebsd-port-mk2.tgz, but i’m can’t locate source opennms-source-1.6.5-1.tar.gz anywhere. opennms-source-1.6.7-1.tar.gz available only. What can i do ?

  17. nti says:

    Wishlist for Santa Clause: It would be great if opennms becomes an official port!

  18. Greg McCroan says:

    I have a similar problem to the above. I am loading OpenNMS 1.6.5 on FreeBSD 8.0_Stable. I get an error when the “make install” gets to downloading the files for Maven. It basically cannot find the files needed from the urls in the install. I have verified that I can reach the urls but the directories do not match what the install is looking for. Can i manually download the files and place them in the repository folder? If so what would be the directory structure.

  19. Venture37 says:

    Updated the download link to point to the OpenNMS 1.6.8 FreeBSD port
    New port for iplike here

  20. Greg McCroan says:

    I am at my wits end! Been struggling with installing OpenNMS 1.6.8 port on an AMD64 server running a fresh install of FreeBSD 8.0. I started out with a baseline install of FREEBSD 8.0 installed from FreeBSD main FTP site. The Install of FreeBSD 8.0 ran flawlessly. When I started installing Opennms 1.6.8 port it ran through a full install with no problems. I did preinstall some java files in the distfiles directory. After install I looked at the installed packages and found that the following packages were not installed from the opennms1.6.8 port.
    postgresql8.2-server
    apache22
    jetty

    So I then installed these packages from ports. I also have noticed that after the opennms port install I have two java packages installed.

    diablo-jdk1.6.0
    jdk-1.6.0

    So my thought now is which one needs to be set as JAVA_HOME and which one did other packages use during the install.

    I also had to set parameters in my Kernel for shared memory resources to get postgresql to start. Keep getting too many client sessions already open.

    I have yet to get the initial Opennms webpage to open. When I go to http://localhost:8980 or http://192.168.2.103/8980 I get the following

    HTTP ERROR: 404
    NOT_FOUND
    RequestURI=/

    Powered by jetty://

    I can reach apaches test page from localhost or ip address configured. So here I am asking for help from anyone that could further push me in the right direction.

  21. Venture37 says:

    Hi Greg,
    you don’t need apache22 or jetty installed from ports, opennms does not use apache22 for starters so you don’t need to have it running.
    dont forget to add /opennms to the end of those urls, eg http://localhost:8980/opennms
    As for postgresql, yes you will need to tweak your kernel parameters, this is covered in the postgresql documentation.
    The reason you have multiple JDK’s installed is because diablo is listed as a dependency of jdk-1.6.0 & likewise for openjdk

  22. doke says:

    Thank’s for this – very useful.

    I’ve updated this port to 1.6.9. You can get the tgz here: http://dl.dropbox.com/u/470618/opennms-169-freebsd-port.tgz

  23. I made couple small changes:

    ———– distinfo ———————
    MD5 (opennms-source-1.6.10-1.tar.gz) = a2c1b92c40827e9f2b0296058e483ab4
    SHA256 (opennms-source-1.6.10-1.tar.gz) = 76a9a965af05d11e992a625e4f7a9afde08bf9e83ea2b546111c50ede6bc0b44
    SIZE (opennms-source-1.6.10-1.tar.gz) = 16426770

    ———– end distinfo —————–

    and changed the following lines in Makefile:

    PORTVERSION= 1.6.10
    MASTER_SITES= SF/opennms/OpenNMS-Source/stable-${PORTVERSION}

    thanks for the port.

  24. Venture37 says:

    Micheas, thanks for the help, there’s a little bit more involved to adding support for a new version though.

  25. Venture37 says:

    Updated the download link to point to the 1.6.10 port

  26. nti says:

    I’ve installed opennms 1.7.10 successfully with the port

    files/patch-maven-conf_settings.xml is obsolete

    Changed:

    Makefile:
    PORTVERSION= 1.7.10
    MASTER_SITES= SF/opennms/OpenNMS-Source/unstable-${PORTVERSION}

    files/patch-pom.xml:
    --- pom.xml.orig 2010-04-23 00:01:25.000000000 +0200
    +++ pom.xml 2010-04-23 00:13:27.000000000 +0200
    @@ -527,7 +527,7 @@
    <mock.leaveDatabaseOnFailure>false</mock.leaveDatabaseOnFailure>
    <mock.db.driver>org.postgresql.Driver</mock.db.driver>
    <mock.db.url>jdbc:postgresql://localhost:5432/</mock.db.url>
    - <mock.db.adminUser>postgres</mock.db.adminUser>
    + <mock.db.adminUser>pgsql</mock.db.adminUser>
    <mock.db.adminPassword/>
    <mock.runSnmpTests>false</mock.runSnmpTests>
    <mock.snmpHost>localhost</mock.snmpHost>
    @@ -557,7 +557,7 @@
    <install.database.name>opennms</install.database.name>
    <install.database.user>opennms</install.database.user>
    <install.database.password>opennms</install.database.password>
    - <install.database.admin.user>postgres</install.database.admin.user>
    + <install.database.admin.user>pgsql</install.database.admin.user>
    <install.database.admin.password/>
    <install.database.driver>org.postgresql.Driver</install.database.driver>
    <install.database.bindir>/usr/bin</install.database.bindir>

    “make install NO_CHECKSUM=YES”

  27. superhenne says:

    Hi,

    trying to upgrade 1.6.8 to 1.8.0 i get errors with maven, which i dont understand how to solve.

    Downloading: http://repo.opennms.org/maven2/org/apache/maven/plugins/maven-eclipse-plugin/2.5.1/maven-eclipse-plugin-2.5.1.pom
    [WARNING] Unable to get resource ‘org.apache.maven.plugins:maven-eclipse-plugin:pom:2.5.1′ from repository opennms-repo (http://repo.opennms.org/maven2): Invalid argument
    Downloading: http://repo1.maven.org/maven2/org/apache/maven/plugins/maven-eclipse-plugin/2.5.1/maven-eclipse-plugin-2.5.1.pom
    [WARNING] Unable to get resource ‘org.apache.maven.plugins:maven-eclipse-plugin:pom:2.5.1′ from repository central (http://repo1.maven.org/maven2): Invalid argument
    Downloading: http://repo1.maven.org/maven2/org/apache/maven/plugins/maven-eclipse-plugin/2.5.1/maven-eclipse-plugin-2.5.1.pom
    [WARNING] Unable to get resource ‘org.apache.maven.plugins:maven-eclipse-plugin:pom:2.5.1′ from repository central (http://repo1.maven.org/maven2): Invalid argument
    [INFO] ————————————————————————
    [ERROR] BUILD ERROR
    [INFO] ————————————————————————
    [INFO] Error building POM (may not be this project’s POM).

    Project ID: org.apache.maven.plugins:maven-eclipse-plugin

    Reason: POM ‘org.apache.maven.plugins:maven-eclipse-plugin’ not found in repository: Unable to download the artifact from any repository

    org.apache.maven.plugins:maven-eclipse-plugin:pom:2.5.1

    from the specified remote repositories:
    opennms-repo (http://repo.opennms.org/maven2),
    central (http://repo1.maven.org/maven2)

    for project org.apache.maven.plugins:maven-eclipse-plugin

  28. michael Ratcliffe says:

    I have the same problem … is there a fix/workaround?

    [INFO] OpenNMS Integration Tests
    Downloading: http://repo.opennms.org/maven2/org/apache/maven/plugins/maven-eclipse-plugin/2.5.1/maven-eclipse-plugin-2.5.1.pom
    [WARNING] Unable to get resource ‘org.apache.maven.plugins:maven-eclipse-plugin:pom:2.5.1′ from repository opennms-repo (http://repo.opennms.org/maven2): repo.opennms.org
    Downloading: http://repo1.maven.org/maven2/org/apache/maven/plugins/maven-eclipse-plugin/2.5.1/maven-eclipse-plugin-2.5.1.pom
    [WARNING] Unable to get resource ‘org.apache.maven.plugins:maven-eclipse-plugin:pom:2.5.1′ from repository central (http://repo1.maven.org/maven2): repo1.maven.org
    Downloading: http://repo1.maven.org/maven2/org/apache/maven/plugins/maven-eclipse-plugin/2.5.1/maven-eclipse-plugin-2.5.1.pom
    [WARNING] Unable to get resource ‘org.apache.maven.plugins:maven-eclipse-plugin:pom:2.5.1′ from repository central (http://repo1.maven.org/maven2): repo1.maven.org
    [INFO] ————————————————————————
    [ERROR] BUILD ERROR
    [INFO] ————————————————————————
    [INFO] Error building POM (may not be this project’s POM).

    Project ID: org.apache.maven.plugins:maven-eclipse-plugin

    Reason: POM ‘org.apache.maven.plugins:maven-eclipse-plugin’ not found in repository: Unable to download the artifact from any repository

    org.apache.maven.plugins:maven-eclipse-plugin:pom:2.5.1

    from the specified remote repositories:
    opennms-repo (http://repo.opennms.org/maven2),
    central (http://repo1.maven.org/maven2)

    for project org.apache.maven.plugins:maven-eclipse-plugin

Leave a Reply