Ad Widget

Collapse

Issue with IIS app pool monitoring on version 4.2.3 using powershell

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • BryceCombs
    Junior Member
    • Nov 2019
    • 1

    #1

    Issue with IIS app pool monitoring on version 4.2.3 using powershell

    Hello everyone,

    In the past, we have been using this code through a discovery rule to find App Pools to monitor. We recently updated the zabbix agent on a server to match our current version of Zabbix (version 4.2.3). What we have found now is that we get the below error.

    Invalid discovery rule value: cannot parse as a valid JSON object: invalid object format, expected opening character '{' or '[' at: 'Get-ChildItem : Cannot retrieve the dynamic parameters for the cmdlet.
    Retrieving the COM class factory for component with CLSID
    {688EEEE5-6A7E-422

    Is there anything within Zabbix that has changed which would prevent the code from executing correctly? I have confirmed that running this code in a powershell session returns the expected results.

    Regards.
  • valentins.grins
    Member
    • Nov 2019
    • 38

    #2
    Hello,

    There was changes in communication protocol for LLD since version Zabbix 4.2. Please check it here. https://www.zabbix.com/documentation...rade_notes_420.

    Comment


    • mellis
      mellis commented
      Editing a comment
      I wrote a simple vb script to monitor apppools that allows you to pass the apppool as a command line parameter


      script:

      'Set Bugs Off
      'Do What I am Thinking
      'Name of the AppPool to Check
      strAppPool = WScript.Arguments.Item(0)
      'Name of the uptime service monitor
      'The Alert level to set
      intAlertLevel = 1

      Set oShell = CreateObject("WScript.Shell")

      Set oWebAdmin = GetObject("winmgmts:root\WebAdministration")
      Set oAppPool = oWebAdmin.Get("ApplicationPool.Name='" & strAppPool & "'")
      ' Get the application pool's name and its state.

      If oAppPool.GetState = 1 Then
      varServiceStatus = 0
      Wscript.Echo varServiceStatus
      Else
      varServiceStatus = intAlertLevel
      Wscript.Echo varServiceStatus
      End If


      agent config:

      #Set Bug Off
      #Do What I am Thinking

      UserParameter = custom.AppPool[*], cscript "C:\Program Files\Zabbix Agent\CheckAppPool.vbs" $1 //nologo


      trigger:

      if apppool is not 0 then triggr

    • BryceCombs
      BryceCombs commented
      Editing a comment
      Hello,

      Thank you for the information. I am currently still working to find the correct solution to resolve this issue.

    • BryceCombs
      BryceCombs commented
      Editing a comment
      We have made some changes to the code and trying a different approach. The new code can be found here (https://paste.ofcode.org/E7Rmz6uw77XLvYJUjawsPf) We are now getting the below error.

      Cannot create item: item with the same key "apppool.state[{#APPPOOL}]" already exists.
      Cannot create item: item with the same key "apppool.state[{#APPPOOL}]" already exists.
      Cannot create item: item with the same key "apppool.state[{#APPPOOL}]" already exists.
      Cannot create item: item with the same key "apppool.state[{#APPPOOL}]" already exists.
      Cannot create item: item with the same key "apppool.state[{#APPPOOL}]" already exists.
      Cannot create item: item with the same key "apppool.state[{#APPPOOL}]" already exists.
      Cannot create item: item with the same key "apppool.state[{#APPPOOL}]" already exists.
      Cannot create item: item with the same key "apppool.state[{#APPPOOL}]" already exists.
      Cannot create item: item with the same key "apppool.state[{#APPPOOL}]" already exists.
      Cannot create item: item with the same key "apppool.state[{#APPPOOL}]" already exists.

      Zabbix is working properly because there are 10 app pools that need to be monitored, it's just not finding the name of the app pool. Any advice here?

      Edit: Reapplied our App Pool Monitoring template and now the discovery rule is working as expected!
      Last edited by BryceCombs; 20-11-2019, 21:26.
Working...