Announcement

Collapse
No announcement yet.

SNMP Builder for Zabbix

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

    #31
    I'm not able to get oids from MIB files, all the time I get nothing.

    Is there some package need to be installed or all mibs I'm using are wrong?!

    At first look it seemed to be a pretty easy way to create snmp template, now it seems like a nightmare.

    That's a shame that Zabbix team doesn't develop tool for Zabbix integration with SNMP.
    Attached Files

    Comment


      #32
      I got some logs out of apache error log, maybe it could help:

      Code:
      No log handling enabled - turning on stderr logging
      Cannot find module (SNMPv2-SMI): At line 8 in /usr/share/snmp/mibs/SYMANTEC-EMAIL-SECURITY.mib
      Cannot find module (SNMPv2-TC): At line 10 in /usr/share/snmp/mibs/SYMANTEC-EMAIL-SECURITY.mib
      Did not find 'enterprises' in module #-1 (/usr/share/snmp/mibs/SYMANTEC-EMAIL-SECURITY.mib)
      Did not find 'DisplayString' in module #-1 (/usr/share/snmp/mibs/SYMANTEC-EMAIL-SECURITY.mib)
      Unlinked OID in SYMANTEC-EMAIL-SECURITY: symantec ::= { enterprises 393 }
      Undefined identifier: enterprises near line 30 of /usr/share/snmp/mibs/SYMANTEC-EMAIL-SECURITY.mib
      Cannot adopt OID in SYMANTEC-EMAIL-SECURITY: queuedMessages ::= { instanceEntry 8 }
      Cannot adopt OID in SYMANTEC-EMAIL-SECURITY: queueSize ::= { instanceEntry 7 }
      Cannot adopt OID in SYMANTEC-EMAIL-SECURITY: messageRate ::= { instanceEntry 6 }
      Cannot adopt OID in SYMANTEC-EMAIL-SECURITY: deferredMessages ::= { instanceEntry 5 }
      Cannot adopt OID in SYMANTEC-EMAIL-SECURITY: dataRate ::= { instanceEntry 4 }
      Cannot adopt OID in SYMANTEC-EMAIL-SECURITY: connections ::= { instanceEntry 3 }
      Cannot adopt OID in SYMANTEC-EMAIL-SECURITY: instanceDescr ::= { instanceEntry 2 }
      Cannot adopt OID in SYMANTEC-EMAIL-SECURITY: instanceIndex ::= { instanceEntry 1 }
      Cannot adopt OID in SYMANTEC-EMAIL-SECURITY: cpuInternalTemperature ::= { app8240 5 }
      Cannot adopt OID in SYMANTEC-EMAIL-SECURITY: internalAmbientTemperature ::= { app8240 4 }
      Cannot adopt OID in SYMANTEC-EMAIL-SECURITY: systemPciFan ::= { app8240 3 }
      Cannot adopt OID in SYMANTEC-EMAIL-SECURITY: systemMemoryFan ::= { app8240 2 }
      Cannot adopt OID in SYMANTEC-EMAIL-SECURITY: systemBlowerFan ::= { app8240 1 }
      Cannot adopt OID in SYMANTEC-EMAIL-SECURITY: fanRedundancy ::= { app8260 2 }
      Cannot adopt OID in SYMANTEC-EMAIL-SECURITY: powerSupplyRedundancy ::= { app8260 1 }
      Cannot adopt OID in SYMANTEC-EMAIL-SECURITY: symantec ::= { enterprises 393 }
      Cannot adopt OID in SYMANTEC-EMAIL-SECURITY: instanceTable ::= { mta 1 }
      Cannot adopt OID in SYMANTEC-EMAIL-SECURITY: mta ::= { mailSecurityAppliance 2 }
      Cannot adopt OID in SYMANTEC-EMAIL-SECURITY: hardware ::= { mailSecurityAppliance 1 }
      Cannot adopt OID in SYMANTEC-EMAIL-SECURITY: app8260 ::= { hardware 2 }
      Cannot adopt OID in SYMANTEC-EMAIL-SECURITY: app8240 ::= { hardware 1 }
      Cannot adopt OID in SYMANTEC-EMAIL-SECURITY: mailSecurityAppliance ::= { sms 2 }
      Cannot adopt OID in SYMANTEC-EMAIL-SECURITY: instanceEntry ::= { instanceTable 1 }
      Cannot adopt OID in SYMANTEC-EMAIL-SECURITY: products ::= { symantec 200 }
      Cannot adopt OID in SYMANTEC-EMAIL-SECURITY: sms ::= { products 130 }

      Comment


        #33
        Originally posted by modest View Post
        At first look it seemed to be a pretty easy way to create snmp template, now it seems like a nightmare.
        You're using a "weird" MIB, that looks like it might be broken.... do you have some other SNMP device you can point snmpbuilder at just to make sure it works, such as your Linux server?

        I've had success with snmpbuilder when I have pointed it at Cisco and HP devices...

        Comment


          #34
          I have the same issue with HP switches and MIB downloaded form HP site.

          However it does get data from HP switches via SNMP when using default Zabbix HP template, so SNMP by itself works.

          Comment


            #35
            Possible solution for those with string indexes in tables

            For those with string based indexes inside a table (which is most likely causing problems for you), you need to quote the index before its passed to snmpget. Fortunately, this is an easy fix. To do this, modify the following in the snmp_builder.php (I should add, I didn't test the regex all that much but it should figure out integer based indexes vs. strings):

            Code:
            function get_oid_value($community, $server_ip, $oid, $idx)
            {
                    if (preg_match('/^[0-9]+$/', $idx ,$match)) {
                         $results = exec("snmpget -v 2c -c $community -M ".MIBS_ALL_PATH." -m ALL $server_ip $oid.$idx");  
                    } else {        
                         $results = exec("snmpget -v 2c -c $community -M ".MIBS_ALL_PATH." -m ALL $server_ip $oid.\\\"".$idx."\\\"");
                    }

            Comment


              #36
              I decided to download and try with 1.8.1 today and while it didn't work so well, I like the direction you are headed. Your plugin has A LOT of potential to totally kick ass.

              If you can try and host it somewhere where you have a source code management system such as subversion or git. It's nice when you can look at the SCM and know how old the revision you are getting is. Also that would allow you to have some other people help you make it kick even more ass.

              Keep it up! You've got a real gem on your hands. I too hope you can work with the Zabbix team to eventually see it integrated into trunk, or at lease developed to the point where it's a simple drop in plugin for Zabbix. I think developing it to the point of a dropin plugin is the better option for you though. (Aly... hint hint, needed functionality and documentation....)
              RHCE, author of zbxapi
              Ansible, the missing piece (Zabconf 2017): https://www.youtube.com/watch?v=R5T9NidjjDE
              Zabbix and SNMP on Linux (Zabconf 2015): https://www.youtube.com/watch?v=98PEHpLFVHM

              Comment


                #37
                Nothing on my snmpbuilder

                Hi all,

                I had following the above installation, then I get the following result.
                Many thanks for help.
                Attached Files

                Comment


                  #38
                  I agree completely, great product and if you put the code in SCM, I will contribute to the code and documentation.

                  Patrick.

                  Originally posted by nelsonab View Post
                  I decided to download and try with 1.8.1 today and while it didn't work so well, I like the direction you are headed. Your plugin has A LOT of potential to totally kick ass.

                  If you can try and host it somewhere where you have a source code management system such as subversion or git. It's nice when you can look at the SCM and know how old the revision you are getting is. Also that would allow you to have some other people help you make it kick even more ass.

                  Keep it up! You've got a real gem on your hands. I too hope you can work with the Zabbix team to eventually see it integrated into trunk, or at lease developed to the point where it's a simple drop in plugin for Zabbix. I think developing it to the point of a dropin plugin is the better option for you though. (Aly... hint hint, needed functionality and documentation....)

                  Comment


                    #39
                    Originally posted by nelsonab View Post
                    I decided to download and try with 1.8.1 today and while it didn't work so well, I like the direction you are headed. Your plugin has A LOT of potential to totally kick ass.

                    If you can try and host it somewhere where you have a source code management system such as subversion or git. It's nice when you can look at the SCM and know how old the revision you are getting is. Also that would allow you to have some other people help you make it kick even more ass.

                    Keep it up! You've got a real gem on your hands. I too hope you can work with the Zabbix team to eventually see it integrated into trunk, or at lease developed to the point where it's a simple drop in plugin for Zabbix. I think developing it to the point of a dropin plugin is the better option for you though. (Aly... hint hint, needed functionality and documentation....)
                    Thank nelsonab, and sorry you guys for in-active for a long time. I even not upgrade 1.8.1 yet . I will fixed all problems at end of the week.

                    The reason, i not upload the tool into sub7 or git; is my code deeply bind with zabbix code. Every small change may broke the tool (like 1.8.1). So I hope zabbix guys will adopt the code into the project.

                    Thank danrog for fix my code. Weird index value not expected (by me).

                    Let check my new tool snmptrap. http://yangho.byethost22.com/wiki/do...anced_snmptrap. It will be integrated next snmpbuilder. It will be full snmp-support for zabbix
                    Last edited by giapnguyen; 02-02-2010, 03:57.

                    Comment


                      #40
                      Originally posted by giapnguyen View Post
                      Thank nelsonab, and sorry you guys for in-active for a long time. I even not upgrade 1.8.1 yet . I will fixed all problems at end of the week.
                      As the owner of a Zabbix related project, trust me life happens and there will be times you cannot commit as much as you would like. I know Richlv has probably wanted to slap me a few times when I haven't been able to work on Zabcon as much as I have wanted over the last few months.

                      However.... If you have your project in SCM, then you are more likely to get some people to help your project who can work on bug fixes or implement new features you have been discussing with everyone in your development group. Divide and conquer!

                      Originally posted by giapnguyen View Post
                      The reason, i not upload the tool into sub7 or git; is my code deeply bind with zabbix code. Every small change may broke the tool (like 1.8.1). So I hope zabbix guys will adopt the code into the project.
                      I cannot speak on behalf of the Zabbix team and cannot say definatively what they will do, however I think trying to keep your project independent for as long as possible would be in your best interest. This may seem counter intuitive but hear me out. If the Zabbix team integrates your project into trunk you will no longer be able to make bug fixes as easilly or add new features because you will not have commit access to the source. Sure you can check it out of SCM but if you want to make a change you have to post it to the forum or send someone an email. The Zabbix developers are human, and humans forget to do things or get overwhelmed with deadlines an so forth. (Though I think Richlv is a cyborg... but that's for another thread... Just kiddin Richlv )

                      If you keep your project independent you also have the ability of having a group of people work with you as mentioned above. Now it is possible you may be able to work out a deal with the Zabbix team where they will take the most recent stable snapshot of your code and integrate it with each production release, that I could easily see happening, and you get the best of both worlds!
                      RHCE, author of zbxapi
                      Ansible, the missing piece (Zabconf 2017): https://www.youtube.com/watch?v=R5T9NidjjDE
                      Zabbix and SNMP on Linux (Zabconf 2015): https://www.youtube.com/watch?v=98PEHpLFVHM

                      Comment


                        #41
                        Earlier

                        I wrote something like this a few months ago for work but couldn't release it due to licensing issues. Still, I'm glade to see something like this out there that anyone can use.
                        -Paul

                        Comment


                          #42
                          Originally posted by siriusshiu-2010 View Post
                          Hi all,

                          I had following the above installation, then I get the following result.
                          Many thanks for help.
                          Hey you must select your MIB, than it will load oid tree. No Mib selected, nothing to show. And for lookup and select oid as item, you must fill your device ip + community too.

                          Comment


                            #43
                            I make a quick fix for zabbix 1.8.1. Now I named snmpbuilder following zabbix version which it work for.

                            Change log:
                            • Fix undefined index warnings.
                            • Include danrog's fix for non-numeric indexes.
                            • From 1.8.1, zabbix not accept specified chars in key name. So I must replace them with underscore.


                            http://yangho.byethost22.com/wiki/do...g:snmp_builder

                            Most of problem is background snmp commands. So you guys must make sure snmpget, snmptranslate work in your system. Some MIBs required other related MIBs to work. If you see same error:
                            .Cannot find module (CISCO-SMI): At line 22 in /home/zabbix/public_html/snmp_builder/mibs/OLD-CISCO-TS-MIB mib Cannot find module (CISCO-SMI): At line 22 in /home/zabbix/public_html/snmp_builder/mibs/OLD-CISCO-TS-MIB.mib

                            It means you must download CISCO-SMI mib for snmp command working fine.
                            Last edited by giapnguyen; 08-02-2010, 10:15.

                            Comment


                              #44
                              I should have replied sooner. The string issue, wasn't the only problem I found. Some other tables in my MIB use 64 bit counters (on top of string based indexes). I haven't dug to much into it, but I do see the snmp_builder.js is not looking at 64bit counters.

                              Giapnguyen, is there an easy fix for that? Also, I still see an issue with string based indexes

                              Code:
                              {"error":"Oid is null F5-BIGIP-LOCAL-MIB::ltmVirtualServStatCsMinConnDur.\"www.blah.com\""}

                              Comment


                                #45
                                I had to make the following fix to make snmp_builder work for me with some of the vendor MIBs I've been importing. The problem is that the snmp_builder needs to interrogate every MIB file to find it's proper MIB name. The filename does not always equate to the MIB name. I have tested this work properly against the MIB files from Juniper for their Netscreens, which use differing MIB names and filenames.

                                The change begins at line 315 and essentially a drop in replacement for the whole foreach command.
                                PHP Code:
                                    foreach(glob($path."/*.mib")  as $filename){
                                      if (
                                preg_match('/^'.preg_quote($path,'/').'\/(.+)\.mib$/',$filename,$matches)){
                                        
                                $result=exec("cat ".$filename."| grep -i 'DEFINITIONS.*::=.*BEGIN'|awk '{print $1}'");
                                        
                                $cmbMibs->addItem($result,$result);
                                      }
                                    } 
                                I know this is not the most "php" way of doing things, but quick and dirty scripting is what I'm good at. :-) Also I don't know if it's possible to have multiple DEFINITIONS statements within an MIB file. If this is the case this patch will fail.
                                RHCE, author of zbxapi
                                Ansible, the missing piece (Zabconf 2017): https://www.youtube.com/watch?v=R5T9NidjjDE
                                Zabbix and SNMP on Linux (Zabconf 2015): https://www.youtube.com/watch?v=98PEHpLFVHM

                                Comment

                                Working...
                                X