Ad Widget

Collapse

ESXi 4.0 Hardware and Software Monitoring VMWare

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • dima_dm
    Senior Member
    • Dec 2009
    • 2697

    #181
    Originally posted by ehermouet
    How zabbix take information from txt file ? because on my graph i have no data and maybe there is an error in my template or config file.

    i do interval 60s and cron every min.
    Via UserParameter in zabbix_agentd on zabbix_server.
    Check permission on text file for user zabbix.
    su - zabbix
    egrep -i "SMX_NumericSensor_1:" /tmp/vmware_IP.txt|sed 's/.*\t//'

    Comment

    • ehermouet
      Member
      • May 2011
      • 50

      #182
      It's 777. i try before to chmod 777 on /tmp and grep works
      but nothing on graph "no data" :'(

      maybe stupid question but on userparameter i must replace $x with good value ?

      Comment

      • dima_dm
        Senior Member
        • Dec 2009
        • 2697

        #183
        Originally posted by ehermouet
        It's 777. i try before to chmod 777 on /tmp and grep works
        but nothing on graph "no data" :'(

        maybe stupid question but on userparameter i must replace $x with good value ?
        No.
        You must add UserParameter as is in zabbix_agentd.conf and restart zabbix_agentd.
        /etc/zabbix/zabbix_agentd.conf
        Server=127.0.0.1
        # Specifies debug level
        # 0 - debug is not created
        # 1 - critical information
        # 2 - error information
        # 3 - warnings (default)
        # 4 - for debugging (produces lots of information)

        DebugLevel=4
        Then see log in /tmp/zabbix_agentd.log


        Example:
        data in /tmp/vmware_172.16.38.103.txt
        sensor SMX_NumericSensor_2

        UserParameter=NumericSensor[*],egrep -i "SMX_NumericSensor_$2:" /tmp/vmware_$1.txt|sed 's/.*\t//'

        Test from cli on Zabbix_Server
        /usr/local/bin/zabbix_get -s localhost -k NumericSensor[172.16.38.103,2]
        Last edited by dima_dm; 14-09-2012, 08:56.

        Comment

        • ehermouet
          Member
          • May 2011
          • 50

          #184
          Test from cli on Zabbix_Server
          /usr/local/bin/zabbix_get -s localhost -k NumericSensor[172.16.38.103,2]
          -> it works

          but nothing on graph

          i think my problem come from not supported zabbix agent...
          Last edited by ehermouet; 14-09-2012, 16:28.

          Comment

          • dima_dm
            Senior Member
            • Dec 2009
            • 2697

            #185
            Originally posted by ehermouet
            -> it works

            but nothing on graph

            i think my problem come from not supported zabbix agent...
            In Zabbix WEB Interface HOST IP Address = 127.0.0.1 for ALL ESXi hypervisor.

            Comment

            • ehermouet
              Member
              • May 2011
              • 50

              #186
              hi,

              yes it's that i do, but i thiunk my problem is on zabbix 2.0 and "not supported" for zabbix agent.

              Comment

              • Kryol
                Member
                • Feb 2011
                • 70

                #187
                Originally posted by ehermouet
                hi,

                yes it's that i do, but i thiunk my problem is on zabbix 2.0 and "not supported" for zabbix agent.
                Check your timeout settings

                Comment

                • ehermouet
                  Member
                  • May 2011
                  • 50

                  #188
                  Tks for trying to help me

                  my server and agent are on timeout 30 but same result "not supported"

                  Comment

                  • dima_dm
                    Senior Member
                    • Dec 2009
                    • 2697

                    #189
                    Originally posted by ehermouet
                    Tks for trying to help me

                    my server and agent are on timeout 30 but same result "not supported"
                    On zabbix_server
                    /etc/zabbix/zabbix_agentd.conf
                    # Specifies debug level
                    # 0 - debug is not created
                    # 1 - critical information
                    # 2 - error information
                    # 3 - warnings (default)
                    # 4 - for debugging (produces lots of information)

                    DebugLevel=4
                    Restart zabbix_agentd.
                    Then see log in /tmp/zabbix_agentd.log

                    Comment

                    • churnd
                      Junior Member
                      • Sep 2012
                      • 3

                      #190
                      ENV issues

                      I'm having some environment issues & not sure what to do. On my ubuntu server, zabbix_agentd runs as user zabbix. When installing the vSphere CLI Perl SDK, I noticed it set some variables in the user's environment:

                      Code:
                      export PERL_LOCAL_LIB_ROOT="/home/zabbix/perl5";
                      export PERL_MB_OPT="--install_base /home/zabbix/perl5";
                      export PERL_MM_OPT="INSTALL_BASE=/home/zabbix/perl5";
                      export PERL5LIB="/home/zabbix/perl5/lib/perl5/x86_64-linux-gnu-thread-multi:/home/zabbix/perl5/lib/perl5";
                      export PATH="/home/zabbix/perl5/bin:$PATH";
                      export PERL_LWP_SSL_VERIFY_HOSTNAME=0;
                      When I actually log in as user zabbix, I can run /etc/zabbix/zabbix_perl_api_vmware.pl fine, & it writes the file out to /tmp/ as expected. However, the daemonized process that starts up with the zabbix server doesn't seem to source the environment as needed, because this shows up in the log file:

                      Code:
                        1048:20120922:175153.050 No active checks on server: host [Zabbix server] not found
                      Can't locate Archive/Zip.pm in @INC (@INC contains: /usr/lib/vmware-vcli/apps/ /etc/perl /usr/local/lib/perl/5.14.2 /usr/local/share/perl/5.14.2 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.14 /usr/share/perl/5.14 /usr/local/lib/site_perl .) at /usr/share/perl/5.14/VMware/VIExt.pm line 11.
                      BEGIN failed--compilation aborted at /usr/share/perl/5.14/VMware/VIExt.pm line 11.
                      Compilation failed in require at /etc/zabbix/zabbix_perl_api_vmware.pl line 48.
                      BEGIN failed--compilation aborted at /etc/zabbix/zabbix_perl_api_vmware.pl line 48.
                        1048:20120922:175353.073 No active checks on server: host [Zabbix server] not found
                      egrep: /tmp/vmware_api_10.0.1.8.txt: No such file or directory
                      egrep: /tmp/vmware_api_10.0.1.8.txt: No such file or directory
                      egrep: /tmp/vmware_api_10.0.1.8.txt: No such file or directory
                      So, based on a previous post in this thread, I tried adding the following to the beginning of the zabbix_perl_api_vmware.pl file:

                      Code:
                      $ENV{'PERL_LWP_SSL_VERIFY_HOSTNAME'} = 0;
                      $ENV{'PERL_LOCAL_LIB_ROOT'} = "/home/zabbix/perl5";
                      $ENV{'PERL_MB_OPT'} = "--install_base /home/zabbix/perl5";
                      $ENV{'PERL_MM_OPT'} = "INSTALL_BASE=/home/zabbix/perl5";
                      $ENV{'PERL5LIB'} = "/home/zabbix/perl5/lib/perl5/x86_64-linux-gnu-thread-multi:/home/zabbix/perl5/lib/perl5";
                      $ENV{'PATH'} = "/home/zabbix/perl5/bin:$PATH";
                      I'm sure that's not the right way to do it because now the script won't even run. :

                      Code:
                      $ /etc/zabbix/zabbix_perl_api_vmware.pl 
                      Name "main::PATH" used only once: possible typo at /etc/zabbix/zabbix_perl_api_vmware.pl line 11.
                      Use of uninitialized value $PATH in concatenation (.) or string at /etc/zabbix/zabbix_perl_api_vmware.pl line 11.
                      1
                      So, I guess.. what's the right way to set these variables so the daemonized zabbix process won't have any problems running the commands?

                      Comment

                      • dima_dm
                        Senior Member
                        • Dec 2009
                        • 2697

                        #191
                        Originally posted by churnd
                        Code:
                        $ /etc/zabbix/zabbix_perl_api_vmware.pl 
                        Name "main::PATH" used only once: possible typo at /etc/zabbix/zabbix_perl_api_vmware.pl line 11.
                        Use of uninitialized value $PATH in concatenation (.) or string at /etc/zabbix/zabbix_perl_api_vmware.pl line 11.
                        1
                        So, I guess.. what's the right way to set these variables so the daemonized zabbix process won't have any problems running the commands?
                        You can use
                        $ENV{'PATH'} = "/home/zabbix/perl5/bin:".$ENV{'PATH'};

                        Comment

                        • Jason
                          Senior Member
                          • Nov 2007
                          • 430

                          #192
                          Just thought I'd share how we've decided to monitor esxi hosts...

                          As the ESXi servers we're monitoring are all remote and behind firewalls then whatever we use has to be active (either zabbix_sender or zabbix_agent).

                          I downloaded the vSphere Management Agent and installed it on the host. These come with python and perl already installed. Just installed pywbem onto this and used (with a bit of modification) an old python/wbem script from here to pull out all the relevant information and dump to a text file.

                          As the VMA is SuSE 11 then I took one of the precompiled SuSE agents and installed it to this virtual. It seems to run ok...

                          Then I just used a perl script to query the text file I pulled out earlier. I specify the line I'm interested in from zabbix and the perl script just locates either the status or the value for that line. Combine that with snmp checks on the host itself (from the agent) it seems to cover most bases... I've squeezed the virtual down to 128MB of RAM on the host and might be able to squeeze it further.

                          I have zabbix monitoring to make sure the text file is updated regularly...

                          I can post the scripts early next week if anyone is interested...

                          Ideally I'd like to have just 1 script that directly queries the host and pulls out the value you specify and do away with the text files and the problem of keeping them updated, but neither my python or perl is that good yet.

                          Comment

                          • exebit
                            Junior Member
                            • Oct 2012
                            • 1

                            #193
                            Originally posted by Jason
                            I can post the scripts early next week if anyone is interested...

                            Ideally I'd like to have just 1 script that directly queries the host and pulls out the value you specify and do away with the text files and the problem of keeping them updated, but neither my python or perl is that good yet.
                            Hi Jason.

                            I kindly ask you to post your scripts. I am at the beginning of ESX monitoring setup and I hope your work make my way shorter.

                            Comment

                            • Jason
                              Senior Member
                              • Nov 2007
                              • 430

                              #194
                              Ok, I've attached an archive of the files I've used.

                              I put this at the bottom of the agent config file...

                              UserParameter=esxi_get_data,/home/zabbix/get_esxi_data.pl
                              UserParameter=esxi_data_age,/home/zabbix/check_age.pl
                              UserParameter=esxi_read_data[*],/home/zabbix/read_esxi_data.pl "$1" $2
                              UserParameter=snmp_read[*],snmpget -c public -v 2c -O qtv $1 $2

                              The read_esxi_data returns either 1, 2 or 3 depending on whether successful, syntax error or credential error... This file also needs editing with credentials of your ESXi host.

                              Using zabbix I schedule the get)esxi_data to be run periodically and then the read_esxi_data usign the following format.

                              Key: esxi_read_data["Drive /d+_1 on controller",status]

                              The script changes the / to \ which enables you to do some basic regex in your calling code.

                              I'm planning to modify the list_params.py file soon to pull out the raw ipmi data too as it's a different format to the rest.

                              If anyone can see a better way of doing this then let me know. Ideally I'd like to be able to pull values out directly rather than via text files.
                              Attached Files

                              Comment

                              • ehermouet
                                Member
                                • May 2011
                                • 50

                                #195
                                Hi,

                                i have another way to do it. but i don't know how to integer to zabbix.
                                the value with esxtop are much more important.

                                so it possible to export them to csv file. now i search mean to import this cvs file on my zabbix. but i don't found the mean.

                                anybody can help me ?

                                Comment

                                Working...