Announcement

Collapse
No announcement yet.

Mirth maintenance plan

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Mirth maintenance plan

    ================================
    Mirth v1.1, Windows Server 2000 SP4
    ================================

    I would like to know if Mirth team has any recommendation for doing periodic maintenance.

    This is in the context of support team doing weekly maintenance. All servers are rebooted once a week and other jobs run that do periodic clean-up.

    When servers are rebooted all statistics and messages need to be cleared, mirth.log file contents deleted, and Mirth should get started. This needs to happen when the server is brought backup and without user log-in.

    Appreciate your help!

  • #2
    Re: Mirth maintenance plan

    There are several new features in Mirth 1.2 which might be of interest to you. First is a database pruning option which can be set to prune the database of messages older than n days. This pruner is running in the background as Mirth is running, so it will keep the database size down to a minimum.

    Second, we've added support for running Mirth as a background service in both Windows and Linux, so you will be able to start/stop the server on reboot.

    Finally, the beginnings of a Mirth shell environment is in the repository with the ability to start/stop channels through the CLI. I will expand this to support clearing messages and stats for the entire server as well as for individual channels. You should be able to call the commands from a script on startup.

    Hope this helps!

    Gerald
    Gerald Bortis | Chief Information Officer | Mirth Corporation

    Comment


    • #3
      Re: Mirth maintenance plan

      Chris,

      I see a set of Windows batch files that could be used to run Mirth v1.2 as service.

      How do I clear the messages and stas with CLI commands from a script on startup (entire server / individual channel)?

      Thanks

      Comment


      • #4
        Re: Mirth maintenance plan

        Hi Mike,

        Are you building from the source? If so, an updated shell is available in the repository. The class to run is com.webreach.mirth.server.tools.Shell (which will be in mirth-server.jar), which accepts the follows arguments:

        -a: the IP address of the server
        -u: the user login
        -p: the user password
        -s: the script file to run

        For example: java -cp lib/mirth-server.jar com.webreach.mirth.server.tools.Shell -a 192.168.0.1 -u admin -p admin -s testscript.txt

        This will connect to the server, execute the commands in the script, and disconnect. So far, Mirth only supports the following commands:

        start: starts all channels
        stop: stops all channels
        clear: clears statistics and messages for all channels

        An example Mirth script might look like this:

        clear
        start


        Pretty simple. And we're definitely open for suggestions for more useful scripting commands. Again, the updated Shell class is available in the repository and the mirth-server.jar file can be created using the build process. Otherwise, this feature will be included in the 1.2.1 release sometime next week. Hope this helps!

        Gerald
        Gerald Bortis | Chief Information Officer | Mirth Corporation

        Comment


        • #5
          Re: Mirth maintenance plan

          A means to dump the stats and errors to a file would be nice.

          dump ${date}_mirth_stats.txt
          error ${date}_mirth_errors.txt
          clear
          start
          Jon Bartels

          Zen is hiring!!!!
          http://consultzen.com/careers/
          Talented healthcare IT professionals wanted. Engineers to sales to management.
          Good benefits, great working environment, genuinely interesting work.

          Comment


          • #6
            Re: Mirth maintenance plan

            Thanks for the suggestion! I've just commited an update to the repository with the following commands:

            dump stats <filename>
            dump events <filename>


            Running stats writes the channels statistics (same as Status Panel) to the file. Running events writes the system event log (which contains system errors) to the file. Both are written as CSV with the first line being the title with the current date and the second line being the column headers. Both filenames also support the ${date} variable which will resolve to the current date and time in the following format: "dd-MM-yy_HH-mm-ss.SS". If desired, I can also add the ability to append to an existing file.

            As always, more suggestions are welcome!

            Gerald
            Gerald Bortis | Chief Information Officer | Mirth Corporation

            Comment


            • #7
              Re: Mirth maintenance plan

              Thanks.

              I&#039;m getting the next error running the console:

              Code:
              Exception in thread "main" java.lang.NullPointerException
                      at com.webreach.mirth.client.core.ServerConnection.executePostMethod(ServerConnection.java:88)
                      at com.webreach.mirth.client.core.Client.login(Client.java:83)
                      at com.webreach.mirth.server.tools.Shell.run(Shell.java:93)
                      at com.webreach.mirth.server.tools.Shell.main(Shell.java:62)

              I&#039;m using the nex .bat file to lauch the client:

              Code:
              @ECHO OFF
              
              set cp=mirth-server.jar;mirth-client-core.jar
              set cp=%cp%;lib/commons-cli-1.0.jar;lib/log4j-1.2.13.jar;lib/xstream-1.2.jar;
              set cp=%cp%;lib/commons-httpclient-3.0.1.jar;lib/commons-beanutils.jar;lib/commons-digester-1.7.jar
              set cp=%cp%;lib/jetty/commons-logging.jar
              
              
              java -cp %cp%  com.webreach.mirth.server.tools.Shell -a 172.19.10.118 -u admin -p admin -s saveandclean.txt

              Comment

              Working...
              X