Ad Widget

Collapse

Failed create plugin zabbix agent 2 with windows 10/11

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Kendżi
    Junior Member
    • Feb 2025
    • 2

    #1

    Failed create plugin zabbix agent 2 with windows 10/11

    Hi, need help. I want to write a plugin for windows 10/11 in Go programming language.
    I'm using the plugin development documentation (https://www.zabbix.com/documentation...plugins/how_to) and after taking all the steps, I can't restart the agent because the added configuration file to the “C:\Program Files\Zabbix Agent 2\zabbix_agent2.d\plugins.d” directory blocks this possibility. After removing the .conf file, the agent restarts normally.

    I stated that I might refer to the .exe file generated by the program, but that doesn't work either. I did it this way:
    UserParameter=myip,C:\PluginZabbix\myip.exe
    Now, if I want to run this program I have this error:
    C:\Program Files\Zabbix Agent 2>zabbix_agent2 -t myip
    myip [s|panic: failed to create plugin handler no socket provided

    goroutine 1 [running]:
    main.main()
    C:/PluginZabbix/main.go:47 +0x245]

    I still tried another way to run the plugin, using zabbix_get, here I used two cmd consoles. To take advantage of this, I had to disable the zabbix agent 2 service to be able to run it in the console.
    1 console:
    C:\Program Files\Zabbix Agent 2>zabbix_agent2.exe
    Starting Zabbix Agent 2 (7.2.3)
    Zabbix Agent2 hostname: [MY DESKTOP NAME]
    Press Ctrl+C to exit.

    2 console:
    C:\Program Files\Zabbix Agent 2>zabbix_get -s 127.0.0.1 -k myip
    zabbix_get [10732]: Get value error: cannot read from socket: [0x00002745] Nawi─ůzane po┼é─ůczenie zosta┼éo przerwane przez oprogramowanie zainstalowane w komputerze-ho┼Ťcie.
    This communicate in english: "the established connection was interrupted by software installed on the host computer".
    here I still tried ip host typing but there is also an error

    ​​
    I tried off firewall on my computer, and I have the same problems.

    This is my file config agent, I cut all comments:
    LogFile=C:\Program Files\Zabbix Agent 2\zabbix_agent2.log
    Server= [ip address]
    ServerActive=127.0.0.1
    Hostname=MY DESKTOP NAME
    Include=C:\Program Files\Zabbix Agent 2\zabbix_agent2.d\
    ControlSocket=\\.\pipe\agent.sock
    Include=.\zabbix_agent2.d\plugins.d\*.conf
    UserParameter=myip,C:\PluginZabbix\myip.exe

    Maybe the configuration file needs to be changed?

    Can someone help me solve this problem? I would like to run this zabbix plugin on my local computer but I don't know how to do it.​​
Working...