Ad Widget

Collapse

Mass edit SNMP community in item prototypes

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • jimmymc
    Junior Member
    • Sep 2013
    • 7

    #1

    Mass edit SNMP community in item prototypes

    Hi

    I'm running Zabbix 2.2.1 (server and proxy).

    I'm trying to get the template 'Template_Cisco_3560_all_dynamic' (from https://zabbix.org/wiki/Zabbix_Templates) working.

    The SNMP read-only community in our case, isn't 'public', and this template is setup so all the community strings are set to this.

    I can mass edit standard 'Items' and change the community string there, but under 'Discovery Rules -> Item Prototypes', I can't mass edit the string there (only mass edit options are to Activate/Disable/Delete).

    There are a lot of items - do I need to edit each one of them, or am I missing something? I'd also like to mass-edit the interval of each of these Item prototypes.. so if there's a simpler way, I'd love to know.

    Cheers, James
  • pxsh
    Junior Member
    • Oct 2013
    • 14

    #2
    Hi James,

    Easy way would be to open the Template xml file in any text editor and do a search & replace.

    To do the template more versatile replace "<snmp_community>public</snmp_community>" with "<snmp_community>{$SNMP_COMMUNITY}</snmp_community>" and add a macro for your Cisco units/hosts.

    Then delete the Template from Zabbix and re-add it.
    Last edited by pxsh; 19-12-2013, 19:05.

    Comment

    • jimmymc
      Junior Member
      • Sep 2013
      • 7

      #3
      Thanks for the reply..

      We have (or at least, will end up having) a lot of devices with different strings (different companies/departments). Happy to use macros, but that would also mean having a template per SNMP community string in that case? Would ideally like to keep templates to a minimum..

      Is it by design that you can't mass-edit item prototypes from within the front-end?

      Comment

      • pxsh
        Junior Member
        • Oct 2013
        • 14

        #4
        No need for multiple Templates , thats one of the benefits of macro usage.
        You use the same template for all the Cisco devices and then just define a macro for each host.

        One Template to rule them all!

        Comment

        • jimmymc
          Junior Member
          • Sep 2013
          • 7

          #5
          I don't think I explained too well..

          The template in question, has 29 Item Prototypes under Discovery. It would seem you cannot mass-edit Item Prototypes. Meaning I have to manually edit each one of them i.e. 29 of them.

          If I have a bunch of devices that have different community strings - a macro won't necessarily help here, as I'd still have to change the actual macro in use for each one of the Item Prototypes in the template.

          Does that make more sense? I just want to mass edit Item Prototypes..

          Cheers

          Comment

          • vvlad
            Member
            • Apr 2011
            • 83

            #6
            jimmymc, what you need is only possible through an export template to XML. After that you could search and replace substring with community name to macros. And in the end you will need to do the import template corrected.

            Comment

            • eertul
              Junior Member
              • May 2018
              • 10

              #7
              Vote this ZBXNEXT-1190

              Comment

              Working...