Uploaded image for project: 'ZABBIX BUGS AND ISSUES'
  1. ZABBIX BUGS AND ISSUES
  2. ZBX-27268

Agent 2: loadable plugins prevent agent runtime commands from working

XMLWordPrintable

      Description
      When the Zabbix Agent 2 service is started and plugins are loaded, a Windows named pipe (called PluginSocket in Zabbix) is created. This can be checked with:

      Get-ChildItem "\\.\pipe\" |
        Where-Object { $_.Name -like "agent.plugin*.sock" } |
        Select-Object @{Name='FullName';Expression={ '\\.\pipe\' + $_.Name }}
      

      Output:

      FullName
      --------
      \\.\pipe\agent.plugin.sock
      

      This pipe only appears when the zabbix_agent2_plugins package is installed.

      This is not a problem in the 6.0 or 6.4 releases, but in the 7.0 release (tested with 7.0.5 and 7.0.21), Agent 2 runtime commands try to create another pipe with the same name. It doesn’t matter whether PluginSocket is left at its default value or set manually - as long as we use the same configuration file, the runtime command attempts to reuse the same pipe name:

      PS C:\Program Files\Zabbix Agent 2> .\zabbix_agent2.exe -t agent.version
      zabbix_agent2 [3324]: ERROR: Cannot register plugins: failed to remove plugin socket, with path "\\\\.\\pipe\\agent.plugin.sock": CreateFile \\.\pipe\agent.plugin.sock: All pipe instances are busy.
      
      PS C:\Program Files\Zabbix Agent 2>
      

      Workaround
      1. Copy zabbix_agent2.conf to zabbix_agent2_test.conf
      2. Edit zabbix_agent2_test.conf and add the line:

      PluginSocket=\\.\pipe\agent.plugin.test.sock

      3. Save changes and restart the agent. In one terminal window, run:

      PS C:\Program Files\Zabbix Agent 2> .\zabbix_agent2.exe -c .\zabbix_agent2_test.conf -p

      4. While it's running, execute the following in a second terminal:

      Get-ChildItem "\\.\pipe\" |
        Where-Object { $_.Name -like "agent.plugin*.sock" } |
        Select-Object @{Name='FullName';Expression={ '\\.\pipe\' + $_.Name }}
      

      5. Result:

      FullName
      --------
      \\.\pipe\agent.plugin.sock
      \\.\pipe\agent.plugin.test.sock
      

      Expected result
      Runtime commands working whether Zabbix Agent 2 service is started or not.

            opucka Oskars Pucka
            mkudlacz Michal Kudlacz
            Team INT
            Votes:
            6 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated: