Ad Widget

Collapse

discovery based on zabbix trapper

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • umask
    Junior Member
    • Apr 2011
    • 6

    #1

    discovery based on zabbix trapper

    Hi!

    I need to collect iostat information on few FreeBSD hosts.
    Because iostat is long running process I run it and collect information about all disks during 60-120 seconds.

    Collected information (after formatting) passed to zabbix-server using zabbix_sender.

    Because I have few servers with different disks count I have to manually create mass of items per server. And now I'm trying use low level discovery...

    My question is:

    How I need pass to zabbix-server keys ({#DISKNAME}) which described in Discovery Rule with type Zabbix trapper?

  • umask
    Junior Member
    • Apr 2011
    • 6

    #2
    If I send data like this:

    # zabbix_sender -c /usr/local/etc/zabbix2/zabbix_agentd.conf -k system.iostat.discovery -v -s `hostname` -o '
    {
    "data":[
    {"{#DISKNAME}":"mfid0"},
    {"{#DISKNAME}":"mfid1"},
    {"{#DISKNAME}":"md0"},
    {"{#DISKNAME}":"cd0"},
    {"{#DISKNAME}":"pass0"}]}
    '
    Zabbix-server writes in log:
    17825:20121107:110048.802 Trapper got [{
    "request":"sender data",
    "data":[
    {
    "host":"web2.myhostname.net",
    "key":"system.iostat.discovery",
    "value":"\n{\n\"data\":[\n{\"{#DISKNAME}\":\"mfid0\"},\n{\"{#DISKNAME}\":\ "mfid1\"},\n{\"{#DISKNAME}\":\"md0\"},\n{\"{#DISKN AME}\":\"cd0\"},\n{\"{#DISKNAME}\":\"pass0\"}]}\n"}]}] le
    n 285
    17825:20121107:110048.802 In recv_agenthistory()
    17825:20121107:110048.802 In process_hist_data()
    17825:20121107:110048.802 In process_mass_data()
    17825:20121107:110048.802 In DBlld_process_discovery_rule() itemid:23685
    17825:20121107:110048.802 query [txnlev:0] [select hostid,key_,status,filter,error,lifetime from items where itemid=23685]
    17825:20121107:110048.802 In substitute_simple_macros() data:'30'
    17825:20121107:110048.802 query [txnlev:1] [begin;]
    17825:20121107:110048.803 query [txnlev:1] [select r.name,e.expression,e.expression_type,e.exp_delimi ter,e.case_sensitive from regexps r,expressions e where r.regexpid=e.regexpid and r.name='Disks for dis
    covery']
    17825:20121107:110048.803 DBlld_process_discovery_rule() f_macro:'{#DISKNAME}' f_regexp:'@Disks for discovery'
    17825:20121107:110048.803 In DBlld_update_items()
    17825:20121107:110048.804 query [txnlev:1] [select i.itemid,i.name,i.key_,i.type,i.value_type,i.data_ type,i.delay,i.delay_flex,i.history,i.trends,i.sta tus,i.trapper_hosts,i.units,i.multiplier,i.delta,i .fo
    rmula,i.logtimefmt,i.valuemapid,i.params,i.ipmi_se nsor,i.snmp_community,i.snmp_oid,i.port,i.snmpv3_s ecurityname,i.snmpv3_securitylevel,i.snmpv3_authpa ssphrase,i.snmpv3_privpassphrase,i.authtype,i.user name,
    i.password,i.publickey,i.privatekey,i.description, i.interfaceid from items i,item_discovery id where i.itemid=id.itemid and id.parent_itemid=23685]
    17825:20121107:110048.804 In DBlld_check_record() jp_row:'{"{#DISKNAME}":"mfid0"}'
    17825:20121107:110048.804 End of DBlld_check_record():FAIL
    17825:20121107:110048.804 In DBlld_check_record() jp_row:'{"{#DISKNAME}":"mfid1"}'
    17825:20121107:110048.804 End of DBlld_check_record():FAIL
    17825:20121107:110048.804 In DBlld_check_record() jp_row:'{"{#DISKNAME}":"md0"}'
    17825:20121107:110048.804 End of DBlld_check_record():FAIL
    17825:20121107:110048.805 In DBlld_check_record() jp_row:'{"{#DISKNAME}":"cd0"}'
    17825:20121107:110048.805 End of DBlld_check_record():FAIL
    17825:20121107:110048.805 In DBlld_check_record() jp_row:'{"{#DISKNAME}":"pass0"}'
    17825:20121107:110048.805 End of DBlld_check_record():FAIL
    17825:20121107:110048.805 In DBlld_check_record() jp_row:'{"{#DISKNAME}":"mfid0"}'
    17825:20121107:110048.805 End of DBlld_check_record():FAIL
    17825:20121107:110048.805 In DBlld_check_record() jp_row:'{"{#DISKNAME}":"mfid1"}'
    17825:20121107:110048.805 End of DBlld_check_record():FAIL
    17825:20121107:110048.805 In DBlld_check_record() jp_row:'{"{#DISKNAME}":"md0"}'
    17825:20121107:110048.805 End of DBlld_check_record():FAIL
    17825:20121107:110048.805 In DBlld_check_record() jp_row:'{"{#DISKNAME}":"cd0"}'
    17825:20121107:110048.805 End of DBlld_check_record():FAIL
    17825:20121107:110048.805 In DBlld_check_record() jp_row:'{"{#DISKNAME}":"pass0"}'
    17825:20121107:110048.805 End of DBlld_check_record():FAIL
    17825:20121107:110048.805 In DBlld_check_record() jp_row:'{"{#DISKNAME}":"mfid0"}'
    17825:20121107:110048.805 End of DBlld_check_record():FAIL
    17825:20121107:110048.805 In DBlld_check_record() jp_row:'{"{#DISKNAME}":"mfid1"}'
    17825:20121107:110048.805 End of DBlld_check_record():FAIL
    ...

    Comment

    • umask
      Junior Member
      • Apr 2011
      • 6

      #3
      My investigraion shows that global regexp does not work properly.

      In web interface it works!



      But autodiscovery works only if Regexp field empty in Discovery Rule.

      Comment

      • umask
        Junior Member
        • Apr 2011
        • 6

        #4
        Dear Zabbix Team,

        could you confirm that bug exists in regexp filtering on items from zabbix trapper?

        I still cant use regexps for filter disk names. Discovery works fine, but I no need items for virtual or inmemory disks and need to exclude them.

        If somebody need - there are sample resulsts from one of my server:




        I will post template if all will works fine with no known issues (like broken regexps).

        Comment

        Working...