You are not logged in.
Pages: 1
Ok, so I'm early in my search, but considering I use this distro, I figured Id post here. Alot of the Archers are good coders anyway right? Seriously I was trying to find a way to get remote system volumes using Java or (gasp) Mono, but if I have to use cpp i understand. This is for a little pet project I'm playing with but I was hoping there might be something easily google'able' but apparently there wasn't. Can anyone point me in a good direction to go with this?
thanks
"As long as people are going to call you a lunatic anyway,
why not get the benefit of it? It liberates you from convention. "
Offline
What do you mean by "get remote system volumes" ? If you mean samba shares I found a few on google like JCIFS.
Offline
No I'm talking about smb independant. As in is there a way to connect, if I open a port, to connect to the remote systems kernel, via like an api call, to get information about currently mounted volumes?
"As long as people are going to call you a lunatic anyway,
why not get the benefit of it? It liberates you from convention. "
Offline
You'd probably have to hook into ssh somehow I would think...
What problem are you trying to solve exactly?
[git] | [AURpkgs] | [arch-games]
Offline
I hope this is usefull:
I think I would just use the OS commands in Java. Like this (not my code!):
import java.io.*;
public class JavaRunCommand {
public static void main(String args[]) {
String s = null;
try {
// run the Unix "ps -ef" command
// using the Runtime exec method:
Process p = Runtime.getRuntime().exec("ps -ef");
BufferedReader stdInput = new BufferedReader(new
InputStreamReader(p.getInputStream()));
BufferedReader stdError = new BufferedReader(new
InputStreamReader(p.getErrorStream()));
// read the output from the command
System.out.println("Here is the standard output of the command:\n");
while ((s = stdInput.readLine()) != null) {
System.out.println(s);
}
// read any errors from the attempted command
System.out.println("Here is the standard error of the command (if any):\n");
while ((s = stdError.readLine()) != null) {
System.out.println(s);
}
System.exit(0);
}
catch (IOException e) {
System.out.println("exception happened - here's what I know: ");
e.printStackTrace();
System.exit(-1);
}
}
}
Now instead of running "ps -ef", you could run "ssh host df -h"
Offline
You can export this info via SNMP. The "snmpdf" command that comes with net-snmp demonstrates how to retrieve the data, in C, from a remote snmpd.
Offline
You can export this info via SNMP. The "snmpdf" command that comes with net-snmp demonstrates how to retrieve the data, in C, from a remote snmpd.
Perfect, thanks, I'll give this a go. To answer the previous question, I was simply curious how I would do it. I do .net, cpp, and java development during the day and I like to be able to find similar solutions for linux, for the problems I may have solved on windows and vica versa. I just wasn't sure where to start with this one as .net does have an advantage in WMI. Make sense? Thanks everyone, I'll post some code later.
"As long as people are going to call you a lunatic anyway,
why not get the benefit of it? It liberates you from convention. "
Offline
Pages: 1