Zabbix discovery rules - how to fill in key item The 2019 Stack Overflow Developer Survey Results Are In Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern) The Ask Question Wizard is Live! Data science time! April 2019 and salary with experienceHow to efficiently count the number of keys/properties of an object in JavaScript?zabbix_sender syntax for discovery rulesZabbix Create new item and add data value using python scriptZabbix Discovery Rule by custom script: need any advicesuserparameters and ZBX_NOTSUPPORTEDUsing MACROS in item key definitionUnsupported Item Key in ZabbixZabbix LLD Value should be a JSON objectA simple question - Transfer parameters from powershellDynamically add items in zabbix template

Didn't get enough time to take a Coding Test - what to do now?

Did God make two great lights or did He make the great light two?

Why is superheterodyning better than direct conversion?

Was credit for the black hole image misattributed?

Do warforged have souls?

does high air pressure throw off wheel balance?

When did F become S in typeography, and why?

Why did all the guest students take carriages to the Yule Ball?

How does ice melt when immersed in water?

What are these Gizmos at Izaña Atmospheric Research Center in Spain?

Would an alien lifeform be able to achieve space travel if lacking in vision?

ELI5: Why do they say that Israel would have been the fourth country to land a spacecraft on the Moon and why do they call it low cost?

Can a novice safely splice in wire to lengthen 5V charging cable?

University's motivation for having tenure-track positions

Can smartphones with the same camera sensor have different image quality?

Road tyres vs "Street" tyres for charity ride on MTB Tandem

How many people can fit inside Mordenkainen's Magnificent Mansion?

Why can't wing-mounted spoilers be used to steepen approaches?

Does Parliament hold absolute power in the UK?

Match Roman Numerals

How should I replace vector<uint8_t>::const_iterator in an API?

Simulating Exploding Dice

How to test the equality of two Pearson correlation coefficients computed from the same sample?

What aspect of planet Earth must be changed to prevent the industrial revolution?



Zabbix discovery rules - how to fill in key item



The 2019 Stack Overflow Developer Survey Results Are In
Announcing the arrival of Valued Associate #679: Cesar Manara
Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern)
The Ask Question Wizard is Live!
Data science time! April 2019 and salary with experienceHow to efficiently count the number of keys/properties of an object in JavaScript?zabbix_sender syntax for discovery rulesZabbix Create new item and add data value using python scriptZabbix Discovery Rule by custom script: need any advicesuserparameters and ZBX_NOTSUPPORTEDUsing MACROS in item key definitionUnsupported Item Key in ZabbixZabbix LLD Value should be a JSON objectA simple question - Transfer parameters from powershellDynamically add items in zabbix template



.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;








1















I'm new in Zabbix and I'm having a problem.
I run a script in power shell and get this sample data:




"data":[

"#BZSENDPORTNAME":"Com_Onshore_SDE",
"#BZSENDPORTSTATUS":"3",

"#BZSENDPORTNAME":"Com_Onshore_Backup",
"#BZSENDPORTSTATUS":"3",

"#BZSENDPORTNAME":"Remit_ForecastMeter",
"#BZSENDPORTSTATUS":"3"]


Here is just a sample, there are around more than 40 pair of port name and port status.
I've already created a discovery rule in Zabbix server and I hope it can automatically create items with their names are #BZSENDPORTNAME and their values are #BZSENDPORTSTATUS.
For example: item Com_Onshore_SDE ; value = 3. I created a discovery here.
Then I get the result like this:



enter image description here



The name of the items are what I expected but the key contains the value of the port status I would like the port status is the value of the item, not the key. And also it shows the error "Item does not allow parameter".
The Zabbix agent config file is: UserParameter=custom.discovery,powershell.exe -NoProfile -ExecutionPolicy Bypass -file "C:ZabbixScriptsGet-BZSendMultiPortsInfo-test.ps1"



Please help me with this. Many thanks










share|improve this question






























    1















    I'm new in Zabbix and I'm having a problem.
    I run a script in power shell and get this sample data:




    "data":[

    "#BZSENDPORTNAME":"Com_Onshore_SDE",
    "#BZSENDPORTSTATUS":"3",

    "#BZSENDPORTNAME":"Com_Onshore_Backup",
    "#BZSENDPORTSTATUS":"3",

    "#BZSENDPORTNAME":"Remit_ForecastMeter",
    "#BZSENDPORTSTATUS":"3"]


    Here is just a sample, there are around more than 40 pair of port name and port status.
    I've already created a discovery rule in Zabbix server and I hope it can automatically create items with their names are #BZSENDPORTNAME and their values are #BZSENDPORTSTATUS.
    For example: item Com_Onshore_SDE ; value = 3. I created a discovery here.
    Then I get the result like this:



    enter image description here



    The name of the items are what I expected but the key contains the value of the port status I would like the port status is the value of the item, not the key. And also it shows the error "Item does not allow parameter".
    The Zabbix agent config file is: UserParameter=custom.discovery,powershell.exe -NoProfile -ExecutionPolicy Bypass -file "C:ZabbixScriptsGet-BZSendMultiPortsInfo-test.ps1"



    Please help me with this. Many thanks










    share|improve this question


























      1












      1








      1








      I'm new in Zabbix and I'm having a problem.
      I run a script in power shell and get this sample data:




      "data":[

      "#BZSENDPORTNAME":"Com_Onshore_SDE",
      "#BZSENDPORTSTATUS":"3",

      "#BZSENDPORTNAME":"Com_Onshore_Backup",
      "#BZSENDPORTSTATUS":"3",

      "#BZSENDPORTNAME":"Remit_ForecastMeter",
      "#BZSENDPORTSTATUS":"3"]


      Here is just a sample, there are around more than 40 pair of port name and port status.
      I've already created a discovery rule in Zabbix server and I hope it can automatically create items with their names are #BZSENDPORTNAME and their values are #BZSENDPORTSTATUS.
      For example: item Com_Onshore_SDE ; value = 3. I created a discovery here.
      Then I get the result like this:



      enter image description here



      The name of the items are what I expected but the key contains the value of the port status I would like the port status is the value of the item, not the key. And also it shows the error "Item does not allow parameter".
      The Zabbix agent config file is: UserParameter=custom.discovery,powershell.exe -NoProfile -ExecutionPolicy Bypass -file "C:ZabbixScriptsGet-BZSendMultiPortsInfo-test.ps1"



      Please help me with this. Many thanks










      share|improve this question
















      I'm new in Zabbix and I'm having a problem.
      I run a script in power shell and get this sample data:




      "data":[

      "#BZSENDPORTNAME":"Com_Onshore_SDE",
      "#BZSENDPORTSTATUS":"3",

      "#BZSENDPORTNAME":"Com_Onshore_Backup",
      "#BZSENDPORTSTATUS":"3",

      "#BZSENDPORTNAME":"Remit_ForecastMeter",
      "#BZSENDPORTSTATUS":"3"]


      Here is just a sample, there are around more than 40 pair of port name and port status.
      I've already created a discovery rule in Zabbix server and I hope it can automatically create items with their names are #BZSENDPORTNAME and their values are #BZSENDPORTSTATUS.
      For example: item Com_Onshore_SDE ; value = 3. I created a discovery here.
      Then I get the result like this:



      enter image description here



      The name of the items are what I expected but the key contains the value of the port status I would like the port status is the value of the item, not the key. And also it shows the error "Item does not allow parameter".
      The Zabbix agent config file is: UserParameter=custom.discovery,powershell.exe -NoProfile -ExecutionPolicy Bypass -file "C:ZabbixScriptsGet-BZSendMultiPortsInfo-test.ps1"



      Please help me with this. Many thanks







      json key zabbix lld






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Mar 8 at 14:42









      Rodolfo Donã Hosp

      592416




      592416










      asked Mar 8 at 13:41









      user3642240user3642240

      83




      83






















          1 Answer
          1






          active

          oldest

          votes


















          1














          You should use [*] in your user parameter and add $1 and $2 to end of string:



          UserParameter=custom.discovery[*],powershell.exe -NoProfile -ExecutionPolicy Bypass -file "C:ZabbixScriptsGet-BZSendMultiPortsInfo-test.ps1" $1 $2





          share|improve this answer























          • could you explain a little bit more?

            – user3642240
            Mar 18 at 10:50











          • This is information taken from official documentation Flexible user parameters Flexible user parameters accept parameters with the key. This way a flexible user parameter can be the basis for creating several items. Flexible user parameters have the following syntax: UserParameter=key[*],command you can read about this by link zabbix.com/documentation/3.0/manual/config/items/userparameters

            – tutunak
            Mar 18 at 12:55












          • And I need to edit my script in order to accept the parameter, right?

            – user3642240
            Mar 18 at 13:55











          • Thank you, I've done that already but I'm facing another problem: The Zabbix Agent usually time out while executing the script; sometimes it executed the scripts and sent data to the server successful but most of the time, it fails. Please advice me. @tutunak

            – user3642240
            Mar 19 at 8:31











          • maximum timeout is 30 second for the item, or you can use trapper and script in cron or custom agent

            – tutunak
            Mar 19 at 11:18











          Your Answer






          StackExchange.ifUsing("editor", function ()
          StackExchange.using("externalEditor", function ()
          StackExchange.using("snippets", function ()
          StackExchange.snippets.init();
          );
          );
          , "code-snippets");

          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "1"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader:
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          ,
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );













          draft saved

          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55064447%2fzabbix-discovery-rules-how-to-fill-in-key-item%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          1














          You should use [*] in your user parameter and add $1 and $2 to end of string:



          UserParameter=custom.discovery[*],powershell.exe -NoProfile -ExecutionPolicy Bypass -file "C:ZabbixScriptsGet-BZSendMultiPortsInfo-test.ps1" $1 $2





          share|improve this answer























          • could you explain a little bit more?

            – user3642240
            Mar 18 at 10:50











          • This is information taken from official documentation Flexible user parameters Flexible user parameters accept parameters with the key. This way a flexible user parameter can be the basis for creating several items. Flexible user parameters have the following syntax: UserParameter=key[*],command you can read about this by link zabbix.com/documentation/3.0/manual/config/items/userparameters

            – tutunak
            Mar 18 at 12:55












          • And I need to edit my script in order to accept the parameter, right?

            – user3642240
            Mar 18 at 13:55











          • Thank you, I've done that already but I'm facing another problem: The Zabbix Agent usually time out while executing the script; sometimes it executed the scripts and sent data to the server successful but most of the time, it fails. Please advice me. @tutunak

            – user3642240
            Mar 19 at 8:31











          • maximum timeout is 30 second for the item, or you can use trapper and script in cron or custom agent

            – tutunak
            Mar 19 at 11:18















          1














          You should use [*] in your user parameter and add $1 and $2 to end of string:



          UserParameter=custom.discovery[*],powershell.exe -NoProfile -ExecutionPolicy Bypass -file "C:ZabbixScriptsGet-BZSendMultiPortsInfo-test.ps1" $1 $2





          share|improve this answer























          • could you explain a little bit more?

            – user3642240
            Mar 18 at 10:50











          • This is information taken from official documentation Flexible user parameters Flexible user parameters accept parameters with the key. This way a flexible user parameter can be the basis for creating several items. Flexible user parameters have the following syntax: UserParameter=key[*],command you can read about this by link zabbix.com/documentation/3.0/manual/config/items/userparameters

            – tutunak
            Mar 18 at 12:55












          • And I need to edit my script in order to accept the parameter, right?

            – user3642240
            Mar 18 at 13:55











          • Thank you, I've done that already but I'm facing another problem: The Zabbix Agent usually time out while executing the script; sometimes it executed the scripts and sent data to the server successful but most of the time, it fails. Please advice me. @tutunak

            – user3642240
            Mar 19 at 8:31











          • maximum timeout is 30 second for the item, or you can use trapper and script in cron or custom agent

            – tutunak
            Mar 19 at 11:18













          1












          1








          1







          You should use [*] in your user parameter and add $1 and $2 to end of string:



          UserParameter=custom.discovery[*],powershell.exe -NoProfile -ExecutionPolicy Bypass -file "C:ZabbixScriptsGet-BZSendMultiPortsInfo-test.ps1" $1 $2





          share|improve this answer













          You should use [*] in your user parameter and add $1 and $2 to end of string:



          UserParameter=custom.discovery[*],powershell.exe -NoProfile -ExecutionPolicy Bypass -file "C:ZabbixScriptsGet-BZSendMultiPortsInfo-test.ps1" $1 $2






          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Mar 8 at 19:15









          tutunaktutunak

          265




          265












          • could you explain a little bit more?

            – user3642240
            Mar 18 at 10:50











          • This is information taken from official documentation Flexible user parameters Flexible user parameters accept parameters with the key. This way a flexible user parameter can be the basis for creating several items. Flexible user parameters have the following syntax: UserParameter=key[*],command you can read about this by link zabbix.com/documentation/3.0/manual/config/items/userparameters

            – tutunak
            Mar 18 at 12:55












          • And I need to edit my script in order to accept the parameter, right?

            – user3642240
            Mar 18 at 13:55











          • Thank you, I've done that already but I'm facing another problem: The Zabbix Agent usually time out while executing the script; sometimes it executed the scripts and sent data to the server successful but most of the time, it fails. Please advice me. @tutunak

            – user3642240
            Mar 19 at 8:31











          • maximum timeout is 30 second for the item, or you can use trapper and script in cron or custom agent

            – tutunak
            Mar 19 at 11:18

















          • could you explain a little bit more?

            – user3642240
            Mar 18 at 10:50











          • This is information taken from official documentation Flexible user parameters Flexible user parameters accept parameters with the key. This way a flexible user parameter can be the basis for creating several items. Flexible user parameters have the following syntax: UserParameter=key[*],command you can read about this by link zabbix.com/documentation/3.0/manual/config/items/userparameters

            – tutunak
            Mar 18 at 12:55












          • And I need to edit my script in order to accept the parameter, right?

            – user3642240
            Mar 18 at 13:55











          • Thank you, I've done that already but I'm facing another problem: The Zabbix Agent usually time out while executing the script; sometimes it executed the scripts and sent data to the server successful but most of the time, it fails. Please advice me. @tutunak

            – user3642240
            Mar 19 at 8:31











          • maximum timeout is 30 second for the item, or you can use trapper and script in cron or custom agent

            – tutunak
            Mar 19 at 11:18
















          could you explain a little bit more?

          – user3642240
          Mar 18 at 10:50





          could you explain a little bit more?

          – user3642240
          Mar 18 at 10:50













          This is information taken from official documentation Flexible user parameters Flexible user parameters accept parameters with the key. This way a flexible user parameter can be the basis for creating several items. Flexible user parameters have the following syntax: UserParameter=key[*],command you can read about this by link zabbix.com/documentation/3.0/manual/config/items/userparameters

          – tutunak
          Mar 18 at 12:55






          This is information taken from official documentation Flexible user parameters Flexible user parameters accept parameters with the key. This way a flexible user parameter can be the basis for creating several items. Flexible user parameters have the following syntax: UserParameter=key[*],command you can read about this by link zabbix.com/documentation/3.0/manual/config/items/userparameters

          – tutunak
          Mar 18 at 12:55














          And I need to edit my script in order to accept the parameter, right?

          – user3642240
          Mar 18 at 13:55





          And I need to edit my script in order to accept the parameter, right?

          – user3642240
          Mar 18 at 13:55













          Thank you, I've done that already but I'm facing another problem: The Zabbix Agent usually time out while executing the script; sometimes it executed the scripts and sent data to the server successful but most of the time, it fails. Please advice me. @tutunak

          – user3642240
          Mar 19 at 8:31





          Thank you, I've done that already but I'm facing another problem: The Zabbix Agent usually time out while executing the script; sometimes it executed the scripts and sent data to the server successful but most of the time, it fails. Please advice me. @tutunak

          – user3642240
          Mar 19 at 8:31













          maximum timeout is 30 second for the item, or you can use trapper and script in cron or custom agent

          – tutunak
          Mar 19 at 11:18





          maximum timeout is 30 second for the item, or you can use trapper and script in cron or custom agent

          – tutunak
          Mar 19 at 11:18



















          draft saved

          draft discarded
















































          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid


          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.

          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55064447%2fzabbix-discovery-rules-how-to-fill-in-key-item%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          1928 у кіно

          Захаров Федір Захарович

          Ель Греко