Ad Widget

Collapse

Zabbix LLDiscovery Behavior

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Hackedia
    Junior Member
    • Jun 2018
    • 4

    #1

    Zabbix LLDiscovery Behavior

    Helllo Guys !

    Im using Zabbix 3.2 on CentOS7 with an oracle 11G on CentOS7.
    Im trying to auto discover tablespaces and check informations about spacedisk (free, total, %used), but my implementation dont work, after a lot of research i decieded to ask here, cause im not far from succeed !

    So i create a template "Tablespace" with one LLD rule and 3 ITEMS as below :

    The key of the LLD rule (type = zabbix agent, no maccro created) :
    oracle.tbs.discovery[{#BDDNAME},{#TBSNAME}]

    The key of the 3 items :
    oracle.tbs[{#BDDNAME},{#TBSNAME},free]
    oracle.tbs[{#BDDNAME},{#TBSNAME},pused]
    oracle.tbs[{#BDDNAME},{#TBSNAME},total]


    The script associated with the LLD rule is named "otbs.discovery.sh", he return a valid JSON format like this :
    Code:
    {
            "data":[
                    {"{#BDDNAME}":"ORA11G1","{#TBSNAME}":"UNDOTBS1"},
                    {"{#BDDNAME}":"ORA11G1","{#TBSNAME}":"SYSAUX"},
                    {"{#BDDNAME}":"ORA11G1","{#TBSNAME}":"USERS"},
                    {"{#BDDNAME}":"ORA11G1","{#TBSNAME}":"SYSTEM"},
                    {"{#BDDNAME}":"ORA11G1","{#TBSNAME}":"EXAMPLE"},
                    {"{#BDDNAME}":"ORA11G2","{#TBSNAME}":"UNDOTBS1"},
                    {"{#BDDNAME}":"ORA11G2","{#TBSNAME}":"SYSAUX"},
                    {"{#BDDNAME}":"ORA11G2","{#TBSNAME}":"USERS"},
                    {"{#BDDNAME}":"ORA11G2","{#TBSNAME}":"SYSTEM"},
                    {"{#BDDNAME}":"ORA11G2","{#TBSNAME}":"EXAMPLE"}
            ]
    }
    The script of the items is supposed to retrieve this informations from the items and give back an information in bytes.
    Here are the UserParameters from the configuration file of the agent :
    UnsafeUserParameters=1 #=> To avoir special characters errors
    UserParameter=oracle.tbs.discovery[*],/usr/local/zabbix/libexec/otbs.discovery.sh
    UserParameter=oracle.tbs[*],/usr/local/zabbix/libexec/otbs.sh $1 $2 $3


    So i create an host using this template,
    The discovery rule is on a good state, the format json is correct.
    The items is supposed to execute the scripts with this arguments : {#BDDNAME},{#TBSNAME},free
    Thoses maccros are supposed to get swifted with the value of the JSON list, but actually this is not happening and the item try to execute the script with this arguments in plain text.

    I tryed to add maccros on the host but i dont understand what is the difference of this typo : {#TBSNAME}; and this one : {$TBSNAME}.


    Do you have an idea of what is going wrong between the rule and the items ? I get the item key typo from a forum.

    Thanks for all and have a nice day !
  • Hackedia
    Junior Member
    • Jun 2018
    • 4

    #2
    Okay guys, i just answer my question by myself.

    I had to create Items prototypes from the discovery rule instead of classic items i'd create on the template !

    Thanks for all, i hope this help for someone !

    Comment

    Working...