VMware Cloud Community
treyhyde
Contributor
Contributor

Issues getting agents working on FreeBSD 8 (amd64)

No wrappers are provided for FreeBSD amd64 so I thought I'd follow the advice given on many google results and use the nowrapper.sh script ....

hyperic-hq-agent-4.3.0/bundles/agent-4.3.0-1443# ./bin/hq-agent-nowrapper.sh start
Starting agent
Exception in thread "main" java.lang.UnsatisfiedLinkError: org.hyperic.sigar.FileAttrs.gather(Lorg/hyperic/sigar/Sigar;Ljava/lang/String;)V
at org.hyperic.sigar.FileAttrs.gather(Native Method)
at org.hyperic.sigar.FileInfo.fetchInfo(FileInfo.java:432)
at org.hyperic.sigar.FileInfo.fetchFileInfo(FileInfo.java:452)
at org.hyperic.sigar.Sigar.getFileInfo(Sigar.java:731)
at org.hyperic.sigar.FileWatcher.add(FileWatcher.java:63)
at org.hyperic.sigar.FileWatcher.add(FileWatcher.java:58)
at org.hyperic.hq.bizapp.agent.client.AgentClient$2.<init>(AgentClient.java:1133)
at org.hyperic.hq.bizapp.agent.client.AgentClient.initializeAgent(AgentClient.java:1128)
at org.hyperic.hq.bizapp.agent.client.AgentClient.main(AgentClient.java:1242)


So it's probably having trouble finding libsigar or similar. I tried installing the sigar FreeBSD port but that didn't help. I haven't worked much with JNI so not sure what the best way of going about debugging these sorts of library issues are.

On Hyperic 4.2 it just exited without providing any useful info at all

hyperic-hq-agent-4.2.0.7/bundles/agent-4.2.0.7-1285]# ./bin/hq-agent-nowrapper.sh start
Starting agent
- Invoking agent
- Agent thread running
- Verifying if agent is running...

hyperic-hq-agent-4.2.0.7/bundles/agent-4.2.0.7-1285]# /usr/local/openjdk6//bin/java -Xmx128m -Dsun.net.inetaddr.ttl=60 -Djava.net.preferIPv4Stack=true -Djava.security.auth.login.config=jaas.config -Dagent.install.home=../.. -Dagent.bundle.home=. -Djava.library.path=../../wrapper/lib -Dagent.propFile=../../conf/agent.properties -Dagent.logDir=../../log -Dagent.dataDir=../../data -cp :./lib/AgentClient.jar:./lib/AgentServer.jar:./lib/lather.jar:./pdk/lib/ant.jar:./pdk/lib/backport-util-concurrent-3.1.jar:./pdk/lib/com.springsource.com.sun.xml.bind-2.1.7.jar:./pdk/lib/com.springsource.javax.xml.bind-2.1.7.jar:./pdk/lib/commons-beanutils.jar:./pdk/lib/commons-codec-1.3.jar:./pdk/lib/commons-collections-3.2.jar:./pdk/lib/commons-httpclient-3.1.jar:./pdk/lib/commons-logging.jar:./pdk/lib/dnsjava-2.0.3.jar:./pdk/lib/getopt.jar:./pdk/lib/hq-product.jar:./pdk/lib/hyperic-util.jar:./pdk/lib/jakarta-oro-2.0.7.jar:./pdk/lib/jdom-1.1.jar:./pdk/lib/jsch-0.1.34.jar:./pdk/lib/json.jar:./pdk/lib/junit-3.8.jar:./pdk/lib/junit-4.4.jar:./pdk/lib/jxla.jar:./pdk/lib/log4j-1.2.14.jar:./pdk/lib/sigar.jar:./pdk/lib/snmp4j.jar:./pdk/lib/tomcat-jk.jar:./pdk/lib/ws-commons-util-1.0.2.jar:./pdk/lib/xalan.jar:./pdk/lib/xml-apis.jar:./pdk/lib/xmlrpc-client-3.1.jar:./pdk/lib/xmlrpc-common-3.1.jar:./pdk/lib/xpp3_min-1.1.4c.jar:./pdk/lib/xstream-1.3.1.jar:../../wrapper/lib/wrapper.jar org.hyperic.hq.bizapp.agent.client.AgentClient start
- Invoking agent
- Agent thread running
- Verifying if agent is running...
hyperic-hq-agent-4.2.0.7/bundles/agent-4.2.0.7-1285]# echo $?
255





Anyone have any suggestions?
0 Kudos
14 Replies
excowboy
Virtuoso
Virtuoso

Hi,

what files did you install ?
Did you download and install the library from the following URL ?
http://hudson.hyperic.com/view/sigar/job/sigar-1.6-amd64-freebsd-8.0/lastBuild/

Cheers,
Mirko
0 Kudos
excowboy
Virtuoso
Virtuoso

Hi,

I forgot to mention that you can invoke SIGAR standalone, e.g.

java -jar hyperic-hq-agent-4.2.0/bundles/agent-4.2.0-1260/pdk/lib/sigar.jar ls /var/log/syslog

On HQ 4.2 you can also run the following command, to run a couple of tests:

java -jar hyperic-hq-agent-4.2.0/bundles/agent-4.2.0-1260/pdk/lib/sigar.jar test


Mirko
0 Kudos
treyhyde
Contributor
Contributor

I installed sigar 1.6.3 out of the FreeBSD ports system.
0 Kudos
treyhyde
Contributor
Contributor

java -jar pdk/lib/sigar.jar ls /var/log/syslog
no libsigar-amd64-freebsd-8.so in java.library.path
org.hyperic.sigar.SigarException: no libsigar-amd64-freebsd-8.so in java.library.path
at org.hyperic.sigar.Sigar.loadLibrary(Sigar.java:174)
at org.hyperic.sigar.Sigar.<clinit>(Sigar.java:102)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:186)
at org.hyperic.sigar.SigarLoader.class$(SigarLoader.java:79)
at org.hyperic.sigar.SigarLoader.getLocation(SigarLoader.java:79)
at org.hyperic.sigar.cmd.Runner.main(Runner.java:161)
java.lang.UnsatisfiedLinkError: org.hyperic.sigar.util.Getline.isatty()Z
at org.hyperic.sigar.util.Getline.isatty(Native Method)
at org.hyperic.sigar.util.Getline.<clinit>(Getline.java:36)
at org.hyperic.sigar.shell.ShellBase.init(ShellBase.java:93)
at org.hyperic.sigar.cmd.Shell.main(Shell.java:212)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:616)
at org.hyperic.sigar.cmd.Runner.main(Runner.java:214)


So yes, confirmed, it's not finding sigar. I'll give the non-FreeBSD port package that you listed a try instead. FreeBSD ports does not generate the .so with that name.
0 Kudos
treyhyde
Contributor
Contributor

I installed libsigar from that link by putting the so in pdk/lib

$ ls -ltr pdk/lib/*freebsd*
-rw-r--r-- 1 arnulf wheel 211780 Aug 24 2009 pdk/lib/libsigar-amd64-freebsd-8.so
-rw-r--r-- 1 arnulf wheel 210641 May 17 16:32 pdk/lib/libsigar-amd64-freebsd-6.so
-rw-r--r-- 1 arnulf wheel 179751 May 17 16:32 pdk/lib/libsigar-x86-freebsd-5.so
-rw-r--r-- 1 arnulf wheel 179379 May 17 16:32 pdk/lib/libsigar-x86-freebsd-6.so

I still get

$ ./bin/hq-agent-nowrapper.sh start
Starting agent
Exception in thread "main" java.lang.UnsatisfiedLinkError: org.hyperic.sigar.FileAttrs.gather(Lorg/hyperic/sigar/Sigar;Ljava/lang/String;)V
at org.hyperic.sigar.FileAttrs.gather(Native Method)
at org.hyperic.sigar.FileInfo.fetchInfo(FileInfo.java:432)
at org.hyperic.sigar.FileInfo.fetchFileInfo(FileInfo.java:452)
at org.hyperic.sigar.Sigar.getFileInfo(Sigar.java:731)
at org.hyperic.sigar.FileWatcher.add(FileWatcher.java:63)
at org.hyperic.sigar.FileWatcher.add(FileWatcher.java:58)
at org.hyperic.hq.bizapp.agent.client.AgentClient$2.<init>(AgentClient.java:1133)
at org.hyperic.hq.bizapp.agent.client.AgentClient.initializeAgent(AgentClient.java:1128)
at org.hyperic.hq.bizapp.agent.client.AgentClient.main(AgentClient.java:1242)
0 Kudos
treyhyde
Contributor
Contributor

sigar.jar gave me a bit more info


> java -jar pdk/lib/sigar.jar
/usr/home/arnulf/hyperic-hq-agent-4.3.0/bundles/agent-4.3.0-1443/pdk/lib/libsigar-amd64-freebsd-8.so: Shared object "libkvm.so.4" not found, required by "libsigar-amd64-freebsd-8.so"
org.hyperic.sigar.SigarException: /usr/home/arnulf/hyperic-hq-agent-4.3.0/bundles/agent-4.3.0-1443/pdk/lib/libsigar-amd64-freebsd-8.so: Shared object "libkvm.so.4" not found, required by "libsigar-amd64-freebsd-8.so"
at org.hyperic.sigar.Sigar.loadLibrary(Sigar.java:174)
at org.hyperic.sigar.Sigar.<clinit>(Sigar.java:102)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:186)
at org.hyperic.sigar.SigarLoader.class$(SigarLoader.java:79)
at org.hyperic.sigar.SigarLoader.getLocation(SigarLoader.java:79)
at org.hyperic.sigar.cmd.Runner.main(Runner.java:161)
java.lang.UnsatisfiedLinkError: org.hyperic.sigar.util.Getline.isatty()Z
at org.hyperic.sigar.util.Getline.isatty(Native Method)
at org.hyperic.sigar.util.Getline.<clinit>(Getline.java:36)
at org.hyperic.sigar.shell.ShellBase.init(ShellBase.java:93)
at org.hyperic.sigar.cmd.Shell.main(Shell.java:212)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:616)
at org.hyperic.sigar.cmd.Runner.main(Runner.java:214)
> locate libkvm
/lib/libkvm.so.5
/usr/lib/libkvm.a
/usr/lib/libkvm.so
/usr/lib/libkvm_p.a
> su
Password:
mq1# ln -s /lib/libkvm.so.5 /lib/libkvm.so.4
mq1# ldconfig
mq1# exit
exit
> java -jar pdk/lib/sigar.jar
sigar>
^C


and now it works ...


$ export JAVA_HOME=/usr/local/openjdk6
$ ./bin/hq-agent-nowrapper.sh start
Starting agent
- Unable to load agent token file. Generating a new one ... Done
- Invoking agent
- Agent thread running
- Verifying if agent is running...
- Agent is running
Agent successfully started



Thanks
0 Kudos
treyhyde
Contributor
Contributor

Actually, not works but got a bit further around, it seems the agent never gets started after the setup.


What IP should HQ use to contact the agent [default=192.168.2.112]:
What port should HQ use to contact the agent [default=2144]:
- Received temporary auth token from agent
- Registering agent with HQ
- Unable to register agent: Failed to connect to agent: Unable to connect to 192.168.2.112:2144: Connection refused
0 Kudos
treyhyde
Contributor
Contributor

see previous post... still not working, marking as unanswered
0 Kudos
mcmesser
Hot Shot
Hot Shot

We generally only see this error when firewall rules are not allowing the server to communicate to the agent on the port specified. Can you test that?
0 Kudos
treyhyde
Contributor
Contributor

There are no software firewalls on this machine.

I just came to the bottom of it... this agent is not detecting its IP address correctly.

HQ thinks it is .112 but in reality this host is .113. I'm really perplexed on how it came up with .112. There are no entries in /etc/hosts and DNS is correct. Where is hyperic pulling the local IP from?


What IP should HQ use to contact the agent [default=192.168.2.112]: 192.168.2.113

The agent is now communicating with the server.
0 Kudos
mcmesser
Hot Shot
Hot Shot

The agent asks the OS for the active interfaces and picks the first one. So 192.168.2.112 doesn't appear anywhere in the 'ifconfig -a' output?
0 Kudos
treyhyde
Contributor
Contributor

Nope, I'm a bit perplexed.

# /sbin/ifconfig -a
igb0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
options=13b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,JUMBO_MTU,TSO4>
ether 00:25:90:01:6b:a4
inet 192.168.2.113 netmask 0xffffff00 broadcast 192.168.2.255
media: Ethernet autoselect (1000baseT <full-duplex>)
status: active
igb1: flags=8802<BROADCAST,SIMPLEX,MULTICAST> metric 0 mtu 1500
options=13b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,JUMBO_MTU,TSO4>
ether 00:25:90:01:6b:a5
media: Ethernet autoselect
status: no carrier
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> metric 0 mtu 16384
options=3<RXCSUM,TXCSUM>
inet6 fe80::1%lo0 prefixlen 64 scopeid 0x3
inet6 ::1 prefixlen 128
inet 127.0.0.1 netmask 0xff000000
0 Kudos
mcmesser
Hot Shot
Hot Shot

Peculiar. And you're absolutely certain there's no rogue entry in /etc/hosts?
0 Kudos
treyhyde
Contributor
Contributor

Actually, there are so rogue entries in /etc/hosts. Not sure what happened there. Thanks
0 Kudos