aspose file tools*
The moose likes Java in General and the fly likes Capture/Display logs from Unix box - Access from Java Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "Capture/Display logs from Unix box - Access from Java" Watch "Capture/Display logs from Unix box - Access from Java" New topic
Author

Capture/Display logs from Unix box - Access from Java

Natraj Aggas
Greenhorn

Joined: Jul 11, 2011
Posts: 15
Hi,
I have to write a java program in which i need to connect to a unix server and need to display the logs from unix server to my local console. Could anyone help me if you have similar kind of code.

Thanks,
-N
Ivan Jozsef Balazs
Rancher

Joined: May 22, 2012
Posts: 905
    
    5
The first question is how do you want to connect to the server: through which protocol.

telnet? ssh? ftp? sftp? scp? etc?
Natraj Aggas
Greenhorn

Joined: Jul 11, 2011
Posts: 15
Hi, I am planning to connect thro telnet. The java should kick an unix script located in some location.
Ex: Remote ip - 100.12.122.xxxx, hostname - xyz.

The script named getLogs.sh is located in /home/natraj/scripts/

I am new to this telnet concepts, so can you help me how the java code will be for the above scenario.
Ivan Jozsef Balazs
Rancher

Joined: May 22, 2012
Posts: 905
    
    5
So you seem to need a telnet library for Java.

http://commons.apache.org/net/




 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Capture/Display logs from Unix box - Access from Java