web stats
External Mirth Monitoring...how I did it - Mirth Community

Go Back   Mirth Community > Mirth Connect > General Discussion

Reply
 
Thread Tools Display Modes
  #1  
Old 11-15-2012, 07:10 AM
Bostad Bostad is offline
Level 85 Channel Wizard
 
Join Date: Mar 2009
Location: Stratford Ontario
Posts: 712
Bostad is an unknown quantity at this point
Default 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 Images
File Type: jpg mirthmonv1.jpg (326.9 KB, 347 views)
__________________
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
Reply With Quote
  #2  
Old 11-19-2012, 03:17 PM
dereke's Avatar
dereke dereke is offline
Mirth Employee
 
Join Date: Mar 2012
Posts: 24
dereke is on a distinguished road
Send a message via AIM to dereke
Default

Wow, this is really cool Dave!

Please update us when everything's worked out, I'd love to see it.
Reply With Quote
  #3  
Old 11-20-2012, 02:12 PM
mchunn mchunn is offline
What's HL7?
 
Join Date: Jul 2011
Location: Huntsville, AL
Posts: 2
mchunn is on a distinguished road
Default

Excellent idea!
Reply With Quote
  #4  
Old 11-26-2012, 09:03 PM
haroonrashed haroonrashed is offline
What's HL7?
 
Join Date: Apr 2012
Posts: 4
haroonrashed is on a distinguished road
Default 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.
Reply With Quote
  #5  
Old 11-29-2012, 04:01 AM
cory_cole cory_cole is offline
Mirth Guru
 
Join Date: Mar 2012
Posts: 1,209
cory_cole is on a distinguished road
Default

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

Select * from message where channel_id = channelid and max(date_created) > 24 hours.
Reply With Quote
  #6  
Old 12-12-2012, 01:09 AM
larry57500 larry57500 is offline
Mirth Newb
 
Join Date: Jul 2012
Location: Luxembourg
Posts: 7
larry57500 is on a distinguished road
Default

I do this :
if(com.mirth.connect.server.util.ConnectorUtil.tes tConnection('IP of Mirth application', 1099 ,1000).getType()!='SUCCESS'){
do something
}
Reply With Quote
  #7  
Old 01-04-2013, 01:50 AM
Garret2 Garret2 is offline
What's HL7?
 
Join Date: Jan 2013
Posts: 2
Garret2 is on a distinguished road
Default

your idea is gr88. I appreciate it.. Thnx





__________________
website to check plagiarism

Last edited by Garret2; 02-28-2014 at 09:46 PM.
Reply With Quote
  #8  
Old 05-23-2019, 10:17 PM
anaishaawasthi anaishaawasthi is offline
What's HL7?
 
Join Date: May 2019
Posts: 3
anaishaawasthi is on a distinguished road
Default

Quote:
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
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 12:06 AM.


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