Announcement

Collapse
No announcement yet.

External Mirth Monitoring...how I did it

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

  • External Mirth Monitoring...how I did it

    Howdy All;

    A few weeks back we had an issue with some hardware that caused Mirth to slow down to a crawl on certain channels. (It was actually a cascading problem coupled with our HIS).

    I have custom email alerts in Mirth that email me when a problem occurs. The issue here was that they were late coming (and I missed them in a deluge of email).

    My boss likes it when I know about problems before the users notice. He asked me to come up with a solution where alerts wouldn't rely on Mirth. "What if Mirth is completely down?" was his question.

    What I came up with was a web (intranet) based solution involving PHP, MYSQL, and of course JQuery, Javascript and HTML.

    This is how it works.

    I add a destination in a channel I want to monitor;
    For every message is writes timelag (difference between MSH time and system time) , error count and queue count to a table in the MYSQL database.

    After that is deployed and starts writing to the database, a script I have triggered by a refreshing webpage on my "webserver" (an XP VM box), writes the channel to a table storing monitored channels.

    The same scheduler webpage triggers a PHP script that does the following:

    Checks the last time Mirth updated the current metrics table and triggers an alarm if its been too long.

    If it passes that, for each channel in the database it:

    -checks how long there has been no activity
    -what the message lag is
    -trends queue and error rates over the past 5 minutes

    If any of these values exceed parameters, it triggers an alarm and emails the appropriate people (sms functionality coming soon!).

    It will cancel the alert if the condition goes away, or resend the alert email every 60 minutes.

    I also created a dashboard of sorts to show statistics and alert history (screen shot attached).

    I've still got a couple off things to work out, after that, if I can find the time to clean up and comment my code, I'll post everything on my blog.
    Attached Files
    I can be reached through gmail and Google Talk using davidrothbauer at gmail dot com
    http://www.linkedin.com/pub/david-rothbauer/5/923/518
    codeismydrug.wordpress.com
    hl7coders.wordpress.com

    Test all my code suggestions prior to implementation

  • #2
    Wow, this is really cool Dave!

    Please update us when everything's worked out, I'd love to see it.

    Comment


    • #3
      Excellent idea!

      Comment


      • #4
        I want to send an email, if no files are received for more than 24 hours to interface

        My requirement would be the same but in different approch.
        I want to send an email, if no files are received for more than 24 hours to interface.


        Thanks,
        Haroon.

        Comment


        • #5
          Create a channel that pulls for the database every X minutes.

          Select * from message where channel_id = channelid and max(date_created) > 24 hours.

          Comment


          • #6
            I do this :
            if(com.mirth.connect.server.util.ConnectorUtil.tes tConnection('IP of Mirth application', 1099 ,1000).getType()!='SUCCESS'){
            do something
            }

            Comment


            • #7
              your idea is gr88. I appreciate it.. Thnx





              __________________
              website to check plagiarism
              Last edited by Garret2; 02-28-2014, 09:46 PM.

              Comment


              • #8
                Originally posted by haroonrashed View Post
                My requirement would be the same but in different approch.
                I want to send an email, if no files are received for more than 24 hours to interface.


                Thanks,
                Haroon.

                Hi Haroon,

                I have the similar requirement, Did you get the solution.
                Could you please share with me , I am using Mirth 3.4.2

                Comment

                Working...
                X