I have an hp server with capability of kvm redirection for remote administration. It is made via java applet. I have downloaded an application itself from this url: http://ip_of_lo100/M2.JAR. I am able to run it with java -jar M2.JAR. Now I want to make it automatically connect to remote console, so I do not need to copy paste values of server address, username and password every time.
In the source code of web page with applet I can see the following code:
<APPLET CODE="com.serverengines.mahogany.MahoganyViewer.class" mayscript="true"ARCHIVE = "M2.JAR" WIDTH="400" HEIGHT="250"alt="JavaScript has been disabled or is not supported by your web browser which is needed by the Virtual KVM/Media applet. Please correct this problem.">
<PARAM NAME="NonSecure_KVMPort" VALUE="80">
<PARAM NAME="sessiontype" VALUE="kvm" >
<PARAM NAME="port" VALUE="5901" >
<PARAM NAME="ipaddress" VALUE="172.17.10.77" >
<PARAM NAME="sessiontype" VALUE="kvm" >
<PARAM NAME="httpdata" VALUE="72E36147CB88E76E6B6A8ECB9FADB95B208CB9509682452D1DDA3EC715C91B031C83F3F842D109E34378933F3E14649F" >
<PARAM NAME="username" VALUE="admin" >
<BR><p class="errorcolor">JavaScript has been disabled or is not supported by your web browser which is needed by the Virtual KVM/Media applet. Please correct this problem.</p></APPLET>
I have no idea why they used sessiontype twice. Then I tried to launch jar file like this:
java -jar M2.jar \
NonSecure_KVMPort="80" \
sessiontype="kvm" \
port="5901" \
ipaddress="172.17.10.77" \
sessiontype="kvm" \
httpdata="72E36147CB88E76E6B6A8ECB9FADB95B208CB9509682452D1DDA3EC715C91B031C83F3F842D109E34378933F3E14649F" \
username="admin"
and that worked: I got the remote console without (kinda) copy-pasting anything to java application.
But the problem is that this httpdata value is different all the time. So I need to visit web page anyway (probably with curl).
But I wanted to launch remote console something like follopwing:
java -jar M2.jar \
ipaddress="172.17.10.77" \
username="admin" \
password="mypassword"
But the application seems to not know such a parameter "password", it just immediately exits.
So I wanted to explore a jar file itself to determine which parameters does it accept. Is that possible?
Edit: For this specific problem, I have found this project which allows you to launch console automatically.