Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (Flatly)
  • No Skin
Collapse
Brand Logo

NetXMS Forum

  1. Home
  2. Support
  3. WMI Query to monitor eventviewer

WMI Query to monitor eventviewer

Scheduled Pinned Locked Moved Support
9 Posts 4 Posters 52.7k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • H
    H
    Luiz A. Camilo
    wrote on last edited by
    #1

    Hi there,

    I´m using this WMI Query to monitor if a particular event happened on windows eventviewer.

    WMI.Query(root\CIMV2\, Select * from Win32_NTLogEvent Where Logfile = 'Application' and EventType = '1' and EventCode = '9006')

    The query works great fine, but in WMI it returns several Rows, and I believe that netxms doesn´t know how to deal with those results. So I tried to "Count", but in WMI Count is a property, and not a function. So I cannot make changes in WMI side.

    I´m looking for clarification if this is supported in Netxms, or if can I use a transformation script or something like this to get a number of rows, or a value that Netxms can understand and display.

    Ideas are great apreciated.

    Thanks in advance

    1 Reply Last reply
    0
    • V
      V
      Victor Kirhenshtein
      wrote on last edited by
      #2

      Hi!

      Looks like it is not possible with current implementation of WMI.Query. I'll take a closer look at it in a few days - looks like this functionality can be added with simple changes in WMI subagent.

      Best regards,
      Victor

      1 Reply Last reply
      0
      • V
        V
        Victor Kirhenshtein
        wrote on last edited by
        #3

        Hi!

        I have added special option to get number of rows in WMI query result set - if you give %%count%% as property name, agent will return number of rows.

        Best regards,
        Victor

        1 Reply Last reply
        0
        • L
          L
          lindeamon
          wrote on last edited by
          #4

          hi victor,

          was it implemented in v1.1.6 ?

          Best Regards,
          lindeamon

          1 Reply Last reply
          0
          • V
            V
            Victor Kirhenshtein
            wrote on last edited by
            #5

            No, I do it today. Version 1.1.7 will include this feature. If it is needed right now, I van make cudtom build of agent.

            Best regards,
            Victor

            1 Reply Last reply
            0
            • L
              L
              lindeamon
              wrote on last edited by
              #6

              hi victor,

              there is no necessary need for now.
              i can wait for the new version.

              Best Regards,
              Lindeamon

              1 Reply Last reply
              0
              • L
                L
                lindeamon
                wrote on last edited by
                #7

                hi victor,

                what about snmp ? can you create something like this for snmp queries ?

                Best Regards,
                Lindeamon

                1 Reply Last reply
                0
                • D
                  D
                  denser.ru
                  wrote on last edited by
                  #8

                  @victor said in WMI Query to monitor eventviewer:

                  Hi!

                  I have added special option to get number of rows in WMI query result set - if you give %%count%% as property name, agent will return number of rows.

                  Best regards,
                  Victor

                  in result - where i should give %%count%% ? What field of DCC?

                  WMI.Query(root\CIMV2\, Select %%count%% from Win32_NTLogEvent Where Logfile = 'System' and EventType = '3' and EventCode = '1020')
                  

                  like this?

                  1 Reply Last reply
                  0
                  • V
                    V
                    Victor Kirhenshtein
                    wrote on last edited by
                    #9

                    Hi!

                    It should be like this:

                    WMI.Query(root\CIMV2\, Select * from Win32_NTLogEvent Where Logfile = 'System' and EventType = '3' and EventCode = '1020',%%count%%)
                    

                    Best regards,
                    Victor

                    1 Reply Last reply
                    0

                    Hello! It looks like you're interested in this conversation, but you don't have an account yet.

                    Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

                    With your input, this post could be even better 💗

                    Register Login
                    Reply
                    • Reply as topic
                    Log in to reply
                    • Oldest to Newest
                    • Newest to Oldest
                    • Most Votes


                    • Login

                    • Don't have an account? Register

                    • Login or register to search.
                    Powered by NodeBB Contributors
                    • First post
                      Last post
                    0
                    • Categories
                    • Recent
                    • Tags
                    • Popular
                    • Users
                    • Groups