Ad Widget

Collapse

zabbix_sender skipping records in datafile

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • guest-X
    Junior Member
    • Oct 2010
    • 11

    #1

    zabbix_sender skipping records in datafile

    Looks like something wrong with zabbix_sender.

    I'm trying to send data from a datafile like this:

    c:\util\zabbix> type zabbix.tmp
    vserv.domain.local raid.status Ok
    vserv.domain.local disk0.status Ok
    vserv.domain.local disk1.status Ok
    vserv.domain.local disk2.status Ok
    vserv.domain.local disk3.status Ok


    But:
    C:\util\zabbix>zabbix_sender.exe -v -c C:\util\zabbix\zabbix_agentd.conf -i C:\util\zabbix\zabbix.tmp
    zabbix_sender.exe [11728]: Warning: [line 1] 'Key' required
    zabbix_sender.exe [11728]: Warning: [line 2] 'Hostname' required
    zabbix_sender.exe [11728]: Warning: [line 3] 'Hostname' required
    zabbix_sender.exe [11728]: Warning: [line 4] 'Hostname' required
    zabbix_sender.exe [11728]: Warning: [line 5] 'Hostname' required
    zabbix_sender.exe [11728]: Warning: [line 6] 'Hostname' required
    sent: 0; skipped: 6; total: 6


    What does it mean?

    Sending data with -k and -o works perfectly:

    C:\util\zabbix>zabbix_sender.exe -c C:\util\zabbix\zabbix_agentd.conf -k raid.status -o ok
    Info from server: "Processed 1 Failed 0 Total 1 Seconds spent 0.000037"
    sent: 1; skipped: 0; total: 1


    May be something wrong with my data file?

    I run zabbix agent on Windows 2008 R2, zabbix_sender version:

    C:\util\zabbix>zabbix_sender.exe -V
    Zabbix Sender v1.8.13 (revision 27483) (11 May 2012)
    Compilation time: May 11 2012 17:18:33

    Any ideas?
  • Davidus
    Senior Member
    • Dec 2010
    • 281

    #2
    Try to add -z ZABBIX_SERVER_IP and -s HOST_NAME_GOES_HERE

    For more information see zabbix_sender manual page
    http://www.zabbix.com/documentation/...oncepts/sender
    Last edited by Davidus; 18-07-2012, 08:35.

    Comment

    • guest-X
      Junior Member
      • Oct 2010
      • 11

      #3
      Originally posted by Davidus
      Try to add -z ZABBIX_SERVER_IP and -s HOST_NAME_GOES_HERE

      For more information see zabbix_sender manual page
      http://www.zabbix.com/documentation/...oncepts/sender
      I've tried to. No result. The same error -- "'key' required" and "hostname required"

      Comment

      • eskytthe
        Senior Member
        Zabbix Certified Specialist
        • May 2011
        • 363

        #4
        As you write - look like something with your input file (End Of Line?).
        Maybe you can test the same on your zabbix server / a linux server?
        Br
        Erik

        Comment

        • ingo
          Junior Member
          • Jul 2012
          • 3

          #5
          I am experiencing the same problem. It occurs when trying to invoke zabbix_sender.exe V1.8.3 from a Windows powershell script which itself creates the input file für zabbix_sender.

          The pattern is always the same: Key error for first line of input file, Hostname error for the rest.
          ---
          zabbix_sender.exe [4468]: Warning: [line 1] 'Key' required
          zabbix_sender.exe [4468]: Warning: [line 2] 'Hostname' required
          zabbix_sender.exe [4468]: Warning: [line 3] 'Hostname' required
          zabbix_sender.exe [4468]: Warning: [line 4] 'Hostname' required
          zabbix_sender.exe [4468]: Warning: [line 5] 'Hostname' required
          zabbix_sender.exe [4468]: Warning: [line 6] 'Hostname' required
          (continues for every line of input file)
          ---
          Input file is:
          ---
          esx-cluster eqlvolume[pool2-vmfs-01,capacity] 500
          esx-cluster eqlvolume[pool2-vmfs-01,allocated] 413.7
          esx-cluster eqlvolume[pool2-vmfs-01,percentagefull] 82.74
          esx-cluster eqlvolume[pool2-vmfs-01,snapshotcount] 0
          peta eqlvolume[pool2-ntfs-01,capacity] 2560
          peta eqlvolume[pool2-ntfs-01,allocated] 2367.55
          ...
          ---

          It works fine when I use the same input file in a separate powershell script.

          Platform is Windows 2008R2 Standard Server.

          We are integrating Dell Equallogic Storage monitoring into Zabbix and I would be VERY happy if I could get this problem solved a.s.a.p.

          Comment

          • guest-X
            Junior Member
            • Oct 2010
            • 11

            #6
            Hmmm, the same platform, the same situation -- i call zabbix_sender from powershell script.

            My workarond -- I had to call zabbix_sender with -k and -o options every time instead of using data file. There are only 5 parameters and i update the info ever 30 minutes so there is no problem to call zabbix_sender 5 times from one script.

            Comment

            • ingo
              Junior Member
              • Jul 2012
              • 3

              #7
              Originally posted by guest-X
              Hmmm, the same platform, the same situation -- i call zabbix_sender from powershell script.

              My workarond -- I had to call zabbix_sender with -k and -o options every time instead of using data file. There are only 5 parameters and i update the info ever 30 minutes so there is no problem to call zabbix_sender 5 times from one script.
              I have more that 100 parameters and the update interval would be 30 minutes or even shorter. So I really should be using the input file...

              Comment

              • guest-X
                Junior Member
                • Oct 2010
                • 11

                #8
                Originally posted by ingo
                I have more that 100 parameters and the update interval would be 30 minutes or even shorter. So I really should be using the input file...
                What about create data file and then run separate ps script to just run zabbix_sender?

                Comment

                • ingo
                  Junior Member
                  • Jul 2012
                  • 3

                  #9
                  solution: zabbix_sender fails to submit data if input file is unicode

                  It turns out that zabbix_sender fails to transfer data if the input file is unicode. The safe workaround is to create an input file with check results, convert it to ASCII and then call zabbix_sender.

                  Creating the check result file in ASCII and appending in ASCII did not work.

                  A colleague found this out and implemented it like that:

                  Get-Content -Path "$unicodefile" | Out-File -FilePath "$asciifile" -Encoding "Default"

                  Comment

                  • richlv
                    Senior Member
                    Zabbix Certified Trainer
                    Zabbix Certified SpecialistZabbix Certified Professional
                    • Oct 2005
                    • 3112

                    #10
                    necroposting, but this thread was brought up on IRC today.

                    I'd suggest examining the file in binary mode - does contain some unexpected characters, maybe BOM ?

                    Zabbix loves utf8, that should not be an issue
                    Zabbix 3.0 Network Monitoring book

                    Comment

                    Working...