PDA

View Full Version : Two computers mixing


digdas
25-12-2008, 14:45
http://java-monitor.com/postedimages/59183c7f-bd29-4868-8936-c73ea8a38b2a.png

I have two different computers attached to the same network.
They show up mixed (the last part, I switched on my laptop JBoss)

Can this be avoided?

kjkoster
25-12-2008, 15:27
Dear digdas,

The problem in your case seems to be that each machine uses the local IP address 127.0.0.1 instead of the actual local IP address. (well, technically 127.0.0.1 is local and correct, but it's not what Java-monitor wants to find). Java-monitor uses the local IP address and the external IP address to differentiate between different JVM instances.

(Approximately) what date did you download the probe on? I fixed some JBoss and Tomcat detection issues recently.

Does your JBoss server pick up the local port number correctly? You can see that in the host page. For example, one of my demo servers reads:


Host details of jboss demo @ kjkoster.org
-----------------------
Name jboss demo @ kjkoster.org
Local IP : Port 192.168.0.1:8080
External IP address 80.101.182.197 (kjkoster.org)
... etc ...


I'm curious how your JBoss server identifies itself.

Kees Jan

digdas
25-12-2008, 16:01
I did download the probe at Devoxx, 9th of december.

Where can I find the host page?

And how am I able to set the host?

I will have a look at the jboss-config files..

kjkoster
25-12-2008, 18:19
Dear digdas,

Oh, cool. Did we talk at Devoxx?

The host page is the one you get to when you click on a host in the overview, to get to its graphs. The IP addresses are listed at the top.

Hmm. You should have the latest version of the probe.

What version of Linux is this? Do you have a non-standard IP configuration, perhaps?

Kees Jan

digdas
25-12-2008, 18:51
Yes, we did talk. Ik downloaded the probe during your speach.

Linux: mandriva - last version on my laptop, one before on the server.

Which hostname does jboss know about?

kjkoster
26-12-2008, 16:42
Dear Digdas,

I am away from the office a few days, but I'll make a probe for you that has a slightly different IP address detection mechanism. I hope that will fix your problem.

It'll be in the new year, though. :-)

Kees Jan

digdas
27-12-2008, 13:36
Thanks, no hurry.

What is the ip-address method you are using at this moment?
Perhaps you should look at more things than only the ip-address.
I am planning to see how multiple jboss instances on one host (with and without virtualisation) are running.
Just to check how jboss will handle this.

kjkoster
29-12-2008, 12:39
Dear digdas,

Well, Java-monitor looks at the machine's local IP address, the IP address as seen from Java-monitor.com and the application server's port number.

Your machines do have IP addresses other than 127.0.0.1 I presume?

Kees Jan

kjkoster
04-01-2009, 11:55
Dear digdas,

I sent you a PM with some code. Would you mind compiling that and running it on your laptop and your server? You can mail me the output, or PM it back to me.

Kees Jan

kjkoster
04-01-2009, 20:38
Dear digdas,

Thank you for sending me the output of one of your machines. You sent two PM's, but with the same data. Would you mind also PMing the other machine's output, please?

Kees Jan

kjkoster
05-01-2009, 17:43
Dear digdas,

I have changed the code a little. Would you mind PM-ing or e-mailing me the output of the code below?

import java.io.IOException;
import java.net.InetAddress;
import java.net.NetworkInterface;
import java.net.Socket;
import java.net.UnknownHostException;
import java.util.Enumeration;

public class Foo {
public static void main(String[] args) throws UnknownHostException,
IOException {
System.out.println("local address: "
+ InetAddress.getLocalHost().getHostAddress());
System.out.println("socket local address: "
+ new Socket("slashdot.org", 80).getLocalAddress()
.getHostAddress());

for (final Enumeration<NetworkInterface> interfaces = NetworkInterface
.getNetworkInterfaces(); interfaces.hasMoreElements();) {
final NetworkInterface iface = interfaces.nextElement();
for (final Enumeration<InetAddress> addresses = iface
.getInetAddresses(); addresses.hasMoreElements();) {
final InetAddress address = addresses.nextElement();

System.out.println("name: " + iface.getName() + ", display: "
+ iface.getDisplayName() + ", host address: "
+ address.getHostAddress() + ", hostname: "
+ address.getHostName() + ", is loopback: "
+ address.isLoopbackAddress() + ", is site local: "
+ address.isSiteLocalAddress() + ", is multicast: "
+ address.isMulticastAddress() + ", class: "
+ address.getClass());
}
}
}
}

Kees Jan

kjkoster
08-01-2009, 15:28
Dear digdas,

I e-mailed you a new probe. Have you found time to test it? If so, please let me know. I'd like to publish the new version.

Kees Jan

digdas
11-01-2009, 15:58
I did try the monitor on both the laptop and the server.
Now the graphs are not combined. This has been solved.

One remark, I moved the laptop to a different location. Another graph shows up.

I do not know if this should be fixed, I do not think so...

Greetings,

Aart Scheepers

kjkoster
13-01-2009, 09:09
Dear Aart,

Thank you for testing the probe. I'm adding a few small optimisations and then I will release a new version of Java-monitor later this week.

The fact that your laptop is perceived as being different VM's in different locations is an artifact of the way Java-monitor uses the IP addresses to identify VM's. I see the same thing for some test tomcats on my machine.

I really can't think of a way to make it possible to identify VM's properly in any other way, so I decided to leave this in as a feature. All solutions involve user configuration, which I loathe.

Kees Jan