Announcement

Collapse
No announcement yet.

alert for chnnael state change

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

  • alert for chnnael state change

    Hi,

    How do you create a alert in Mirth 1.7.1 to be alerted when a channel state changes.

    Is this feature available. Is it going to added in the future release of Mirth.


    thanks,
    Bahram

  • #2
    Re:alert for chnnael state change

    Hi,

    I also would like to know if there is an ability to get alerts when Queued count go up.

    I like to get alerts when the queue count is greater than 10.

    thanks,
    Bahram

    Comment


    • #3
      Re:alert for chnnael state change

      Hi Bahram,

      Neither of those features are currently available in Mirth, but are on our road-map for a future version.

      You *may* be able to sent alerts when the queue count reaches a certain number by writing custom JavaScript in a transformer step that queries the Mirth internal database to select the queued message count for the specified channel then trigger an alert using the AlertController class, but this would be a lot of work.
      Gerald Bortis | Chief Information Officer | Mirth Corporation

      Comment


      • #4
        Re:alert for chnnael state change

        Hi geraldb,

        This is a very critical feature. I have to able to send email alert to an administrator,
        when ever a channel is no longer sending messages or receiving messages, or when the queue count grows. Therefore I need to know when a channel is no longer connected.

        Are there APIs which I can call from within the transform editor, which will return the current channel status, number of queued messages, number of connections, and current connection status.

        Is there a function or method I can call. Does the Mirth Channel have class object.
        What is the name of Channel Object. What Methods are available The Channel Class.


        thanks.
        Bahram

        Comment


        • #5
          Re:alert for chnnael state change

          Hi baziz,

          You can review an example I wrote a few days ago for an issue related to this (stop a channel when any error occurs). See the "stop and go" in the Wiki page. I think that with little effort you can adapt it to check the queued count and raise some event (trigger an alert) to fit your needs.

          Anyway, if you want to monitor Mirth status (channels and queued msg counts) I think that your best option is using a tool like Nagios that is focused on monitoring apps. I used a plugin for Nagios called "monju" that allows access some Mirth counters throught JMX. Finally, in Nagios is very easy to setup alert conditions based on items monitored, and send emails to the admin or group of admins ... etc

          See you

          Comment


          • #6
            Re:alert for chnnael state change

            Hello,

            I too am looking for a similar function. I am lookin for a way to send an email alert when a channel has been stopped. I tried searching for your "stop and go" wiki page but couldnt find it. Could you please post a link?

            Also, any additional information on sending an email alert when a channel has been stopped would be much appreciated.

            thanks.

            Comment


            • #7
              Re:alert for chnnael state change

              The example is posted in the Mirth wiki, in the examples section:

              http://www.mirthproject.org/index.ph...id=stop_and_go

              But I can't figure out how to send an alert either programatically or by configuring the alerting module to send an email when a channel stops. Note that the stop and go is only to stop a channel when an error occurs when processing a message ..

              Comment


              • #8
                Re:alert for chnnael state change

                Hello,

                I tried to modify the sample in wiki to work with default postgresql database :
                http://www.mirthproject.org/index.ph...id=stop_and_go

                I found connection informations from :
                http://www.mirthproject.org/svn/trun...fig.properties

                It does not work and I do not know why :
                Code:
                function handleError(IdChannel){
                	var driverClass = "org.postgresql.Driver";
                	var connectURL="jdbc:«»postgresql://localhost:5432/mirthdb";
                	var username = "postgres";
                	var password = "postgres";
                //	logger.error("channelID: " + IdChannel);
                	var strQuery = "select count(1) as ERRORED from channel_statistics where channel_id='" + IdChannel + "' and error>0"; 
                	var dbConn = DatabaseConnectionFactory.createDatabaseConnection(driverClass,connectURL,username,password);
                	var result = dbConn.executeCachedQuery(strQuery);
                	dbConn.close();
                 
                	// we should have only 1 record, containig 0 or 1 in the "ERRORED" field.
                	// 1: the channel contains errors in any message.
                	// 0: the channel is "clean"
                	result.next();
                	var errored = result.getInt("ERRORED"«»);
                	if ( errored == 1 ) {
                		var channelStatusController = Packages.com.webreach.mirth.server.controllers.ChannelStatusController.getInstance();
                		channelStatusController.stopChannel( IdChannel );
                		alerts.sendAlert("1"«»);
                	}
                	else
                		alerts.sendAlert("0"«»);
                }

                + I can send alerts from Mirth Alerts but alerts.sendAlert() does not work, I missed something in Mirth 1.7.1 ?

                Post edited by: magikbanana, at: 09/05/2008 07:17

                Post edited by: magikbanana, at: 09/05/2008 08:19

                Comment

                Working...
                X