web stats
Launching Mirth from external launcher - Mirth Community

Go Back   Mirth Community > Mirth Connect > Support

Reply
 
Thread Tools Display Modes
  #1  
Old 02-10-2020, 12:10 PM
rutledj rutledj is offline
Mirth Guru
 
Join Date: Nov 2010
Location: North Carolina
Posts: 399
rutledj is on a distinguished road
Default Launching Mirth from external launcher

I'm wondering if there is an api call that can actually launch Mirth Connect (and log in) if the server IP and credentials are passed in.

I was thinking I might could build something in a .net application that could store all of the Mirth instances (IPs) and the credentials for each so that with a push of a button, it could launch and log into all of them.

I have 9 instances that I log into each morning and that would be a nice feature.

Any ideas if this is possible?
Reply With Quote
  #2  
Old 02-10-2020, 01:45 PM
stormcel stormcel is offline
OBX.3 Kenobi
 
Join Date: Mar 2010
Location: Phoenix
Posts: 173
stormcel is on a distinguished road
Default

Can someone shed some light on whether there are any mirth connect administrator launcher command line switches? Is there an argument that I can pass to the launcher, say in a batch or bash script while firing up the java command?
say... ./launcer.exe -opensite 1 ???
Reply With Quote
  #3  
Old 02-13-2020, 09:55 AM
agermano agermano is offline
Mirth Guru
 
Join Date: Apr 2017
Location: Indiana, USA
Posts: 1,159
agermano is on a distinguished road
Default

Code:
./launcher --help
INFO  2020-02-13 13:52:59,577 [main] com.mirth.connect.client.launcher.MirthClientLauncher: Arguments: [--help]
usage: launch
 -a,--address <arg>            The address to connect to Mirth Connect
                               with.
 -d,--allow-incorrect-digest   Allows JARs that fail digest verification.
                               This should only be used for
                               development/testing purposes.
 -h,--help                     Prints this help message.
 -j,--java-console             If specified, the Administrator will be
                               launched with a Java console dialog.
 -k,--allow-self-signed        Allows JARs signed with self-signed
                               certificates to be verified. This should
                               only be used for development/testing
                               purposes.
 -m,--max-heap-size <arg>      The client-side max heap size to use when
                               launching the Administrator.
 -o,--stay-open                If specified, the launcher will stay open
                               after launching the Administrator.
 -v,--use-same-jvm             If specified, the Administrator will be
                               launched using the same JVM as the
                               launcher. Useful when you don't have access
                               to a launcher script.
Not sure why this isn't listed in the help above, but you can pass the path to a .jnlp file as an argument and it will import as a new connection and immediately start connecting.
Reply With Quote
  #4  
Old 02-13-2020, 11:17 AM
stormcel stormcel is offline
OBX.3 Kenobi
 
Join Date: Mar 2010
Location: Phoenix
Posts: 173
stormcel is on a distinguished road
Default

THAT WORKS GREAT!!!
It's good to know that you can shell script the launcher like that!
The only improvement is if we could pass it the user/pass from the command line.
Reply With Quote
  #5  
Old 02-18-2020, 03:32 AM
rutledj rutledj is offline
Mirth Guru
 
Join Date: Nov 2010
Location: North Carolina
Posts: 399
rutledj is on a distinguished road
Default

This is great but there doesn't seem to be a way to pass any credentials. I'd like to be able to launch it and log in automatically.
Reply With Quote
  #6  
Old 02-18-2020, 10:11 AM
agermano agermano is offline
Mirth Guru
 
Join Date: Apr 2017
Location: Indiana, USA
Posts: 1,159
agermano is on a distinguished road
Default

The client itself can accept a username and password as arguments.

If you launch your jnlp with webstart (the old way, pre-launcher) you can add your credentials to the jnlp file. I couldn't get it to work with the launcher, and it's not very secure since the credentials will be stored in plain text. Also javaws is no longer supported by oracle, but you might have luck with https://openwebstart.com/. I haven't tried it yet.

If you edit the jnlp file, near the bottom you'll see an "application-desc" section that contains some arguments. The first is the hostname and the second is the version number. I have no idea why this needs to be passed as an argument, and I don't know what happens if you pass the wrong version. You can add a 3rd argument for the username and a 4th for the password. Then just run the following and you'll be automatically logged in.
Code:
javaws webstart.jnlp
Alternatively, I also got it to start by invoking java directly. You will need to make sure that you have all of the correct jar files mentioned in the jnlp file already, because this will skip downloading them from the server and verifying the signatures. I ran this from the 3.5.1 folder under the launcher's cache folder (you may have different versions cached.)
Code:
java -cp $(find -name *.jar|paste -sd:) com.mirth.connect.client.ui.Mirth https://mirthserver:8443 3.5.1 myusername mypassword
This was from a Linux bash shell. You'll need to modify for Windows. It might work without modification on Mac, but I don't have one to test on. Basically, you just need to add all those jar files to the classpath somehow. It may be easier to move them all into a single folder.
Reply With Quote
  #7  
Old 02-26-2020, 11:27 AM
rutledj rutledj is offline
Mirth Guru
 
Join Date: Nov 2010
Location: North Carolina
Posts: 399
rutledj is on a distinguished road
Default

Thanks. Figured out the credentials in the jnlp file. That is slick, except I have to that already have a 3rd and 4th parameter for something else. If I put the credentials after those (5th and 6th), login fails.

I was hoping there was a way to launch it and have the files download (like the first time you log into an instance) and also log in automatically. Not sure if there is a way to do that.
Reply With Quote
  #8  
Old 02-26-2020, 12:43 PM
agermano agermano is offline
Mirth Guru
 
Join Date: Apr 2017
Location: Indiana, USA
Posts: 1,159
agermano is on a distinguished road
Default

You should be able to put username and password in 3 and 4, and bump the ssl flag and protocols back to 5 and 6.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -8. The time now is 07:18 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2020, vBulletin Solutions, Inc.
Mirth Corporation