Ad Widget
Collapse
ESXi 4.0 Hardware and Software Monitoring VMWare
Collapse
X
-
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
-
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.logComment
-
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:
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: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;
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: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
I'm sure that's not the right way to do it because now the script won't even run.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";
:
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?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
Comment
-
You can useSo, I guess.. what's the right way to set these variables so the daemonized zabbix process won't have any problems running the commands?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
$ENV{'PATH'} = "/home/zabbix/perl5/bin:".$ENV{'PATH'};Comment
-
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
-
Hi 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.
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
-
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 FilesComment
-
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
Comment