VMware Cloud Community
ajripa
Contributor
Contributor

How to install agent on FreeBSD 7.0

I am trying to install hq-agent on FreeBSD but when I start the agent I get this error:

ELF binary type "0" not known.
jre/bin/java: 1: Syntax error: "(" unexpected

I have installed diablo-jre-1.5.0.07.01_9 as Java Runtime Enviroment.
0 Kudos
3 Replies
dougm_hyperic
VMware Employee
VMware Employee

Looks like the agent is using ./jre/bin/java (the linux binary?) you'd need to use the noJRE agent bundle or:
export HQ_JAVA_HOME=/.../diablo-jre-1.5.0.07.01_9

However, FreeBSD has broken binary compatibility in each major 4,5,6 release, we have yet to add a libsigar binary for 7. You could give this a try:

cp pdk/lib/libsigar-x86-freebsd-6.so pdk/lib/libsigar-x86-freebsd-7.so

Or, build sigar from source:
http://support.hyperic.com/confluence/display/SIGAR/Home#Home-building

We do have plan to include the binary with future releases, ideally I'd like to get the lib into ports so we don't have to build+ship all the FreeBSD binaries 🙂
0 Kudos
brian_mcdonald
Contributor
Contributor

You can do the cp (or just symlink it) but you need to make sure you have the compat6x package installed for the SIGAR library and compat4x package installed for the wrapper. Just tried it on one of our FreeBSD 7.1 boxes, and the agent starts with the wrapper now. I'm using the noJRE 4.0.3 agent with a JAVA_HOME of /usr/local/jdk1.5.0.

That said - some of the data coming out of SIGAR doesn't look quite right. The "test" command from the shell gives 3 errors:
TestCpu.testCreate.........................FAILED
TestTcpStat.testCreate.....................ERROR
TestProcEnv.testCreate.....................ERROR

1) org.hyperic.sigar.test.TestTcpStat:
org.hyperic.sigar.SigarException: Cannot allocate memory
at org.hyperic.sigar.Tcp.gather(Native Method)
...
2) org.hyperic.sigar.test.TestProcEnv:
org.hyperic.sigar.SigarFileNotFoundException: No such file or directory
at org.hyperic.sigar.ProcEnv.getAll(Native Method)
...
1) org.hyperic.sigar.test.TestCpu:
junit.framework.AssertionFailedError
at org.hyperic.sigar.test.TestCpu.checkCpu(TestCpu.java:56)
...
0 Kudos
dougm_hyperic
VMware Employee
VMware Employee

Hi Brian,

There are some sigar-1.6 binaries build on FreeBSD-7.x available at http://hudson.hyperic.com/ that are not included in the HQ distro.
I think the best long term solution would be to create a FreeBSD port for sigar.
Similar for NetBSD and OpenBSD, haven't finished porting to DragonFly BSD yet tho 🙂
0 Kudos