web stats
How to Get Live Status of Channel - Mirth Community

Go Back   Mirth Community > Mirth Connect > Support

Reply
 
Thread Tools Display Modes
  #1  
Old 07-25-2013, 04:19 AM
Gagan_ Gagan_ is offline
Mirth Newb
 
Join Date: Sep 2012
Location: Chandigarh, India
Posts: 19
Gagan_ is on a distinguished road
Send a message via Skype™ to Gagan_
Default How to Get Live Status of Channel

Hi,

Is it possible to get whether channel is Reading, Pooling or is Idle in Mirth connect ?

Thanks
Reply With Quote
  #2  
Old 07-25-2013, 04:49 AM
cory_cole cory_cole is offline
Mirth Guru
 
Join Date: Mar 2012
Posts: 1,247
cory_cole is on a distinguished road
Default

function GetChannelState(channel_id)
{
var controller = com.mirth.connect.server.controllers.DefaultExtens ionController.create();
var monitor = controller.getServicePlugins().get(com.mirth.conne ct.plugins.dashboardstatus.DashboardConnectorStatu sMonitor.PLUGINPOINT);
var states = monitor.invoke('getStates',null,null);

var status = states.get(channel_id + '_source_connector')[1];
return status;
}
Reply With Quote
  #3  
Old 07-25-2013, 07:34 AM
Gagan_ Gagan_ is offline
Mirth Newb
 
Join Date: Sep 2012
Location: Chandigarh, India
Posts: 19
Gagan_ is on a distinguished road
Send a message via Skype™ to Gagan_
Default

Hi Sir,

Thanks for your reply. When i run it gives below error

Cannot find function getServicePlugins in object com.mirth.connect.server.controllers.DefaultExtens ionController@95e1e3.

Am using Mirth2.0

I tested same on MIrth2.2 it Works

Is it possible to do in Mirth2.0

Last edited by Gagan_; 07-25-2013 at 07:57 AM.
Reply With Quote
  #4  
Old 07-25-2013, 10:39 AM
Gagan_ Gagan_ is offline
Mirth Newb
 
Join Date: Sep 2012
Location: Chandigarh, India
Posts: 19
Gagan_ is on a distinguished road
Send a message via Skype™ to Gagan_
Default

Sir can u Please provide the same for Mirth 2.0 , as DefaultExtensionController for mirth2.0 has string status like idle, waiting, etc. I am not able to configure out the syntax. Please provide
Reply With Quote
  #5  
Old 07-25-2013, 11:11 AM
cory_cole cory_cole is offline
Mirth Guru
 
Join Date: Mar 2012
Posts: 1,247
cory_cole is on a distinguished road
Default

I can not. I have never used 2.0. There may be somebody else on here that knows that answer.
Reply With Quote
  #6  
Old 07-25-2013, 11:19 AM
Gagan_ Gagan_ is offline
Mirth Newb
 
Join Date: Sep 2012
Location: Chandigarh, India
Posts: 19
Gagan_ is on a distinguished road
Send a message via Skype™ to Gagan_
Default

Ok, May someone answer. Mean while just trying
Reply With Quote
  #7  
Old 07-26-2013, 05:46 AM
narupley's Avatar
narupley narupley is online now
Mirth Employee
 
Join Date: Oct 2010
Posts: 7,119
narupley is on a distinguished road
Default

In 2.0.0, you'll have to use getLoadedPlugins() instead.
__________________
Step 1: JAVA CACHE...DID YOU CLEAR ...wait, ding dong the witch is dead?

Nicholas Rupley
Work: 949-237-6069
Always include what Mirth Connect version you're working with. Also include (if applicable) the code you're using and full stacktraces for errors (use CODE tags). Posting your entire channel is helpful as well; make sure to scrub any PHI/passwords first.


- How do I foo?
- You just bar.
Reply With Quote
  #8  
Old 07-26-2013, 06:09 AM
Gagan_ Gagan_ is offline
Mirth Newb
 
Join Date: Sep 2012
Location: Chandigarh, India
Posts: 19
Gagan_ is on a distinguished road
Send a message via Skype™ to Gagan_
Default

Thanks for your reply, Following is the error

Cannot find function invoke in object {Dashboard Status Column Server=com.mirth.connect.plugins.dashboardstatus.D ashboardConnectorStatusMonitor@9d2aa4, Server Log=com.mirth.connect.plugins.serverlog.ServerLogP rovider@1d85c73, Message Pruner=com.mirth.connect.plugins.messagepruner.Mes sagePrunerService@19d9153}.


When i use below function
function GetChannelState(channel_id)
{
var controller = com.mirth.connect.server.controllers.DefaultExtens ionController.create();
var monitor = controller.getLoadedPlugins();//.get(com.mirth.connect.plugins.dashboardstatus.Das hboardConnectorStatusMonitor.PLUGINPOINT);
var states = monitor.invoke('getStates',null,null);

var status = states.get(channel_id + '_source_connector')[1];
return status;
}
Reply With Quote
  #9  
Old 07-26-2013, 06:14 AM
narupley's Avatar
narupley narupley is online now
Mirth Employee
 
Join Date: Oct 2010
Posts: 7,119
narupley is on a distinguished road
Default

Quote:
Originally Posted by Gagan_ View Post
Thanks for your reply, Following is the error

Cannot find function invoke in object {Dashboard Status Column Server=com.mirth.connect.plugins.dashboardstatus.D ashboardConnectorStatusMonitor@9d2aa4, Server Log=com.mirth.connect.plugins.serverlog.ServerLogP rovider@1d85c73, Message Pruner=com.mirth.connect.plugins.messagepruner.Mes sagePrunerService@19d9153}.


When i use below function
function GetChannelState(channel_id)
{
var controller = com.mirth.connect.server.controllers.DefaultExtens ionController.create();
var monitor = controller.getLoadedPlugins();//.get(com.mirth.connect.plugins.dashboardstatus.Das hboardConnectorStatusMonitor.PLUGINPOINT);
var states = monitor.invoke('getStates',null,null);

var status = states.get(channel_id + '_source_connector')[1];
return status;
}
Well, other things have changed as well since 2.0. For example PLUGIN_POINT was not available on the monitor; instead you'll have to use DASHBOARD_STATUS_COLUMN_SERVER from the ConnectorStatusPlugin. Look here for more info: http://www.mirthcorp.com/community/f...r.java?hb=true
__________________
Step 1: JAVA CACHE...DID YOU CLEAR ...wait, ding dong the witch is dead?

Nicholas Rupley
Work: 949-237-6069
Always include what Mirth Connect version you're working with. Also include (if applicable) the code you're using and full stacktraces for errors (use CODE tags). Posting your entire channel is helpful as well; make sure to scrub any PHI/passwords first.


- How do I foo?
- You just bar.
Reply With Quote
  #10  
Old 07-27-2013, 11:22 PM
Gagan_ Gagan_ is offline
Mirth Newb
 
Join Date: Sep 2012
Location: Chandigarh, India
Posts: 19
Gagan_ is on a distinguished road
Send a message via Skype™ to Gagan_
Default

I got it using getLoadedPlugins() , Thanks
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 08:56 PM.


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