Esxi remote machine automation - java

My requirement is to automate an esxi remote machine using java.
So, I am able to automate vmware workstation and fusion by creating a bat file where I have added all the vmrun commands and executing the bat file using java.
Can anyone help me in achieving the same for esxi remote machine where I am using commands (like vmrun) for opening a browser in remote machine and passing the url.
I think vmrun utility is no longer supports for esxi.

powercli module of powershell solved my problem

Related

Would like to access remote linux machine console in a java web application running at different machine

I have a java web application both deployed and running at a linux machine, and there is one more machine where python service is running. here, the objective is to send some http requests/response from/to this python service. this functionality is working fine. but, there is one more requirement I want to access python machine (ubuntu) console in java web application. Please suggest how to accomplish this task. What concept/feature helps to achieve this.
thanks for your suggestion!

Can batch files execute (local) Java code from a local machine to a remote machine

Background: I am trying to run some Java code on a few target machines (to check registry values using JNA) and I don't want to have to install Java on every machine I need to check. I thought that a possible solution was having the server running the Java app use a batch file that lives on the local server. This batch file would simply call a Java program and get the data I needed from the remote machines.
Question: I have a local batch file that I am executing using Java. This batch file will remote execute on target machines. The batch file calls/runs a Java program. Is it possible for that Java program to live on the main server or does it need to live on the target machines as well?
if understood right, you could just say to the batch file to print a report of registry info that you are searching, then use java to directly reach that report, and then you could "analyze" that code in your "server"
with this you don't need to have java installed on local machine, and you don't need to launch "application" but simply: a script.

How to open a file and view on remote windows machine

I want to open a file on remote windows machine from my local windows machine. The file should be visible on remote machine only.
My problem is, I should open a bat file on remote pc which creates access to do something like opening browser etc.
I did using PSExec to run the bat file remotely. Everything looked good, but when i try to open the browser on remote pc, it does not open browser but shows browser processes in task manager.
When I go and open that bat file manually on remote machine everything works fine. Browser opens and my work is done.
But I want to do that from my local machine especially from the command line. So that I can use this commands in Java.
Please help. If question is not clear please ask for more info.
Try using the -i option with psexec or specifying a session ie. -i 1
From the psexec manual.
'-i Run the program so that it interacts with the desktop of the specified session on the remote system. If no session is specified the process runs in the console session.'
example:
C:\SysinternalsSuite\psexec.exe \remotecomputer -u DOMAIN\administrator -p adminpass -i 1 "\remotecomputer\c$\Program Files (x86)\Google\Chrome\Application\chrome.exe" http://tinyurl.com/6fbgntx
I'd suggest you to use WMI - It management instrumentation. It allows running process on remote machine (obviously if you have enough permissions).
You can either access WMI from Java using one of popular interoparability libraries (JaWin, JInterop, JIntegra) or write JScript or VBScript and execute it from java.
JaWin and Jinterop are open-source. JIntegra is not.
JaWin requires windows OS on client machine. JIntegra and JInterop can be executed from other OS.
I used all 2 suggested methods and all 3 libraries. Probably now I prefer JInterop.

Execute rft test script using agent controller?

I need to execute a test script that generated by Rational Functional Tester using Rational Agent Controller.
How can I do that? And if that's not possible what should I do to execute the script on a computer that hasn't RFT installed on?
Post RFT 8.2.0.1 , to be able to execute a script on a remote machine RFT must be installed on that machine.
*****EDIT***
RFT's installation is a complete package installation ,meaning when you install RFT it installs a complete product that is capable of recording /playback scripts on all the supported domains.
So it's not possible to say that on this machine X install only the recorder and on the machine Y install only the playback engine.
Another approach perhaps could be to have some kind of tool on the server machine that would say that here is the script , go and execute on the machine Z , that does not have RFT installed .. but as the script may have controls recorded for all the domains (html/java/.net/SAP/Win32) all the supporting files DLLs /JARs (consiting of proxies and OS related shared libraries) would have to be transferred to that machine and that I think would be quite a task to do :) . So in my opinion it's not impossible but it's just not been done yet.
Wrong, it is not impossible. Just takes a lot of configuration.
http://www-01.ibm.com/support/docview.wss?uid=swg21319598
To execute RFT scripts on a remote machine:
Make sure the scripts (java or .net ) are compiled before deploy for remote execution.
After they are compiled successfully, In order to start remote execution, on the master machine, the Test Manager needs to be installed and configured correctly.
The following is the configuration on the TM on the master machine: In the "Execution" tab, right click on "Computers", and add new computer,specify the computer name, property, and the port information, so TM will be able to locate the remote machine.
The set up for the remote machine will be described separately for java script and .net script. For java script, the following is needed on the remote machine:
Test Manager Test Agent. (can be installed from Test manager CD).
Rational Functional Tester Test Agent.( can be installed from RFT installation package).
For .net script, the following is needed on the remote machine:
Test Manager Test Agent. (can be installed from Test manager CD).
Rational Functional Tester Test Agent.( can be installed from RFT installation package).
.Net framework.(Visual Studio is not needed on the remote machine, there is currently defect on this, reference to a separate tech note on the workaround for this, searching "remote execution with .net script").
Last, but not the least, If the customer's AUT is Windows/.net/SAP based, then .net framework needs to be installed on the remote machine regardless whether it is java scripting or .net scripting. This is because some part of RFT's code gets placed into the application during infestation, the RFT code for these applications are written in C#, so at run time, the .net framework is needed to playback successfully.

download remote machine files using java

I would like to download somefiles which is in remote shared folder from the local system using java code. Can you please guide us, how i can proceed this. Whether i need use http or ftp. But i want to execute the code only in the local machine. It should not like client server program. Please post some tips over here.
Thanks in advance.
You cannot solve this without knowing the platform of your machine (where the app runs) and remote machine. But once you know you have many possibilities.
Agent full solution
Install agent on remote machine. The agent should expose API that allows access to the files. For example you can use FTP server as an agent. Then access this server and download your files. Alternatively you can implement your own application or servlet running in one of available servlet containers and provide access to files over HTTP.
Agent-less solution
Use the built-in functionality of target machine. For example use SSH to connect to Unix machine and SMB for windows. Both support Telnet
You can use VFS package from jakarta. There are several implementations of SSH. I recommend JSH.

Categories