Ad Widget

Collapse

Change SNMP community per host?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • eger
    Member
    • Nov 2006
    • 95

    #1

    Change SNMP community per host?

    I am testing out 1.6 and waiting patiently for 1.6.1. One thing I cannot seem to do is change the SNMP community for an item ona specific host tied toa template. I can change on it on the template and it works fine. But the edit box when editing the item for a host can't be changed.

    Is this behavior as intended and if so, how can I change some item values per host?

    In my test I am trying to setup 3 switches using the Dell 5324 Template. They are using different SNMP community names. I also have another SNMP problem with values. But I think it deserves its own thread.
  • Alexei
    Founder, CEO
    Zabbix Certified Trainer
    Zabbix Certified SpecialistZabbix Certified Professional
    • Sep 2004
    • 5654

    #2
    Originally posted by eger
    Is this behavior as intended and if so, how can I change some item values per host?
    Select items, then press "Mass update" and put new values for the community string.
    Alexei Vladishev
    Creator of Zabbix, Product manager
    New York | Tokyo | Riga
    My Twitter

    Comment

    • eger
      Member
      • Nov 2006
      • 95

      #3
      Originally posted by Alexei
      Select items, then press "Mass update" and put new values for the community string.
      This is exactly what I did. The values do not take. They just revert back to what is in the template instead which is 'public'.

      I am currently running a nightly build from a couple days ago. pre-zabbix-1.6.tar.gz with a date of Oct 31st.

      Here are the exact steps I am doing:

      1. Added a new host using IP which is a Dell 5324 Switch and select to link with Template_Dell_PowerConnect_5324.
      2. Navigate to Items, select the new Host, and select all Items and click Mass Update button
      3. Check the SNMP community box and change community and click update
      4. I then click on any item for that host and it shows the SNMP community of the template instead of the one entered with mass update.

      Comment

      • Tenzer
        Senior Member
        • Nov 2007
        • 316

        #4
        You will probably have to unlink the template from the host first. You can do that by selecting the host and then press the "Unlink" button next to the template.

        Comment

        • low10sws6
          Member
          • Oct 2008
          • 44

          #5
          community string for different hosts

          Community string for different host:

          menu>Configuration>host>create -> host group
          --creates a host group for your host you want a different community string for

          menu>configuration>host
          --select the given hosts' you want to have within a given [host group] and apply a the group to the host for each host in the host menu

          next
          menu>Configuration>host>create -> templates
          --create templates and apply to the host group you just created create templates -(like: servers, router, switches,etc) how ever you want templates categorized

          then
          menu>configuration>items> select group (all) or templates -> the host box --containing the templates you want to change commmunity string for. select the template. template should populate columns and rows bellow after loaded.

          check the box next to description > this should do a (select all items)
          Scroll to bottom click on the [copy select to...]
          --target type = host
          --group = all
          now select the template you want to copy the [selected] to (one of the templates you created above)

          now the selected items reappears up top SELECT > Group (containing ur template you just copied items to) then SELECT > Host (pick the template you had just copied items to) ur items should populate bellow

          >check the box next to description up top like before (all items should be selected)
          >Scroll to bottom
          >click mass update - mass update menu loads
          >click [Original] next to the [SNMP community] shows {public} change to your custom community
          >click update

          ALSO
          then click
          menu>configuration>triggers
          you'll now want to do the same as above to copy all the triggers of the Original template to your new template under your group and your host/template
          select>group (all)
          select>host (original template)
          select> all triggers (check box next to description)
          click> scroll to bottom click [copy selected to..]
          target = host
          group = all
          select> the template you had just populated with your new items w/the new community string

          you now have triggers for your new items

          Congratulations you now have a separate community string for items for a different host

          thanks
          Sol
          Last edited by low10sws6; 05-11-2008, 23:18.

          Comment

          • eger
            Member
            • Nov 2006
            • 95

            #6
            So If I read correctly, I will need to create a template group for any host that has different SNMP community? This doesn't make sense...

            Comment

            • troffasky
              Senior Member
              • Jul 2008
              • 567

              #7
              Originally posted by eger
              So If I read correctly, I will need to create a template group for any host that has different SNMP community? This doesn't make sense...
              This tripped me up when I first started using Zabbix. I think that the SNMP community should be treated differently than the other parameters so that it's not updated when doing template linkage, otherwise you end up with a situation where you need to create one template per community per type of device, which is just silly, and pretty much eliminates the benefits of templates. One workaround would be to make sure every single SNMP device you monitor has the same community, but when one is a systems integrator or service provider monitoring many different devices that many be spread across many different customers sites, this is not easy.

              Comment

              • xs-
                Senior Member
                Zabbix Certified Specialist
                • Dec 2007
                • 393

                #8
                imho, snmp community should be made host based, not template based.
                (just like the new IMPI configuration in 1.6)

                Comment

                • asad747
                  Junior Member
                  • Jan 2009
                  • 4

                  #9
                  can someone write the steps again in better way?? I cannot achieve the result in this way.

                  Just tell the way to change for a single host, without adding it to any group

                  Comment

                  • asad747
                    Junior Member
                    • Jan 2009
                    • 4

                    #10
                    Ok I got it. Here are the steps;

                    1) Add a host First [Configuration -> Hosts -> Create host]
                    2) Link Appropriate template in Create host configuration.
                    3) Press Save

                    This step will create Items according to the template u defined.

                    4) Goto hosts and Edit the host you just created, and UNLINK the template.
                    5) Goto Items and select all the items related to this host and selet MASS UPDATE
                    6) Change the community and Save it. new SNMP community will be applied to all the items.

                    Now as per my understanding there is no need to LINK the template again. Because Items are created and there is no need to link the template now. AM i Correct??

                    Comment

                    • low10sws6
                      Member
                      • Oct 2008
                      • 44

                      #11
                      Originally posted by eger
                      So If I read correctly, I will need to create a template group for any host that has different SNMP community? This doesn't make sense...
                      This way is only necessary if wanting to keep template separate for multiple hosts; given some device(hosts) might be different or carry different OIDS that might not match

                      Comment

                      • troffasky
                        Senior Member
                        • Jul 2008
                        • 567

                        #12
                        Originally posted by low10sws6
                        This way is only necessary if wanting to keep template separate for multiple hosts;
                        That's the point - the template includes the community, so even if you're monitoring two identical hosts, if the community differs you need two templates. Templates should treat the community like they treat the IP address or hostname; in the vast majority of cases, every SNMP OID on a given host will have the same community string.

                        Edit - 7 years later....
                        The answer is, you use the {$SNMP_COMMUNITY} macro in your template items and override *that* per-host. If you use one community mostly, then set that globally. Still a workaround IMO - how many nodes have you seen where they require the use of two different communities?
                        Last edited by troffasky; 22-04-2016, 19:17. Reason: Learned things over the years...

                        Comment

                      • sandipc
                        Junior Member
                        • Aug 2015
                        • 8

                        #13
                        unable to communicate windows snmp client with zabbix.

                        I have windows server 2003 client machine to monitor by zabbix witch is installed in centos (linux). The windows snmp service not getting communicate with zabbix and I am unable to monitor windows client in zabbix by snmp service.

                        Comment

                        • Ravikumar
                          Junior Member
                          • Jun 2018
                          • 3

                          #14
                          Hi,

                          I have range of IP address and multiple snmp community for this range.

                          Is there any way to use multiple community in auto discovery feature. I tried comma separated community but seems it is not working.

                          Comment

                          • kloczek
                            Senior Member
                            • Jun 2006
                            • 1771

                            #15
                            Originally posted by Ravikumar
                            Hi,

                            I have range of IP address and multiple snmp community for this range.

                            Is there any way to use multiple community in auto discovery feature. I tried comma separated community but seems it is not working.
                            Probably the best way to handle such cases would be have possibility to add in action operation "set macro value" (such feature would be useful in many other cases).
                            Without such feature you can try to use set of templates which will be inheriting all items/triggers/etc from base template + definition {$SNMP_COMMUNITY} and use those templates per range.
                            This would require to define discovery action per range of the addresses to be able to assign different template per range..
                            Last edited by kloczek; 09-07-2018, 13:28.
                            http://uk.linkedin.com/pub/tomasz-k%...zko/6/940/430/
                            https://kloczek.wordpress.com/
                            zapish - Zabbix API SHell binding https://github.com/kloczek/zapish
                            My zabbix templates https://github.com/kloczek/zabbix-templates

                            Comment

                            Working...