7 Replies Latest reply on Aug 9, 2012 5:58 AM by mkel

    Alerts not firing in RHQ

    mkel

      Hi all,

      I have a problem of alerts not firing in RHQ. I have created several alerts for several different measurements, and I never get any alerts to the Alerts History of any resource.

       

      Is there some "master" switch to turn alerts on, or why am I not getting any alerts in RHQ?

       

      I am running RHQ Version: 4.5.0-SNAPSHOT.

       

      For example, I took the following steps to create a silly test alert:

      • Choose a platform in Inventory
      • Alerts->Definitions -> New -> Gave a name and description "TestAlert", Priority "High", Enabled "Yes"
      • Conditions->Add "Measurement Absolute Value Threshold", Metric "Actual Free Memory" > (Greater Than) 1MB
      • Save

       

      Then under the same platform I chose Monitoring to see the Last value for Actual Free Memory is 7.6869GB. I click Schedules to see that Actual Free Memory is enabled and Collection Interval is 10 minutes. I changed the Collection Interval to 2 minutes.

       

      After several minutes, I still don't get any alerts to the Alerts History.

       

      I have tried this also with some other resources such as Metric Value Change of Message Count in a service under a JBoss ESB, and verified that the message count increases as I run messages through my system, but the alert never fires. (These are, of course, not very useful meaurements to set alerts on, but I'd like to see at least some alerts working before defining the real ones).

       

      I have also tried to add notifications to the alerts so that it would send emails, but no emails are sent (as expected, since the alerts are not fired).

       

      Thank you for any advice.

        • 1. Re: Alerts not firing in RHQ
          ahovsepy

          Hi Eero,

           

          Please have a look into the documentation here and check the alert creating process with it?

          For the Metric Value Threshold [Actual Free Memory > 1023.0 KB] it works perfect.

           

          Please do not hesitate to come back if you have further questions.

           

          Regards,

          Armine H.

          • 2. Re: Alerts not firing in RHQ
            mkel

            Thanks for the link to documentation. I read through all the documentation regarding the alerts and verified that I have created the alert definitions as instructed. My alert definitions look fine and they are listed and enabled, but they still never fire even when their conditions are met.

            Do you have any ideas what could be the reason?

             

            BR,

            Eero

            • 3. Re: Alerts not firing in RHQ
              lkrejci

              Hi Eero,

               

              this is very strange. Have you seen any "anomalies" in the server log? $RHQ_HOME/logs/rhq-server-log4j.log

              1 of 1 people found this helpful
              • 4. Re: Alerts not firing in RHQ
                mkel

                Yes, there seems to be lots of lines like this:

                ERROR [org.rhq.enterprise.server.measurement.MeasurementCompressionManagerBean] Unable to compress data from [RHQ_MEAS_DATA_NUM_R11] to [RHQ_MEASUREMENT_DATA_NUM_1H] at 8/8/12 2:00:00 PM: java.sql.SQLException:Incorrect syntax near the keyword 'SELECT'.[SQLException=Incorrect syntax near the keyword 'SELECT'. -> Incorrect syntax near ')'.(error-code=102,sql-state=42000)]

                 

                I don't know if this could be the reason. At least there are no errors appearing to the log constantly every minute, although my measurements should be collected every minute.

                I don't what is the reason for these errors. In rhq-server.properties I have

                ...

                rhq.server.database.type-mapping=SQLServer

                ...

                hibernate.dialect=org.hibernate.dialect.SQLServerDialect

                ...

                • 5. Re: Alerts not firing in RHQ
                  mazz

                  > rhq.server.database.type-mapping=SQLServer

                   

                  Ahhh.... I think you will want to read this (specifically the big red box):

                   

                  https://docs.jboss.org/author/display/RHQ/Microsoft+SQL+Server

                  • 6. Re: Alerts not firing in RHQ
                    mazz

                    and this:

                     

                    https://docs.jboss.org/author/display/RHQ/Design+-+MS+SQL+Server+DB+backend

                     

                    and this:

                     

                    https://bugzilla.redhat.com/show_bug.cgi?id=RHQ-2142

                     

                    This work was done a couple years ago and, while most worked as a proof-of-concept, it was never completed (thus why the big red box says don't use SQL Server as your backend in a production environment).

                     

                    As I understand it, SQL Server doesn't support MVCC and that caused a lot of problems, some of which weren't solved, and it had some weird locking (something about it only does table locking with some kind of special row locking only being introduced in MSSQL 2005 via some database setting?? I don't know the details, this is based on memories several years old ). SQL Server is just not as good a DB to work with compared with Oracle or Postgres (I've not worked with it personally, but that's what I gathered to be the case listening to Joe complain almost daily when he was working on this )

                     

                    Thus, the recommended solution: switch to Postgres or Oracle.

                    • 7. Re: Alerts not firing in RHQ
                      mkel

                      Executing "ALTER DATABASE rhq SET READ_COMMITTED_SNAPSHOT ON" solved this problem.

                      Thank you.