5 Replies Latest reply on Jun 26, 2017 9:06 AM by mesverrum

    Query not working correctly

    rmurphy1313

      Here is the query i put in swql studio

       

      SELECT E0.[Uri], E0.[DisplayName], E0.[Node].[Caption]

      FROM Orion.NPM.Interfaces

      WHERE ( ( E0.[Caption] NOT  LIKE '%Bundle-Ether%' ) AND ( E0.[Caption] NOT  LIKE '%Bundle1%' ) AND ( E0.[Caption] NOT  LIKE '%BVI%' ) AND ( E0.[Caption] NOT  LIKE '%EOBC%' ) AND ( E0.[Caption] NOT  LIKE '%Vlan%' ) AND ( E0.[Caption] NOT  LIKE '%.%' ) AND ( E0.[OutErrorsDiscardsThreshold].[CurrentValue] > '2500' ) AND ( E0.[InErrorsDiscardsThreshold].[CurrentValue] > '2500' ) AND ( ( E0.[Caption] LIKE 'HundredGigE%' ) OR ( E0.[Caption] LIKE 'TenGigE%' ) OR ( E0.[Node].[Caption] LIKE '%Bundle1%'0 ) OR ( E0.[Node].[Caption] LIKE '%Bundle1%'1 ) OR ( E0.[Node].[Caption] LIKE '%Bundle1%'2 ) OR ( E0.[Node].[Caption] LIKE '%Bundle1%'3 ) OR ( E0.[Node].[Caption] LIKE '%Bundle1%'4 ) OR ( E0.[Node].[Caption] LIKE '%Bundle1%'5 ) OR ( E0.[Node].[Caption] LIKE '%Bundle1%'6 ) OR ( E0.[Node].[Caption] LIKE '%Bundle1%'7 ) OR ( E0.[Node].[Caption] LIKE '%Bundle1%'8 ) OR ( E0.[Node].[Caption] LIKE '%Bundle1%'9 ) OR ( E0.[Node].[Caption] = '%BVI%'0 ) ) )

       

      I get this error

      Anyone have any suggestions that would help?

        • Re: Query not working correctly
          mesverrum

          I cleaned up some of what I assume were copy/paste artifacts or something, also you kept referencing the E0 table but never actually defined it, at this point it does execute in swql studio without errors, hopefully this is what you were looking for.  The where conditions results in no hits in my lab but there are so many bits in the where filter that I wasn't inclined to pick them apart to validate it.

           

           

          SELECT E0.[Uri], E0.[DisplayName], E0.[Node].[Caption]

          FROM Orion.NPM.Interfaces E0

          WHERE ( ( E0.[Caption] NOT  LIKE '%Bundle-Ether%' ) AND ( E0.[Caption] NOT  LIKE '%Bundle1%' ) AND ( E0.[Caption] NOT  LIKE '%BVI%' ) AND ( E0.[Caption] NOT  LIKE '%EOBC%' ) AND ( E0.[Caption] NOT  LIKE '%Vlan%' ) AND ( E0.[Caption] NOT  LIKE '%.%' ) AND ( E0.[OutErrorsDiscardsThreshold].[CurrentValue] > '2500' ) AND ( E0.[InErrorsDiscardsThreshold].[CurrentValue] > '2500' ) AND ( ( E0.[Caption] LIKE 'HundredGigE%' ) OR ( E0.[Caption] LIKE 'TenGigE%' ) OR ( E0.[Node].[Caption] LIKE '%Bundle1%' ) OR ( E0.[Node].[Caption] LIKE '%Bundle1%' ) OR ( E0.[Node].[Caption] LIKE '%Bundle1%' ) OR ( E0.[Node].[Caption] LIKE '%Bundle1%' ) OR ( E0.[Node].[Caption] LIKE '%Bundle1%' ) OR ( E0.[Node].[Caption] LIKE '%Bundle1%' ) OR ( E0.[Node].[Caption] LIKE '%Bundle1%' ) OR ( E0.[Node].[Caption] LIKE '%Bundle1%' ) OR ( E0.[Node].[Caption] LIKE '%Bundle1%' ) OR ( E0.[Node].[Caption] LIKE '%Bundle1%' ) OR ( E0.[Node].[Caption] = '%BVI%' ) ) )

          1 of 1 people found this helpful
          • Re: Query not working correctly
            rmurphy1313

            so here is the actual query that I am trying to trigger on an interface, Would you look at it and let me know if /what is missing.

             

              • Re: Query not working correctly
                mesverrum

                So you are just looking for interfaces with rx/tx errors above 2500 and trying to exclude a ton of interfaces.  Don't know how big your environment is but I would suggest that maybe instead of having 20 conditions you just create a custom property on interfaces and tag the ones you care about.  Call it Critical_Interfaces or whatever makes sense.

                1 of 1 people found this helpful
                  • Re: Query not working correctly
                    rmurphy1313

                    My environment is very large. This is just one instance, the nodes with the names that start with the 3 letters are the only devices they want them triggered on for now. This is to trigger only on 10GigE and 100GigE interfaces on those devices.

                     

                    My concern was that on the sas devices I see there is traffic but they haven't triggered the errors and I am not sure if they will, only because they are not as prone to those type of errors as the other devices are.

                    • Re: Query not working correctly
                      mesverrum

                      And thinking about it, you probably want to do an or condition regarding the errors, since you would very rarely have inbound and outbound errors going nuts at the same time

                      1 of 1 people found this helpful