web stats
How to get the "connection status of channel" - Page 2 - Mirth Community

Go Back   Mirth Community > Mirth Connect > Development

Reply
 
Thread Tools Display Modes
  #11  
Old 09-01-2015, 04:56 AM
C3G C3G is offline
Mirth Newb
 
Join Date: Jun 2015
Posts: 13
C3G is on a distinguished road
Default

Hi Jurjan,

By chance, do you know how to get the history of the connection status ?

With your code, I have only the current status

Thank you in advance for your help.

Regards
Reply With Quote
  #12  
Old 09-15-2015, 01:31 AM
Shakurr Shakurr is offline
What's HL7?
 
Join Date: Sep 2015
Posts: 5
Shakurr is on a distinguished road
Default

Quote:
Originally Posted by Jurjan View Post
For people following this:
I got it working using the following:
var ChanController = Packages.com.mirth.connect.server.controllers.Chan nelController.getInstance();
var defController = Packages.com.mirth.connect.server.controllers.Defa ultExtensionController.create();
var monitor = defController.getServicePlugins().get(Packages.com .mirth.connect.plugins.dashboardstatus.DashboardCo nnectorStatusMonitor.PLUGINPOINT);
var states = monitor.invoke('getStates', null, null);sony z5 schutzhülle

status = states.get(channelID + '_0')[1];

Main, important, change seems to be the change from
states.get(channelID + '_source_connector')[1];
to
states.get(channelID + '_0')[1];
Although a bit complicated, but it is very helpful, thank you very much

Last edited by Shakurr; 09-15-2015 at 06:13 PM.
Reply With Quote
  #13  
Old 10-13-2015, 08:05 AM
gwiens gwiens is offline
Mirth Newb
 
Join Date: Oct 2013
Posts: 19
gwiens is on a distinguished road
Cool

Quote:
Originally Posted by Jurjan View Post
For people following this:
I got it working using the following:


Code:
var ChanController = Packages.com.mirth.connect.server.controllers.ChannelController.getInstance();
var defController = Packages.com.mirth.connect.server.controllers.DefaultExtensionController.create();
var monitor = defController.getServicePlugins().get(Packages.com.mirth.connect.plugins.dashboardstatus.DashboardConnectorStatusMonitor.PLUGINPOINT);
var states = monitor.invoke('getStates', null, null);

status = states.get(channelID + '_0')[1];

I have been following this and I wanted to say thank you for all your work. This works for version 3.x!
Reply With Quote
  #14  
Old 10-14-2015, 01:16 AM
Jurjan Jurjan is offline
OBX.1 Kenobi
 
Join Date: Feb 2011
Posts: 37
Jurjan is on a distinguished road
Default

@C3G,
mmmhhh, as far as I know (NOT very far) that's not possible out of the box.

If needed I would have a channel pick up the connection status every X time.
Then put that value in a database table, together with a key (channel_ID?) and time of collection and perhaps the name of the channel for us mere humans.

Then when I would want to know the history i could simply query for it.
Reply With Quote
  #15  
Old 01-05-2016, 09:07 AM
small small is offline
Mirth Newb
 
Join Date: Apr 2012
Posts: 15
small is on a distinguished road
Exclamation

Quote:
Originally Posted by Jurjan View Post
I'm using 3.2.0, and getting this error:
[2015-05-04 16:36:27,259] ERROR (com.mirth.connect.connectors.js.JavaScriptReceive r:135): Error executing JavaScript Reader script d967cfa5-fa96-4c75-90b5-5d43de6b5738.
com.mirth.connect.server.util.javascript.JavaScrip tExecutorException: com.mirth.connect.server.MirthJavascriptTransforme rException: CHANNEL:
T_ALG_XXXX_CHK01CONNECTOR:
SourceSOURCE CODE:
106: logger.info('states: ' + states);107: // var status = states.get(channelid + '_source_connector')[1];108: //logger.info('status: ' + status);109: var status = states.get(channelid + '_source_connector');110: logger.info('status: ' + status);111: var status2 = status[1];112: logger.info('status2: ' + status2);113: return status;114: }115: // Versie: $Rev: 1489 $LINE NUMBER:
111DETAILS:
TypeError: Cannot read property "1" from null
at d967cfa5-fa96-4c75-90b5-5d43de6b5738:111 (channelStatus)
at d967cfa5-fa96-4c75-90b5-5d43de6b5738:761 (doScript)
at d967cfa5-fa96-4c75-90b5-5d43de6b5738:764
at com.mirth.connect.server.util.javascript.JavaScrip tUtil.execute(JavaScriptUtil.java:67)
at com.mirth.connect.connectors.js.JavaScriptReceiver .poll(JavaScriptReceiver.java:101)
at com.mirth.connect.donkey.server.channel.PollConnec tor$PollConnectorTask.run(PollConnector.java:131)
at java.util.TimerThread.mainLoop(Unknown Source)
at java.util.TimerThread.run(Unknown Source)Caused by: com.mirth.connect.server.MirthJavascriptTransforme rException: CHANNEL:
T_ALG_XXXX_CHK01CONNECTOR:
SourceSOURCE CODE:
106: logger.info('states: ' + states);107: // var status = states.get(channelid + '_source_connector')[1];108: //logger.info('status: ' + status);109: var status = states.get(channelid + '_source_connector');110: logger.info('status: ' + status);111: var status2 = status[1];112: logger.info('status2: ' + status2);113: return status;114: }115: // Versie: $Rev: 1489 $LINE NUMBER:
111DETAILS:
TypeError: Cannot read property "1" from null
at d967cfa5-fa96-4c75-90b5-5d43de6b5738:111 (channelStatus)
at d967cfa5-fa96-4c75-90b5-5d43de6b5738:761 (doScript)
at d967cfa5-fa96-4c75-90b5-5d43de6b5738:764
at com.mirth.connect.server.util.javascript.JavaScrip tUtil.executeScript(JavaScriptUtil.java:526)
at com.mirth.connect.connectors.js.JavaScriptReceiver $JavaScriptReceiverTask.call(JavaScriptReceiver.ja va:159)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker( Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run (Unknown Source)
at java.lang.Thread.run(Unknown Source)

anyone has any idea?
I still get this even after putting in various "fixes" suggested here in the forum. I have yet to go line by line and make sure all my mappings are correct. I'm guilty of doing a cut and paste and "scratch head" when it doesn't work. I will say that I'm getting different errors and it looks like the channel is making it "further" but I still get the "1" from null error. I'm wondering if setting up a debug environment would help.
Reply With Quote
  #16  
Old 01-05-2016, 10:16 PM
Jurjan Jurjan is offline
OBX.1 Kenobi
 
Join Date: Feb 2011
Posts: 37
Jurjan is on a distinguished road
Default

@Small,
could you post some code?

Perhaps someone here can help you.
Reply With Quote
  #17  
Old 07-14-2016, 04:20 AM
rauchj rauchj is offline
OBX.1 Kenobi
 
Join Date: Feb 2014
Location: Freiburg, Germany
Posts: 43
rauchj is on a distinguished road
Default

In 3.4.x this works:

Code:
var defController = Packages.com.mirth.connect.server.controllers.DefaultExtensionController.create();
var monitor = defController.getServicePlugins().get(com.mirth.connect.plugins.dashboardstatus.DashboardConnectorStatusServletInterface.PLUGIN_POINT);
connectorListener = monitor.getConnectorListener()
var states = connectorListener.getConnectorStateMap();
// Status siehe: https://svn.mirthcorp.com/connect/branches/3.4.x/client/src/com/mirth/connect/plugins/dashboardstatus/DashboardConnectorStatusPanel.java
thisState = states.get(channelID+'_0')[1]
Reply With Quote
  #18  
Old 12-22-2016, 05:23 AM
hugobarros hugobarros is offline
What's HL7?
 
Join Date: May 2014
Posts: 1
hugobarros is on a distinguished road
Default

Very good! Thank you for share the solution using mirth 3.4.x.

Works fine to me.

Hugo
Reply With Quote
  #19  
Old 01-12-2017, 01:32 AM
CLakshmi CLakshmi is offline
Mirth Newb
 
Join Date: Dec 2015
Posts: 7
CLakshmi is on a distinguished road
Default How to enable to statistics for Javascript Reader channels

Hi Team,
I have a mirth channel source connector as 'Javascript Reader'. It's not showing any statistics in Dashboard. how to enable it? Thanks.

Regards,
Lakshmi
Reply With Quote
  #20  
Old 01-19-2018, 12:02 PM
MrDavid MrDavid is offline
What's HL7?
 
Join Date: Jan 2018
Posts: 1
MrDavid is on a distinguished road
Default How to get connection Status?

Is there a way to pull this information from the cli, or from the mirth connect api?

If not how do you set up the channel to pull this information? Details please total novice. Thanx in advance.
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:20 PM.


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