Ad Widget

Collapse

Zabbix sender failed due to :space: character within key name

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • tsolev
    Junior Member
    • Mar 2022
    • 7

    #1

    Zabbix sender failed due to :space: character within key name

    Hi all,
    I have configured low level discovery for specific Linux directories in order to calculate their sizes, but I'm forced to use zabbix_sender, as the built in key "vfs.dir.size" takes a lot of time to calculate and eventually times out.
    So, it is working correctly for keys, not containing :space: characters (refer to the attached screenshots):

    $ cat test2.out
    Jenkins jenkins_jobs_lev1["/data/jenkins/jobs/VIEW/jobs/Emplacement-Viewer-Testserver"] 10929

    $ zabbix_sender -v -z zsrvr.local -i test2.out
    Response from "zsrvr.local:10051": "processed: 1; failed: 0; total: 1; seconds spent: 0.000064"
    sent: 1; skipped: 0; total: 1

    But it is failing for a similar key, which contains 1 or more space characters (refer to the attached screenshots):

    $ cat test3.out
    Jenkins jenkins_jobs_lev1["/data/jenkins/jobs/VIEW/jobs/Versioning Test"] 2037866

    $ zabbix_sender -v -z zsrvr.local -i test3.out
    Response from "zsrvr.local:10051": "processed: 0; failed: 1; total: 1; seconds spent: 0.000019"
    sent: 1; skipped: 0; total: 1

    Versions:
    zabbix_server: 5.4.7
    zabbix_sender: 5.4.7

    I have read the zabbix_sender man page and it says:

    Contents of the input file must be in the UTF-8 encoding. Entries must be formatted using the following rules:
    ...
    · Quoted and non-quoted entries are supported.
    · Double-quote is the quoting character.
    · Entries with whitespace must be quoted.
    ...

    Any suggestions are welcome.
    Thank you!
  • tsolev
    Junior Member
    • Mar 2022
    • 7

    #2
    Is there no solution?

    Comment

    • tim.mooney
      Senior Member
      • Dec 2012
      • 1427

      #3
      Is there anything logged in the zabbix_server.log at the time that you attempt sending the one that doesn't work?

      If not (or even if there is, but it's not useful), have you tried briefly increasing the server logging, before testing, to see if there's a clue logged?

      Also, 5.4.12 is the current latest in the Zabbix 5.4 series. Have you looked at the release notes for 5.4.8 through 5.4.12, to see if your specific problem is mentioned?

      Comment

      • cyber
        Senior Member
        Zabbix Certified SpecialistZabbix Certified Professional
        • Dec 2006
        • 4807

        #4
        You are quoting part of the item (parameters), not whole item... I think you should try with

        Code:
        Jenkins "jenkins_jobs_lev1[\"/data/jenkins/jobs/VIEW/jobs/Versioning Test\"]" 2037866
        Double-quote and backslash characters inside quoted entry must be escaped with a backslash.

        Comment

        • tsolev
          Junior Member
          • Mar 2022
          • 7

          #5
          tim.mooney : Thanks for the suggestion, the post by cyber fixed the problem.
          cyber : your suggestions work like a charm! Thank you very much!!!

          So, to sum it up:

          Code:
          jenkins_server "key[\"/data/path with spaces\"]" value
          zabbix_sender -v -z zsrvr.local -i test3.out

          Response from "zsrvr.local:10051": "processed: 1; failed: 0; total: 1; 0.000042"
          sent: 1; skipped: 0; total: 1

          Comment

          Working...