Ad Widget

Collapse

LLD behavior question

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • solk
    Junior Member
    • Nov 2019
    • 5

    #1

    LLD behavior question

    Hi

    I'm trying to understand how LLD works.
    (zabbix v4.2.8)

    I'll create UserParameter:
    Code:
    UserParameter=test.discovery[*],/usr/local/bin/test.discovery '$1'
    Bash script /usr/local/bin/test.discovery contains:
    Code:
    #!/bin/bash
    
    if [ -z "${1}" ] ; then
      echo '{"data":[{"{#UNIXTIME}":"System UNIX time","{#NANOSEC}":"System nanoseconds"}]}'
    elif [ "${1}" = "System UNIX time" ] ; then
      /bin/date +%s
    elif [ "${1}" = "System nanoseconds" ] ; then
      /bin/date +%N
    fi
    When i ask from agent with
    sudo -uzabbix zabbix_agentd -t test.discovery
    Result will be:
    Code:
    test.discovery                                [t|{"data":[{"{#UNIXTIME}":"System UNIX time","{#NANOSEC}":"System nanoseconds"}]}]
    So far, so good. Now i create template with 2 item prototypes:

    Click image for larger version

Name:	2.png
Views:	194
Size:	35.4 KB
ID:	390814
    Everything seems to be OK, and after i assign template to host, items will be discovered and data starts to come in:
    Click image for larger version

Name:	3.png
Views:	120
Size:	18.6 KB
ID:	390815
    Now i'll create third item prototype in template:
    Click image for larger version

Name:	4.png
Views:	122
Size:	49.6 KB
ID:	390816

    And after that discovery rule gives me an error:
    Click image for larger version

Name:	5.png
Views:	122
Size:	36.0 KB
ID:	390817
    So, now, template contains item prototype which macro name that does not exist on agent side.

    Why does it give me error? I mean, should it be the whole point on "discovery" for some items to be discovered and some not?
    Is'nt it so that template can contain mote item prototypes than agent data?
Working...