Ad Widget

Collapse

VmBix 2.0 released

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • tatapoum
    Senior Member
    • Jan 2014
    • 185

    #1

    VmBix 2.0 released

    Hi,
    I updated VmBix to version 2.0. Here are the main changes :
    * Switched VMWare Java API to YAViJava 6.0.3 instead of ViJava 5.1. This adds support for VMWare API 5.5 and 6.0.
    * Switched from ant/ivy to Maven.
    * Added Logback for logging (and removed the verbose parameter). The logging configuration is now defined in the /etc/vmbix/logback.xml file.
    * vmbix command now logs to console and vmbixd logs to file (/var/log/vmbix.log by default).
    * Added support for NAS datastores (thank you Andrea).
    * Slightly refactored the code.

    You can find the full CHANGELOG here :
    https://github.com/dav3860/vmbix/blo...r/CHANGELOG.md.

    And you can download the latest release here : https://github.com/dav3860/vmbix/releases.

    I've also added Zabbix 3.0 support for the VmBix Zabbix loadable module : https://github.com/dav3860/vmbix_zabbix_module.
    Last edited by tatapoum; 13-03-2016, 18:03.
  • stav13
    Member
    • Oct 2013
    • 66

    #2
    Multiple vCenters

    Hi,

    I have got this setup and working really well however I run two vCenters environments at work and unsure how I can monitor both of them. I have read through some comments on your github page and they reference running another instance however im not sure how you would actually do this .....

    Any pointers?

    Thanks

    Comment

    • tatapoum
      Senior Member
      • Jan 2014
      • 185

      #3
      VmBix isn't designed yet to support multiple vCenter but you can run multiple instances side by side :
      - replace /etc/vmbix/vmbix.conf with two vmbix configuration files in /etc/vmbix :
      vmbix_vc1.conf & vmbix_vc2.conf
      - replace /etc/vmbix/logback.conf with two logback configuration files in /etc/vmbix :
      logback_vc1.conf & logback_vc2.conf
      - in vmbix_vc1.conf, put the connection details to your vCenter, define an explicit PID file, ex : pidfile=/var/run/vmbix_vc1.pid, and a specific port for each vCenter instance, ex 12051. Same in vmbix_vc2.conf.
      - in logback_vc1.conf, define the path to the log file, ex : /var/log/vmbix_vc1...
      Same in logback_vc2.conf
      - replace the file /usr/local/sbin/vmbixd with /usr/local/sbin/vmbixd_vc1 & /usr/local/sbin/vmbixd_vc2.
      Change the last line :
      $java -Dlogback.configurationFile="/etc/vmbix/logback.xml" -jar $jar $* 2>&1 &
      Must be (for vc1) :
      $java -Dlogback.configurationFile="/etc/vmbix/logback_vc1.xml" -jar $jar $* 2>&1 &
      - replace the file /etc/init.d/vmbixd with /etc/init.d/vmbixd_vc1 & /etc/init.d/vmbixd_vc2. Set the right parameters for configfile and pidfile.
      - register the new services in chkconfig.

      Now you have have two functional VmBix instances that you can start with service vmbix_vc1 start.

      If you use the VmBix Zabbix loadable module, you should compile a new library for each vCenter instance. You need to :
      - change the path to the vmbix configuration file in the C source code
      - also rename the exposed items (vmbix & vmbix.ping) to vmbix_vc1 & vmbix_vc1.ping & so on
      - rename the resultant vmbix.so to vmbix_vc1.so & vmbix_vc2.so.
      - in the Zabbix Server configuration file, load the two libraries : vmbix_vc1.so & vmbix_vc2.so.

      Then in Zabbix, the checked items must be renamed to vmbix_vc1[...] or vmbix_vc2[...].

      Comment

      • stav13
        Member
        • Oct 2013
        • 66

        #4
        Originally posted by tatapoum
        VmBix isn't designed yet to support multiple vCenter but you can run multiple instances side by side :
        - replace /etc/vmbix/vmbix.conf with two vmbix configuration files in /etc/vmbix :
        vmbix_vc1.conf & vmbix_vc2.conf
        - replace /etc/vmbix/logback.conf with two logback configuration files in /etc/vmbix :
        logback_vc1.conf & logback_vc2.conf
        - in vmbix_vc1.conf, put the connection details to your vCenter, define an explicit PID file, ex : pidfile=/var/run/vmbix_vc1.pid, and a specific port for each vCenter instance, ex 12051. Same in vmbix_vc2.conf.
        - in logback_vc1.conf, define the path to the log file, ex : /var/log/vmbix_vc1...
        Same in logback_vc2.conf
        - replace the file /usr/local/sbin/vmbixd with /usr/local/sbin/vmbixd_vc1 & /usr/local/sbin/vmbixd_vc2.
        Change the last line :
        $java -Dlogback.configurationFile="/etc/vmbix/logback.xml" -jar $jar $* 2>&1 &
        Must be (for vc1) :
        $java -Dlogback.configurationFile="/etc/vmbix/logback_vc1.xml" -jar $jar $* 2>&1 &
        - replace the file /etc/init.d/vmbixd with /etc/init.d/vmbixd_vc1 & /etc/init.d/vmbixd_vc2. Set the right parameters for configfile and pidfile.
        - register the new services in chkconfig.

        Now you have have two functional VmBix instances that you can start with service vmbix_vc1 start.

        If you use the VmBix Zabbix loadable module, you should compile a new library for each vCenter instance. You need to :
        - change the path to the vmbix configuration file in the C source code
        - also rename the exposed items (vmbix & vmbix.ping) to vmbix_vc1 & vmbix_vc1.ping & so on
        - rename the resultant vmbix.so to vmbix_vc1.so & vmbix_vc2.so.
        - in the Zabbix Server configuration file, load the two libraries : vmbix_vc1.so & vmbix_vc2.so.

        Then in Zabbix, the checked items must be renamed to vmbix_vc1[...] or vmbix_vc2[...].
        Wow, thanks for the quick response :-) will hopefully give it a go later!

        Many thanks!!

        Comment

        • stav13
          Member
          • Oct 2013
          • 66

          #5
          Originally posted by tatapoum
          VmBix isn't designed yet to support multiple vCenter but you can run multiple instances side by side :
          - replace /etc/vmbix/vmbix.conf with two vmbix configuration files in /etc/vmbix :
          vmbix_vc1.conf & vmbix_vc2.conf
          - replace /etc/vmbix/logback.conf with two logback configuration files in /etc/vmbix :
          logback_vc1.conf & logback_vc2.conf
          - in vmbix_vc1.conf, put the connection details to your vCenter, define an explicit PID file, ex : pidfile=/var/run/vmbix_vc1.pid, and a specific port for each vCenter instance, ex 12051. Same in vmbix_vc2.conf.
          - in logback_vc1.conf, define the path to the log file, ex : /var/log/vmbix_vc1...
          Same in logback_vc2.conf
          - replace the file /usr/local/sbin/vmbixd with /usr/local/sbin/vmbixd_vc1 & /usr/local/sbin/vmbixd_vc2.
          Change the last line :
          $java -Dlogback.configurationFile="/etc/vmbix/logback.xml" -jar $jar $* 2>&1 &
          Must be (for vc1) :
          $java -Dlogback.configurationFile="/etc/vmbix/logback_vc1.xml" -jar $jar $* 2>&1 &
          - replace the file /etc/init.d/vmbixd with /etc/init.d/vmbixd_vc1 & /etc/init.d/vmbixd_vc2. Set the right parameters for configfile and pidfile.
          - register the new services in chkconfig.

          Now you have have two functional VmBix instances that you can start with service vmbix_vc1 start.

          If you use the VmBix Zabbix loadable module, you should compile a new library for each vCenter instance. You need to :
          - change the path to the vmbix configuration file in the C source code
          - also rename the exposed items (vmbix & vmbix.ping) to vmbix_vc1 & vmbix_vc1.ping & so on
          - rename the resultant vmbix.so to vmbix_vc1.so & vmbix_vc2.so.
          - in the Zabbix Server configuration file, load the two libraries : vmbix_vc1.so & vmbix_vc2.so.

          Then in Zabbix, the checked items must be renamed to vmbix_vc1[...] or vmbix_vc2[...].
          Im a bit stuck on the last part as i do want to use the module. Is there any chance you could rename the zabbix 3 C source code with the _vc1 example so i can understand exactly which parts do need altering? im sure other people would find this bit very useful as well.

          Thanks

          Comment

          • tatapoum
            Senior Member
            • Jan 2014
            • 185

            #6
            http://pastebin.com/UfYbnqbA

            Comment

            • stav13
              Member
              • Oct 2013
              • 66

              #7
              Hi when i go to compile the new file i get an error showing;

              vmbix-3.0_vc1.c:23:20: fatal error: common.h: No such file or directory

              Comment

              • stav13
                Member
                • Oct 2013
                • 66

                #8
                Originally posted by stav13
                Hi when i go to compile the new file i get an error showing;

                vmbix-3.0_vc1.c:23:20: fatal error: common.h: No such file or directory
                FYI i can still successfully run vmbix-3.0.c with no errors

                Comment

                • tatapoum
                  Senior Member
                  • Jan 2014
                  • 185

                  #9
                  Did you properly configure your environment ?
                  Code:
                  ZABBIXSERVER zabbix-3.0.1 # ./configure
                  checking for a BSD-compatible install... /usr/bin/install -c
                  checking whether build environment is sane... yes
                  checking for a thread-safe mkdir -p... /bin/mkdir -p
                  checking for gawk... gawk
                  checking whether make sets $(MAKE)... yes
                  checking whether make supports nested variables... yes
                  configure: Configuring Zabbix 3.0.1
                  checking whether make sets $(MAKE)... (cached) yes
                  checking build system type... x86_64-unknown-linux-gnu
                  checking host system type... x86_64-unknown-linux-gnu
                  [...]
                  Then :
                  Code:
                  ZABBIXSERVER zabbix-3.0.1 # cd src/modules/vmbix_zabbix_module/
                  ZABBIXSERVER vmbix_zabbix_module # make vmbix-3.0_vc1
                  gcc -shared -o vmbix_vc1.so vmbix-3.0_vc1.c -I../../../include -fPIC
                  Also check that you didn't insert strange characters in the file.

                  Comment

                  • stav13
                    Member
                    • Oct 2013
                    • 66

                    #10
                    I just reconfigured and ran again and it didnt work. I have also ran the "diff" command and the output is the same as yours. Would it be worth posting vmbix-3.0_vc1.c and vmbix_module_vc1.conf file and I can try that?

                    Thanks

                    Comment

                    • tatapoum
                      Senior Member
                      • Jan 2014
                      • 185

                      #11
                      It's just that gcc can't find the common headers (in ../../../include). Try to run the compilation command (in the vmbix_zabbix_module directory) :
                      Code:
                      gcc -shared -o vmbix_vc1.so vmbix-3.0_vc1.c -I../../../include -fPIC

                      Comment

                      • stav13
                        Member
                        • Oct 2013
                        • 66

                        #12
                        That work! cheers, now onto the next issue

                        when i restart the zabbix-server i have looked through the logs and see this;

                        zabbix_server [28377]: unknown parameter "serviceurl" in config file "/etc/vmbix/vmbix_vc1.conf", line 2

                        I have checked the .conf file and the serviceurl value is correct and I can connect to the vcenter manually using;

                        vmbix -P 12050 -u username -p password -s https://vcenter.mycompany.com/sdk

                        Any ideas?

                        Comment

                        • tatapoum
                          Senior Member
                          • Jan 2014
                          • 185

                          #13
                          /etc/vmbix/vmbix.conf and /etc/zabbix/vmbix_module.conf are different files. See :

                          Comment

                          • stav13
                            Member
                            • Oct 2013
                            • 66

                            #14
                            hmmm, ok I started from the beginning and now have it all installed however Im not getting anything through on zabbix and each host for my instances is showing "No response from VMBIX". In my message I see the below;

                            Mar 18 18:27:59 RUN-SRV-ZAB-P vmbixd_vc2: Starting vmbixd_vc2: [ OK ]
                            Mar 18 18:27:59 RUN-SRV-ZAB-P vmbixd_vc1: Starting vmbixd_vc1: [ OK ]
                            Mar 18 18:28:34 RUN-SRV-ZAB-P vmbixd_vc1: log4j:WARN No appenders could be found for logger (com.vmware.vim25.ws.XmlGenDom).
                            Mar 18 18:28:34 RUN-SRV-ZAB-P vmbixd_vc1: log4j:WARN Please initialize the log4j system properly.
                            Mar 18 18:28:34 RUN-SRV-ZAB-P vmbixd_vc1: log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.
                            Mar 18 18:28:34 RUN-SRV-ZAB-P vmbixd_vc2: log4j:WARN No appenders could be found for logger (com.vmware.vim25.ws.XmlGenDom).
                            Mar 18 18:28:34 RUN-SRV-ZAB-P vmbixd_vc2: log4j:WARN Please initialize the log4j system properly.
                            Mar 18 18:28:34 RUN-SRV-ZAB-P vmbixd_vc2: log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.

                            Comment

                            • tatapoum
                              Senior Member
                              • Jan 2014
                              • 185

                              #15
                              VmBix now logs to /var/log/vmbix.log by default. Please query VmBix with :
                              Code:
                              zabbix_get -s 127.0.0.1 -p 12050 -k "vm.status[VM_NAME]"
                              and paste what appears in the log file.

                              Comment

                              Working...