Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
I have list of active deviceses in lan network... by its ip address how can I know that, Is snmp agent available on that device???
please help me find the list of snmp agent enable devices's list....
I want to do it using java (snmp4j)......
The only way to test if an agent on the device is to either know it (because the documentation says it has an agent) or to try and access it. But to try and access it you need to know how to access it.
If you're using SNMPv1 and SNMPv2c then you'll need to know the community name that can be used to get to the data. Some devices default to the community string with "public" but more and more devices, fortunately, no longer do this (and they shoudn't... from a security perspective no one should have ever done this).
For SNMPv3, you'd need to know even more parameters. But SNMPv3 with USM does have a probing method where you can send an initial packet with limited information in order to discover it's engineID. Because of this, SNMPv3 actually allows discovery unless the discovery mechanisms has been disabled.
Most commercial management suites have special code for doing discovery and network mapping, but all of them require at least configuration for trying various community names or default SNMPv3 settings.
In the end, you still need to know the devices you deployed and what they're capable of.
Related
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 3 years ago.
Improve this question
Due to some policy constraint at our company, we cannot use any external Library. I couldn't find any way to do that in Java.
I can think of two ways to avoid using an external library:
Implement your own SSH File Transfer Protocol client using the standard SSLSocket class ad related classes. The specifications are linked from the Wikipedia page. A brief review of the spec suggests that the protocol is not that complicated.
Identify and install a command-line client for SFTP, then use Process and ProcessBuilder to run the client as an external process.
Before you undertake any significant coding work on this, I would advise you to estimate how much dev time it will take to code test and maintain the code. If it seems like a lot, document the estimates and take them to your line manager.
If you are faced with a significant amount of extra work, it may affect your ability to meet your deadlines. Your manager needs to know about that.
If your manager is faced with a large dev cost or schedule slippage, he or she may be prepared to argue for an exemption to this (IMO) crazy corporate policy.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 9 years ago.
Improve this question
My problem is the following, I have two servers from which I have to transfer files, in both directions. The transfer is triggered by a file creation event (on respective sides). The problem is one server has a public IP, the other one doesn't.
I have implemented a socket client that sends a file over a socket, and a socket server which receives and saves it. (Working part)
My questions are : How to keep the socket 'alive' and send some data to the client after a file-system event occured on the server-side ? (Can the server call the client without knowing it's public IP ?)
Can I achieve this with socket technology or should I go for something else like RMI ?
The problem I see is not really an implementation issue. The problem is that you want to keep the client without a fixed address. If you had a fixed IP, I suppose there would be no problem. Right? As you probably understand there is no easy way for a computer to be called without having an address.
An option would be to use an middle solution, wrapping your non-fixed IP with a DNS able to refresh. You could use a service like dyndns to get a domain name which will actually redirect each packet to the real IP. Your router would have to be configured accordingly in order to refresh the IP to the dyndns servers each time it changes.
Another option, would be to use the websockets paradigm which now is part of HTML5. This way, the server would be able to push content to the client whenever he wanted it.
All of the above solutions depend heavily on your detailed scenario and I cannot by anyway guarantee that what I suggest is the best solution. Actually, I would strongly suggest to get a fixed IP which is a lot costless and cleaner solution than the ones I describe.
Hope I helped!
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 9 years ago.
Improve this question
I want to build a GPS application depends on using cell phones trackers and a server used to receive the results and informs it. as i want to use a standard protocol in dealing with the connection between the server and the GPS tracker exists in the cell phone.
After a lot of search i found three available protocols:
1- NMEA 0183.
2- SiRF.
3- MTK.
I want to know the best one of these protocols in order to use, or if there is any other important protocols that i didn't discover.
1- NMEA 0183:
not suitable: bad specified, sucht that there is much room for interpretation, differnet GPS chip manufacturers behave differently, further: needs to many bytes, because not a binary protcoll, it was designed to be human readable, too
2- SIRF:
SIRF binary: better, but like NMEA desigend for CHIP to App communication not for app to server. (Redundant fields like "time" when using multiple messages)
MTK i dont know.
There is also ubx binary (U-blox) chips. similar to SIRF, but still desogned for chipp to app communication.
I personally would design my own format for binary GPS packets, picking the atributes that I need.
and send that packets via std protocol like http.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 1 year ago.
Improve this question
I've got the login name of my computer using System.getProperty("user.name"). However, I need the logins of other computers whose IPs I've already got using InetAddress. How do I do it? Displaying the System. properties of all the IPs doesn't display their login names.
Thanks in advance!
All the PCs run on Linux.And I'm looking for the currently logged in user on other machines on the LAN.
I'm pinging all the machines on my LAN to see if a machine is alive. I get it's IP and I want to get its login name as well.
If you were able to do this "out of the box", this would be a huge security hole in the system. Just think about it. And then we don't even get to the problem of multiple users logged in on the machines.
So without further clarification this question is just too vague.
You can actually log on to the machines in a secure way using ssh, for example, and query the list of logged in users. You need to generate ssh keypairs and use some Java terminal library that can do the login programmatically and issue commands for you.
We actually have a product that works like this (for different purposes), and we use a 3rd party SSH library to do the hard work for us.
Or, as an alternative, you can implement and install your own "logged-in-users" daemon that you can connect to, perhaps install it as a web application, but then again, you need to use proper authentication to make your service safe to use. This latter solution however requires that an application or at least a web server is running on each machine that you want to query.
The best possible solution would be to install a software that will listen to a fixed port on the machine. Once you have the machine's address, the program can gather the information and send it back. Other than that, there's no such feature that exists, for various and obvious reasons.
However, even this solution does not guarantee that there will be a listening socket on the listed IP (the software is not guaranteed to be running), so without more information about what exactly you are trying to do, this answer is as vague as the question.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 4 years ago.
Improve this question
I want to create an adhoc between labtops were they will communicate using wireless communication. I will use java for this but still I do not know how to start..
I think I'll have to use sockets for the connections right? How will a laptop notice other laptops in its local network or the other way around? Do i need a server to handle the communication between laptops? Another thing, how to broadcast a message from one laptop to other laptops in the network? Please reply as soon as you can. Any help will be appreciated. Thanks in advance.
Generally changing network settings is both a privileged and system-specific task, so it's not ordinarily something that java applications should or would be permitted to do.
That's not to say it's necessarily impossible. For example, if you can figure out how to create and/or join a network from the command line, you may be able to issue those commands if the JVM permits it and you can somehow secure the necessary permissions. On a linux machine, this would probably be some combination of iwconfig and/or ifconfig usage - but normally requires root.
One you have a network up then you can deal with socket type traffic over it - an area where java is far more at home, and one that is often possible without special privileges, at least as far as the operating system is concerned.
Can you restate the problem:
Do you want to create appropriate low level settings for the "hardware" to set up ad-hoc WLAN
This is what the answers above try to handle...
You have two devices already authenticated in a WLAN that should be able to mutually detect services (in the way UPnP is designed)?
In this case you have some other tools available. You start with advertising a service using somthing like Zeroconf (Bonjour, available as jmDNS in open source). The other party is able to look up the service using jmDNS again. This works using UDP.
Once found you can establish direct IP communication as usual.
To broadcast information you have to program sockets on UDP level. If you don't want to go to greatest detail, there are also frameworks around (Apache MINA).
If u have to use java, I would advice u to have a look at the JANE, Java Ad Hoc Network Development Environment.
Good luck.
Is this academic? If so, try using simulators first. There are a lot of good simulators available for free (For eg. NS2, glomosim). It is a good place to start for proof of concept. These simulators have good mobile communication protocols (including mobile adhoc setup). You will not have to deal with nitty-gritty details and concentrate more on your application.