Ad Widget

Collapse

Problem with custom discovery external check

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Robilly
    Junior Member
    • Mar 2014
    • 10

    #1

    Problem with custom discovery external check

    Hello,

    I've to made some advanced check on our storage (netapp).
    The only way to retrieve this kinds of stats on the storage is to execute a command directly on the storage cli with a specific command; there in no snmp values for this specific stats.
    I've made a script to use for the discovery (external check type), that produce a json file; All the items are collected with success.

    Ex. collect_netapp_stats.pl["{$STORAGE}","Volume"] -> Where "Volume" are the type of stats that i want to collect, following a json example:
    "{#TYPE}":"Volume",
    "{#NAME}":"vol_test",
    "{#VALUE}":"avg_latency",
    "{#OUTPUT}":"12.76us"

    Every item prototype has the following key, with external check type:

    return_netapp_stats.bash["{$STORAGE}","Volume","{#NAME}","avg_latency"]

    Then for EVERY SINGLE ITEM the batch "return_netapp_stats.bash" must be run and it return the correct value of the item.
    The problem is that we have many item to be collected, and this have impact to the collection item (the script exit with timeout), but in particulary on the zabbix server performance, with a great increment of the running processes (and, obviously, of the cpu load).

    There is a way to collect all the data item in one way? I've all data in the json file but the script return a single value for a single item. It's not possible to collect directly ALL data from json file, without call the script for every single value?

    Maybe something like the zabbix_agent type works:
    Volume.vol_test.avg_latency
    ?

    Do you have some idea?


    Thank you very Much,

    Roberto
    Last edited by Robilly; 14-03-2014, 16:48.
  • steveboyson
    Senior Member
    • Jul 2013
    • 582

    #2
    That is the way it works. One item - one result.
    You may want to use trapper items within your script. So you can just run the script once but feed more than one value back into zabbix.

    Comment

    • Robilly
      Junior Member
      • Mar 2014
      • 10

      #3
      Originally posted by steveboyson
      That is the way it works. One item - one result.
      You may want to use trapper items within your script. So you can just run the script once but feed more than one value back into zabbix.
      Ciao steveboyson,

      thanks for your reply; i've just made some tests with zabbix trapper and it seems that works fine in my case.
      I've only one problem.
      My data are dynamic/variable; in my txt file that i've send via zabbix_sender i've some values like:
      test_netapp_stats_io Volume.NAMEOFTHEVOLUME_A.readiops "0"
      test_netapp_stats_io Volume.NAMEOFTHEVOLUME_B.writeiops "0"

      I've configured a discovery rules with an item prototype but in the item prototype key it seems that i can't specify a variable but i must specify the full name of the volume (Key Ex. Volume.NAMEOFTHEVOLUME_A.readiops
      There is a way to make a variable NAMEOFTHEVOLUME_A/NAMEOFTHEVOLUME_B/Ecc?
      In the old external check i use with success this format: {#NAME}


      Thanks!

      Roberto

      Comment

      • steveboyson
        Senior Member
        • Jul 2013
        • 582

        #4
        "NAMEOFTHEVOLUME_A" and "NAMEOFTHEVOLUME_b" would be the later expanded macros {#NAME}. So do LLD rules work.

        Comment

        • Robilly
          Junior Member
          • Mar 2014
          • 10

          #5
          Originally posted by steveboyson
          "NAMEOFTHEVOLUME_A" and "NAMEOFTHEVOLUME_b" would be the later expanded macros {#NAME}. So do LLD rules work.
          But it's not possible to create an item key like
          value1.{#NAME}.value2
          Then there is a way to solve this problem? It's the last step to complete the workflow

          Comment

          • steveboyson
            Senior Member
            • Jul 2013
            • 582

            #6
            LLD items (called item prototypes) usually have the form

            Code:
            some_item_key[{#LLD_MACRO1},{#LLD_MACRO2},some_other_parameter]

            Comment

            • Robilly
              Junior Member
              • Mar 2014
              • 10

              #7
              Hi steve,

              if i try to insert
              Volume.[{#NAME}],instance_name]
              in the key field i receive the following error
              Error in item key: "Incorrect usage of bracket symbols. "," found after final bracket.".


              Thanks,

              Roberto

              Comment

              • steveboyson
                Senior Member
                • Jul 2013
                • 582

                #8
                Originally posted by Robilly
                Hi steve,
                Volume.[{#NAME}],instance_name]
                You have two closing brackets.

                Comment

                • Robilly
                  Junior Member
                  • Mar 2014
                  • 10

                  #9
                  Yes sorry, i'm an idiot

                  Now the key are correct:
                  Volume[{#NAME},instance_name]
                  but when i send the file with the command:
                  /usr/bin/zabbix_sender -vv -z 127.0.0.1 -i test.txt
                  it fails from server side:
                  info from server: "Processed 0 Failed 2 Total 2 Seconds spent 0.000033"

                  This is the line that i've inserted
                  test_netapp_stats_io Volume.vol_esx_nfs.instance_name "testauto"

                  There is something wrong?

                  Roberto

                  Comment

                  • steveboyson
                    Senior Member
                    • Jul 2013
                    • 582

                    #10
                    Originally posted by Robilly
                    Yes sorry, i'm an idiot
                    test_netapp_stats_io Volume.vol_esx_nfs.instance_name "testauto"
                    Roberto
                    Where are the brackets here?

                    Comment

                    • Robilly
                      Junior Member
                      • Mar 2014
                      • 10

                      #11
                      Great! It works now!

                      test_netapp_stats_io Volume[vol_esx_nfs,instance_name] "testauto"


                      Thank you very much for you help

                      Comment

                      Working...