Ad Widget

Collapse

AutoIt zabbix_sender from script

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • 753713
    Senior Member
    • Apr 2006
    • 137

    #1

    AutoIt zabbix_sender from script

    nice Funktion:
    you can send Data from AutoIt script to Zabbix Server (zabbix_sender funktionality)

    Script:
    Global $ConnectedSocket, $szData
    Global $szIPADDRESS = "zabbix_server_IP_or name"
    Global $nPORT = 10051


    Example("{""request"":""agent data"",""data"":[{""host"":""Servername"",""key"":""log"",""value"" :""hallo!!!""}]}")



    ;Function Zabbix Sender
    ;Example("{""request"":""agent data"",""data"":[{""host"":""Host_name"",""key"":""Item_KEY"",""val ue"":""Value_to_Send""}]}")
    Func Example($szData)

    TCPStartup()
    $ConnectedSocket = -1
    $ConnectedSocket = TCPConnect($szIPADDRESS, $nPORT)

    TCPSend($ConnectedSocket, StringToBinary($szData, 4))

    EndFunc
    ;End Funktion
    ______________________________
    Version : 2.0.x
    Server OS: Ubuntu 12.04
    Zabbix Servers: 12
    Monitored Windows Server: ~ 1000
    ______________________________
  • araneon
    Junior Member
    • Apr 2016
    • 28

    #2
    Has anyone used this?

    Comment

    • boyemillar
      Member
      Zabbix Certified Specialist
      • Nov 2015
      • 33

      #3
      AutoIT

      I use AutoIT to send a number of different stats into Zabbix from our windows Server Hosts...

      What do you need to know...?

      Comment

      • araneon
        Junior Member
        • Apr 2016
        • 28

        #4
        Thanks for the answer.
        How to interact and what should be on the server zabbix nastroino for such work. And another question, whether it is possible to receive data through Autoit for example of a trigger condition
        thanks for the answer

        Comment

        • boyemillar
          Member
          Zabbix Certified Specialist
          • Nov 2015
          • 33

          #5
          One of our scripts captures the seconds of difference on an interface via an AutoIT script (i wont give you the full script as it's complicated) and then the figure gets passed into Zabbix.

          The Windows Server needs to have the Zabbix Service installed with the zabbix_sender.exe and stored locally (I have this in the C:\zabbix folder along with the zabbix_agentd.win.conf configuration file). The zabbix_sender.dll also has to be on the server too

          You need to create a new item on the Host where you want the data

          Name = MYITEM
          Type = Zabbix trapper
          Key = MYITEM
          Type of Information = Numeric(float)
          Units = s

          Create a script on any windows PC and then Compile it using AutoIT and place it on your Windows Server. I then normally trigger the script using a Windows Task Scheduler or some of our other scripts are triggered by MS SQL Agent Jobs.

          AutoIT script example

          Code:
          #include <File.au3>
          #include <FileConstants.au3>
          #include <Array.au3>
          #include <Date.au3>
          
          $Difference = "86400"
          
          Runwait("C:\zabbix\zabbix_sender.exe" & ' -c ' & "C:\zabbix\zabbix_agentd.win.conf" & ' -s SERVERNAME -k MYITEM-o ' & $Difference, '', @SW_HIDE, 2)
          Just replace the SERVERNAME above with your servers name... You can just run it manually and the value should appear on your host item within Zabbix.

          I've never used Zabbix Get to retrieve a value from Zabbix back into AutoIT but that should work fine too.

          Comment

          • araneon
            Junior Member
            • Apr 2016
            • 28

            #6
            Thank you very much!
            Be sure to try.

            Comment

            • anakoliveira
              Junior Member
              • Nov 2019
              • 1

              #7
              Hello guys.

              I have a doubt about creating Zabbix Trapper to push another monitoring results.
              My project is to push the results of Geneos monitoring to Zabbix. I saw a function called Trapper and I think it can help to do it. Can someone help me?

              Comment

              Working...