Ad Widget

Collapse

Custom LLD Failure

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • plui
    Junior Member
    • Sep 2016
    • 10

    #1

    Custom LLD Failure

    I wrote a script that queries a DB to output a JSON similar to the following:

    Code:
    {
    "data":[
    { "{#DBNAME}":"CustomerA", "{#TESTNAME}":"system1"},
    { "{#DBNAME}":"CustomerA", "{#TESTNAME}":"system2"},
    { "{#DBNAME}":"CustomerA", "{#TESTNAME}":"system3"},
    { "{#DBNAME}":"CustomerB", "{#TESTNAME}":"system1"},
    { "{#DBNAME}":"CustomerB", "{#TESTNAME}":"system2"},
    { "{#DBNAME}":"CustomerB", "{#TESTNAME}":"system3"},
    { "{#DBNAME}":"CustomerC", "{#TESTNAME}":"system1"},
    { "{#DBNAME}":"CustomerD", "{#TESTNAME}":"system1"},
    { "{#DBNAME}":"CustomerE", "{#TESTNAME}":"system1"},
    { "{#DBNAME}":"CustomerE", "{#TESTNAME}":"system2"},
    { "{#DBNAME}":"CustomerE", "{#TESTNAME}":"system3"},
    { "{#DBNAME}":"CustomerE", "{#TESTNAME}":"system4"},
    { "{#DBNAME}":"CustomerF", "{#TESTNAME}":"system1"},
    { "{#DBNAME}":"CustomerG", "{#TESTNAME}":"system1"}
      ]
    }
    I setup the type as "Zabbix agent". Problem is that it seems like the results get cutoff sometimes. I would get up to CustomerE and then the rest of the output will get lost when I look at the items that get created from this discovery. I have also tried "Zabbix agent active" neither works. I have increased the timeout on both the agent and the server to 30 seconds instead of 3 but still no change.

    I then proceeded to try setting up a Discovery with the Trapper type. I have reformatted the file as the follow:

    Code:
    "hostA" "testSender" { "data":[ { "{#DBNAME}":"CustomerA", "{#TESTNAME}":"system1"},{ "{#DBNAME}":"CustomerA", "{#TESTNAME}":"system2"},{ "{#DBNAME}":"CustomerA", "{#TESTNAME}":"system3"},{ "{#DBNAME}":"CustomerB", "{#TESTNAME}":"system1"},{ "{#DBNAME}":"CustomerB", "{#TESTNAME}":"system2"},{ "{#DBNAME}":"CustomerB", "{#TESTNAME}":"system3"},{ "{#DBNAME}":"CustomerC", "{#TESTNAME}":"system1"},{ "{#DBNAME}":"CustomerD", "{#TESTNAME}":"system1"},{ "{#DBNAME}":"CustomerE", "{#TESTNAME}":"system1"},{ "{#DBNAME}":"CustomerE", "{#TESTNAME}":"system2"},{ "{#DBNAME}":"CustomerE", "{#TESTNAME}":"system3"},{ "{#DBNAME}":"CustomerE", "{#TESTNAME}":"system4"},{ "{#DBNAME}":"CustomerF", "{#TESTNAME}":"system1"},{ "{#DBNAME}":"CustomerG", "{#TESTNAME}":"system1"}  ]}
    Then make the following call:

    Code:
    zabbix_sender -z localhost -i /tmp/out2.txt -vv
    I get the following output:

    Code:
    zabbix_sender [1158]: DEBUG: answer [{"response":"success","info":"processed: 0; failed: 1; total: 1; seconds spent: 0.000099"}]
    info from server: "processed: 0; failed: 1; total: 1; seconds spent: 0.000099"
    sent: 1; skipped: 0; total: 1
    The server log, even with trace turned on, didn't show reasons why it failed:

    Code:
    27332:20161115:103919.830 trapper got '{"request":"sender data","data":[{"host":"hostA","testSender","value":"-----SNIP------
    27332:20161115:103919.830 In recv_agenthistory()
     27332:20161115:103919.830 In process_hist_data()
     27332:20161115:103919.830 In process_mass_data()
     27332:20161115:103919.830 End of process_mass_data()
     27332:20161115:103919.830 End of process_hist_data():SUCCEED
     27332:20161115:103919.830 In zbx_send_response()
     27332:20161115:103919.831 zbx_send_response() '{"response":"success","info":"processed: 0; failed: 1; total: 1; seconds spent: 0.000117"}'
     27332:20161115:103919.831 End of zbx_send_response():SUCCEED
     27332:20161115:103919.831 End of recv_agenthistory()
    I'm stuck...I can run the first script perhaps twice a day so it won't put a huge load on the server. I would prefer running the script directly instead of using trapper if possible. At this point, I just want to get it to work..

    Any help will be much appreciated!
  • plui
    Junior Member
    • Sep 2016
    • 10

    #2
    Bump.

    Anyone has any idea?

    Comment

    • plui
      Junior Member
      • Sep 2016
      • 10

      #3
      Bump

      Comment

      • nobodysu
        Member
        • Sep 2016
        • 84

        #4
        Contents of /tmp/out2.txt please?

        Comment

        Working...