Ad Widget

Collapse

SNMP Builder for Zabbix

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • rubendob
    Member
    • Apr 2012
    • 36

    #241
    Originally posted by sire
    rubendob,

    Choose a MIB first, for example, IF-MIB, then enter the IP address and Community string of your SNMP device. That should be enough for the start.
    I think something goes wrong with my installation I choose IF-MIB, I enter ip addreess and the community string but nothing happens, OID tree, always blank.

    Comment

    • sire
      Senior Member
      • Jul 2010
      • 210

      #242
      Originally posted by rubendob
      I think something goes wrong with my installation I choose IF-MIB, I enter ip addreess and the community string but nothing happens, OID tree, always blank.
      Are there any errors in the web server error log file? This may also be a problem with JavaScript. I tested SNMP Builder in Firefox 3.
      Regards,
      Sergey Syreskin

      Monitored hosts: 2646 / Active items: 23604 / Server performance: 765.74

      Temporary out of Zabbix business

      Comment

      • rubendob
        Member
        • Apr 2012
        • 36

        #243
        php issue?

        Actually yes I can see following

        [Mon Apr 23 11:16:32 2012] [error] [client 79.158.55.68] PHP Fatal error: Call to undefined function json_encode() in /var/www/html/zabbix/snmp_builder.php on line 679, referer: http://188.65.88.34/zabbix/snmp_builder.php

        Our environment is

        CentOS 6.2
        PHP 5.3.3 (cli) (built: Feb 2 2012 23:47:49)
        Copyright (c) 1997-2010 The PHP Group
        Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies

        and about php compilation i can see json is enabled as shared

        [root@zabbix zabbix]# php -i|grep json --colour
        Configure Command => './configure' '--build=x86_64-redhat-linux-gnu' '--host=x86_64-redhat-linux-gnu' '--target=x86_64-redhat-linux-gnu' '--program-prefix=' '--prefix=/usr' '--exec-prefix=/usr' '--bindir=/usr/bin' '--sbindir=/usr/sbin' '--sysconfdir=/etc' '--datadir=/usr/share' '--includedir=/usr/include' '--libdir=/usr/lib64' '--libexecdir=/usr/libexec' '--localstatedir=/var' '--sharedstatedir=/var/lib' '--mandir=/usr/share/man' '--infodir=/usr/share/info' '--cache-file=../config.cache' '--with-libdir=lib64' '--with-config-file-path=/etc' '--with-config-file-scan-dir=/etc/php.d' '--disable-debug' '--with-pic' '--disable-rpath' '--without-pear' '--with-bz2' '--with-exec-dir=/usr/bin' '--with-freetype-dir=/usr' '--with-png-dir=/usr' '--with-xpm-dir=/usr' '--enable-gd-native-ttf' '--without-gdbm' '--with-gettext' '--with-gmp' '--with-iconv' '--with-jpeg-dir=/usr' '--with-openssl' '--with-pcre-regex=/usr' '--with-zlib' '--with-layout=GNU' '--enable-exif' '--enable-ftp' '--enable-magic-quotes' '--enable-sockets' '--enable-sysvsem' '--enable-sysvshm' '--enable-sysvmsg' '--with-kerberos' '--enable-ucd-snmp-hack' '--enable-shmop' '--enable-calendar' '--without-sqlite' '--with-libxml-dir=/usr' '--enable-xml' '--with-system-tzdata' '--enable-force-cgi-redirect' '--enable-pcntl' '--with-imap=shared' '--with-imap-ssl' '--enable-mbstring=shared' '--enable-mbregex' '--with-gd=shared' '--enable-bcmath=shared' '--enable-dba=shared' '--with-db4=/usr' '--with-xmlrpc=shared' '--with-ldap=shared' '--with-ldap-sasl' '--with-mysql=shared,/usr' '--with-mysqli=shared,/usr/lib64/mysql/mysql_config' '--enable-dom=shared' '--with-pgsql=shared' '--enable-wddx=shared' '--with-snmp=shared,/usr' '--enable-soap=shared' '--with-xsl=shared,/usr' '--enable-xmlreader=shared' '--enable-xmlwriter=shared' '--with-curl=shared,/usr' '--enable-fastcgi' '--enable-pdo=shared' '--with-pdo-odbc=shared,unixODBC,/usr' '--with-pdo-mysql=shared,/usr/lib64/mysql/mysql_config' '--with-pdo-pgsql=shared,/usr' '--with-pdo-sqlite=shared,/usr' '--with-sqlite3=shared,/usr' '--enable-json=shared' '--enable-zip=shared' '--without-readline' '--with-libedit' '--with-pspell=shared' '--enable-phar=shared' '--with-tidy=shared,/usr' '--enable-sysvmsg=shared' '--enable-sysvshm=shared' '--enable-sysvsem=shared' '--enable-posix=shared' '--with-unixODBC=shared,/usr' '--enable-fileinfo=shared' '--enable-intl=shared' '--with-icu-dir=/usr' '--with-enchant=shared,/usr' '--with-recode=shared,/usr'


        Php issue? Is a problem of our php installation?

        Comment

        • sire
          Senior Member
          • Jul 2010
          • 210

          #244
          rubendob,

          You may try to replace
          PHP Code:
          json_encode($x
          with
          PHP Code:
          $json = new CJSON();
          $y $json->encode($x); 
          And the same with decode if needed.

          If this doesn't help, investigate your PHP issue.
          Regards,
          Sergey Syreskin

          Monitored hosts: 2646 / Active items: 23604 / Server performance: 765.74

          Temporary out of Zabbix business

          Comment

          • rubendob
            Member
            • Apr 2012
            • 36

            #245
            Done!

            Hi guys

            well, I have been finding what's going on with my php installation and finally I have managed to fix it. I really don't know why this behaviour, in any case, this is what I did to fix

            Code:
            # yumdownloader php-common
            # rpm -Uvh --force php-common*.rpm
            # service httpd reload
            # rm php-common*.rpm
            I found this solution in stackoverflow.com, so now I can see something in my OID Tree!

            I don't know yet if this is working, I am going to test with some snmp device.

            I will inform about my progress.

            Thanks Sire and you other people
            Last edited by rubendob; 23-04-2012, 16:04.

            Comment

            • rubendob
              Member
              • Apr 2012
              • 36

              #246
              I'm glad to confirm...

              ... that Sire's snmp-build works perfectly I am able to query snmp devices. Thanks to Sire for their help to my newbie questions.

              You rocks guys

              Comment

              • snevas
                Junior Member
                • May 2012
                • 4

                #247
                Zabbix 1.8.12

                First of all, this is a great feature to have. Only it isn't working for me.

                Maybe it's the new zabbix version (I'm using 1.8.12).

                Configuration:
                Solaris 10 with Oracle backend
                PHP compiled with net-smnp and all other requirements.
                I used version 1.8.1 of the SMNP Builder from https://github.com/giapnguyen/snmpbuilder

                Output from the test.php (from the 1st page) and smnptranslate attached.

                The error is that there isn't a tree. I also tested on the appliance, this isn't working either.
                No errors in the apache error_log.

                I hope someone can help me/update the script for the new zabbix release.
                Attached Files

                Comment

                • rubendob
                  Member
                  • Apr 2012
                  • 36

                  #248
                  Hi

                  HI snevas

                  I can't help you because I am not a snmp and zabbix expert but I can tell you my experience. I have the latest Zabbix Server running into CentOS 6 vps and running with Snmp-Builder version of Sire. He helped me a lot and finally I was able to make it. I had a issue with php-common rpm that I commented in this forum few days ago.

                  Read this thread completely and you'll discover lot of info.

                  Best regards

                  Comment

                  • snevas
                    Junior Member
                    • May 2012
                    • 4

                    #249
                    Thanks rubendob,

                    The sire-version works (2nd version with manual en-gb fix) but I can't export the OID's and data in the mibs. We have a custom mib and each item in the tree gives this error:
                    No Such Object available on this agent at this OID

                    Also see the the attached screenshot.

                    I only thing I want is that the OID in the mibs translated to names and triggers.
                    Attached Files

                    Comment

                    • sire
                      Senior Member
                      • Jul 2010
                      • 210

                      #250
                      Hi snevas,

                      Host field is for address of your SNMP-enabled device, for which you want to make a template from a MIB. Is it really 127.0.0.1 as on a screen shot you provided?
                      Regards,
                      Sergey Syreskin

                      Monitored hosts: 2646 / Active items: 23604 / Server performance: 765.74

                      Temporary out of Zabbix business

                      Comment

                      • snevas
                        Junior Member
                        • May 2012
                        • 4

                        #251
                        Yes it is. The server (on which zabbix is also installed) sends/recieves the traps and recieves traps from other servers in this environment.

                        Comment

                        • sire
                          Senior Member
                          • Jul 2010
                          • 210

                          #252
                          Originally posted by snevas
                          Yes it is. The server (on which zabbix is also installed) sends/recieves the traps and recieves traps from other servers in this environment.
                          Does snmpwalk -v 2c -c public 127.0.0.1 give any data?
                          Regards,
                          Sergey Syreskin

                          Monitored hosts: 2646 / Active items: 23604 / Server performance: 765.74

                          Temporary out of Zabbix business

                          Comment

                          • snevas
                            Junior Member
                            • May 2012
                            • 4

                            #253
                            Originally posted by sire
                            Does snmpwalk -v 2c -c public 127.0.0.1 give any data?
                            Yes it does. Loads of it. This is a little bit of the data:
                            Code:
                            ...
                            NOTIFICATION-LOG-MIB::nlmLogDateAndTime."default".535 = STRING: 2012-5-14,7:20:48.0,+2:0
                            NOTIFICATION-LOG-MIB::nlmLogDateAndTime."default".536 = STRING: 2012-5-14,7:30:48.0,+2:0
                            NOTIFICATION-LOG-MIB::nlmLogDateAndTime."default".537 = STRING: 2012-5-14,7:40:48.0,+2:0
                            NOTIFICATION-LOG-MIB::nlmLogDateAndTime."default".538 = STRING: 2012-5-14,7:50:48.0,+2:0
                            NOTIFICATION-LOG-MIB::nlmLogDateAndTime."default".539 = STRING: 2012-5-14,8:0:48.0,+2:0
                            NOTIFICATION-LOG-MIB::nlmLogDateAndTime."default".540 = STRING: 2012-5-14,8:10:48.0,+2:0
                            ...

                            Comment

                            • sire
                              Senior Member
                              • Jul 2010
                              • 210

                              #254
                              Hi snevas,

                              Does SNMP Builder work with other MIBs, for example, IF-MIB? If it does, then the problem probably is in your MIB, i.e. SNMP Builder fails to parse it.
                              Regards,
                              Sergey Syreskin

                              Monitored hosts: 2646 / Active items: 23604 / Server performance: 765.74

                              Temporary out of Zabbix business

                              Comment

                              • chrisransley
                                Junior Member
                                • May 2012
                                • 5

                                #255
                                zabbix-1.8.13

                                Hi,

                                Is there a patch for v1.8.13

                                Code:
                                The text leading up to this was:
                                --------------------------
                                |diff -Nur zabbix-1.8.12.orig/frontends/php/include/locales/ru_ru.inc.php zabbix-1.8.12/frontends/php/include/locales/ru_ru.inc.php
                                |--- zabbix-1.8.12.orig/frontends/php/include/locales/ru_ru.inc.php     2012-04-13 10:40:35.000000000 +0400
                                |+++ zabbix-1.8.12/frontends/php/include/locales/ru_ru.inc.php  2012-04-11 17:15:19.000000000 +0400
                                --------------------------
                                File to patch: /var/www/html/zabbix/include/locales/en_gb.inc.php
                                patching file /var/www/html/zabbix/include/locales/en_gb.inc.php
                                Hunk #1 FAILED at 2150.
                                1 out of 1 hunk FAILED -- saving rejects to file /var/www/html/zabbix/include/locales/en_gb.inc.php.rej
                                can't find file to patch at input line 62
                                Perhaps you used the wrong -p or --strip option?

                                Comment

                                Working...