Мониторинг VmWare ESXi - cacti

VirtualBox, QEMU, ESX/ESXi и прочия
Правила форума
Убедительная просьба юзать теги [code] при оформлении листингов.
Сообщения не оформленные должным образом имеют все шансы быть незамеченными.
Аватара пользователя
Alex Keda
стреляли...
Сообщения: 35418
Зарегистрирован: 2004-10-18 14:25:19
Откуда: Made in USSR
Контактная информация:

Мониторинг VmWare ESXi - cacti

Непрочитанное сообщение Alex Keda » 2010-02-10 13:09:13

Небольшая документашка, для себя.
доработано из http://www.thelazysysadmin.net/2009/04/ ... ith-cacti/
Заводим в ESXi пользователя, добавляем ему права - только чтение.
тащщим под фрю из винды cli для управления виртуалками - я положил его в /root/scripts/VmWare/cli/
из него там используется тока директория с перловыми модулями

Код: Выделить всё

C:\Program Files\VMware\VMware vSphere CLI\Perl\lib\VMware
её я приживил сюда:

Код: Выделить всё

radius# ll /root/scripts/VmWare/cli/PerlModule/
total 2
drwxr-x--x  2 lissyara  wheel   512B  5 фев 13:37 VMware
radius#       
сделал симлинк:

Код: Выделить всё

radius# ll /usr/local/lib/perl5/5.10.1/VMware
lrwxr-xr-x  1 root  wheel    42B  5 фев 13:37 /usr/local/lib/perl5/5.10.1/VMware -> /root/scripts/VmWare/cli/PerlModule/VMware
radius#     
рядышком кладём скрипт такого содержания:

Код: Выделить всё

radius# more /root/scripts/VmWare/esxstats.pl
#!/usr/bin/perl -w
# This script was pulled together using iseas from various places

use Term::ReadKey;
use VMware::VIRuntime;

my $username = "nagios";
my $password = "super-mega-pass";
my $service_url = "https://".$ARGV[0]."/sdk";

# Login to Virtual Center service:
Vim::login(service_url => $service_url, user_name => $username, password => $password);

my $host_view = Vim::find_entity_views(
        view_type => 'HostSystem',
);

my ($host, $memTotal, $memUsed, $cpuMhz, $numCores, $cpuTotal, $cpuUsed, $aaa);

foreach $host ( @{$host_view} )
{

        $cpuMhz = $host->summary->hardware->cpuMhz;
        $numCores = $host->summary->hardware->numCpuCores;
        $cpuTotal = $cpuMhz * $numCores;
        $cpuUsed = $host->summary->quickStats->overallCpuUsage;
        $memTotal = $host->hardware->memorySize / 1048576; # in MB
        $memUsed = $host->summary->quickStats->overallMemoryUsage; # in MB

        printf("cpupercent:%0.2f mempercent:%0.2f\n", ($cpuUsed/$cpuTotal)*100, ($memUsed/$memTotal)*100);
}

radius#   
в кактус имплантируем такие два темплейта

Код: Выделить всё

<cacti>	
	<hash_0000193333971ab23c6f3fbc6758c995ed8167>
		<name>VMWare ESXi - Memory</name>
		<graph>
			<t_title></t_title>
			<title>|host_description| - VMWare ESXi - Memory</title>
			<t_image_format_id></t_image_format_id>
			<image_format_id>1</image_format_id>
			<t_height></t_height>
			<height>120</height>
			<t_width></t_width>
			<width>500</width>
			<t_slope_mode></t_slope_mode>
			<slope_mode>on</slope_mode>
			<t_auto_scale></t_auto_scale>
			<auto_scale>on</auto_scale>
			<t_auto_scale_opts></t_auto_scale_opts>
			<auto_scale_opts>2</auto_scale_opts>
			<t_auto_scale_log></t_auto_scale_log>
			<auto_scale_log></auto_scale_log>
			<t_scale_log_units></t_scale_log_units>
			<scale_log_units></scale_log_units>
			<t_auto_scale_rigid></t_auto_scale_rigid>
			<auto_scale_rigid></auto_scale_rigid>
			<t_auto_padding></t_auto_padding>
			<auto_padding>on</auto_padding>
			<t_export></t_export>
			<export>on</export>
			<t_upper_limit></t_upper_limit>
			<upper_limit>100</upper_limit>
			<t_lower_limit></t_lower_limit>
			<lower_limit>0</lower_limit>
			<t_base_value></t_base_value>
			<base_value>1000</base_value>
			<t_unit_value></t_unit_value>
			<unit_value></unit_value>
			<t_unit_exponent_value></t_unit_exponent_value>
			<unit_exponent_value></unit_exponent_value>
			<t_vertical_label></t_vertical_label>
			<vertical_label></vertical_label>
		</graph>
		<items>
			<hash_10001921c63115850048f873bbbdee06e57554>
				<task_item_id>hash_0800192e8f444c14c0fa9187cd15c3ef3f06fa</task_item_id>
				<color_id>FFC73B</color_id>
				<alpha>FF</alpha>
				<graph_type_id>7</graph_type_id>
				<consolidation_function_id>1</consolidation_function_id>
				<cdef_id>0</cdef_id>
				<value></value>
				<gprint_id>hash_060019e9c43831e54eca8069317a2ce8c6f751</gprint_id>
				<text_format>Memory Percent:</text_format>
				<hard_return></hard_return>
				<sequence>7</sequence>
			</hash_10001921c63115850048f873bbbdee06e57554>
			<hash_100019e669dafa83d840dfc0a049f375104748>
				<task_item_id>hash_0800192e8f444c14c0fa9187cd15c3ef3f06fa</task_item_id>
				<color_id>0</color_id>
				<alpha>FF</alpha>
				<graph_type_id>9</graph_type_id>
				<consolidation_function_id>1</consolidation_function_id>
				<cdef_id>0</cdef_id>
				<value></value>
				<gprint_id>hash_060019e9c43831e54eca8069317a2ce8c6f751</gprint_id>
				<text_format>Average:</text_format>
				<hard_return></hard_return>
				<sequence>8</sequence>
			</hash_100019e669dafa83d840dfc0a049f375104748>
			<hash_1000196b61f557768371294e1b83b54a6a917a>
				<task_item_id>hash_0800192e8f444c14c0fa9187cd15c3ef3f06fa</task_item_id>
				<color_id>0</color_id>
				<alpha>FF</alpha>
				<graph_type_id>9</graph_type_id>
				<consolidation_function_id>3</consolidation_function_id>
				<cdef_id>0</cdef_id>
				<value></value>
				<gprint_id>hash_060019e9c43831e54eca8069317a2ce8c6f751</gprint_id>
				<text_format>Maximum:</text_format>
				<hard_return>on</hard_return>
				<sequence>9</sequence>
			</hash_1000196b61f557768371294e1b83b54a6a917a>
		</items>
		<inputs>
			<hash_0900199f526d149c713ce6e19059e3d6f64fb3>
				<name>Data Source [esx_mempercent]</name>
				<description></description>
				<column_name>task_item_id</column_name>
				<items>hash_00001921c63115850048f873bbbdee06e57554|hash_000019e669dafa83d840dfc0a049f375104748|hash_0000196b61f557768371294e1b83b54a6a917a</items>
			</hash_0900199f526d149c713ce6e19059e3d6f64fb3>
		</inputs>
	</hash_0000193333971ab23c6f3fbc6758c995ed8167>
	<hash_01001981498091d6c7fcb2dfd66a42c5857790>
		<name>VMWare ESXi - Stats</name>
		<ds>
			<t_name></t_name>
			<name>|host_description| - VMWare ESXi - Stats</name>
			<data_input_id>hash_03001928cdbcec575e6cd81573d3ba44b918c8</data_input_id>
			<t_rra_id></t_rra_id>
			<t_rrd_step></t_rrd_step>
			<rrd_step>60</rrd_step>
			<t_active></t_active>
			<active>on</active>
			<rra_items>hash_150019c21df5178e5c955013591239eb0afd46|hash_1500190d9c0af8b8acdc7807943937b3208e29|hash_1500196fc2d038fb42950138b0ce3e9874cc60|hash_150019e36f3adb9f152adfa5dc50fd2b23337e|hash_150019283ea2bf1634d92ce081ec82a634f513</rra_items>
		</ds>
		<items>
			<hash_0800192e8f444c14c0fa9187cd15c3ef3f06fa>
				<t_data_source_name></t_data_source_name>
				<data_source_name>esx_mempercent</data_source_name>
				<t_rrd_minimum></t_rrd_minimum>
				<rrd_minimum>0</rrd_minimum>
				<t_rrd_maximum></t_rrd_maximum>
				<rrd_maximum>100</rrd_maximum>
				<t_data_source_type_id></t_data_source_type_id>
				<data_source_type_id>1</data_source_type_id>
				<t_rrd_heartbeat></t_rrd_heartbeat>
				<rrd_heartbeat>120</rrd_heartbeat>
				<t_data_input_field_id></t_data_input_field_id>
				<data_input_field_id>hash_0700199980d98c9021547d2a035e2a8929eea9</data_input_field_id>
			</hash_0800192e8f444c14c0fa9187cd15c3ef3f06fa>
			<hash_080019385bb1c2640bab326ca4012fbfdd0da2>
				<t_data_source_name></t_data_source_name>
				<data_source_name>esx_cpupercent</data_source_name>
				<t_rrd_minimum></t_rrd_minimum>
				<rrd_minimum>0</rrd_minimum>
				<t_rrd_maximum></t_rrd_maximum>
				<rrd_maximum>100</rrd_maximum>
				<t_data_source_type_id></t_data_source_type_id>
				<data_source_type_id>1</data_source_type_id>
				<t_rrd_heartbeat></t_rrd_heartbeat>
				<rrd_heartbeat>120</rrd_heartbeat>
				<t_data_input_field_id></t_data_input_field_id>
				<data_input_field_id>hash_07001915d109fd5d1d77f8ca9b7adba6efe785</data_input_field_id>
			</hash_080019385bb1c2640bab326ca4012fbfdd0da2>
		</items>
		<data>
			<item_000>
				<data_input_field_id>hash_070019267154ee3a480af5ac7cb5608b86b080</data_input_field_id>
				<t_value></t_value>
				<value></value>
			</item_000>
		</data>
	</hash_01001981498091d6c7fcb2dfd66a42c5857790>
	<hash_03001928cdbcec575e6cd81573d3ba44b918c8>
		<name>VMWare ESXi - Statistics</name>
		<type_id>1</type_id>
		<input_string>/root/scripts/VmWare/esxstats.pl <hostname></input_string>
		<fields>
			<hash_0700199980d98c9021547d2a035e2a8929eea9>
				<name>ESX Memory Percent</name>
				<update_rra>on</update_rra>
				<regexp_match></regexp_match>
				<allow_nulls></allow_nulls>
				<type_code></type_code>
				<input_output>out</input_output>
				<data_name>mempercent</data_name>
			</hash_0700199980d98c9021547d2a035e2a8929eea9>
			<hash_07001915d109fd5d1d77f8ca9b7adba6efe785>
				<name>ESX CPU Percent</name>
				<update_rra>on</update_rra>
				<regexp_match></regexp_match>
				<allow_nulls></allow_nulls>
				<type_code></type_code>
				<input_output>out</input_output>
				<data_name>cpupercent</data_name>
			</hash_07001915d109fd5d1d77f8ca9b7adba6efe785>
			<hash_070019267154ee3a480af5ac7cb5608b86b080>
				<name>hostname</name>
				<update_rra></update_rra>
				<regexp_match></regexp_match>
				<allow_nulls></allow_nulls>
				<type_code>hostname</type_code>
				<input_output>in</input_output>
				<data_name>hostname</data_name>
			</hash_070019267154ee3a480af5ac7cb5608b86b080>
		</fields>
	</hash_03001928cdbcec575e6cd81573d3ba44b918c8>
	<hash_150019c21df5178e5c955013591239eb0afd46>
		<name>Daily (5 Minute Average)</name>
		<x_files_factor>0.5</x_files_factor>
		<steps>1</steps>
		<rows>600</rows>
		<timespan>86400</timespan>
		<cf_items>1|3</cf_items>
	</hash_150019c21df5178e5c955013591239eb0afd46>
	<hash_1500190d9c0af8b8acdc7807943937b3208e29>
		<name>Weekly (30 Minute Average)</name>
		<x_files_factor>0.5</x_files_factor>
		<steps>6</steps>
		<rows>700</rows>
		<timespan>604800</timespan>
		<cf_items>1|3</cf_items>
	</hash_1500190d9c0af8b8acdc7807943937b3208e29>
	<hash_1500196fc2d038fb42950138b0ce3e9874cc60>
		<name>Monthly (2 Hour Average)</name>
		<x_files_factor>0.5</x_files_factor>
		<steps>24</steps>
		<rows>775</rows>
		<timespan>2678400</timespan>
		<cf_items>1|3</cf_items>
	</hash_1500196fc2d038fb42950138b0ce3e9874cc60>
	<hash_150019e36f3adb9f152adfa5dc50fd2b23337e>
		<name>Yearly (1 Day Average)</name>
		<x_files_factor>0.5</x_files_factor>
		<steps>288</steps>
		<rows>797</rows>
		<timespan>33053184</timespan>
		<cf_items>1|3</cf_items>
	</hash_150019e36f3adb9f152adfa5dc50fd2b23337e>
	<hash_150019283ea2bf1634d92ce081ec82a634f513>
		<name>Hourly (1 Minute Average)</name>
		<x_files_factor>0.5</x_files_factor>
		<steps>1</steps>
		<rows>500</rows>
		<timespan>14400</timespan>
		<cf_items>1|3</cf_items>
	</hash_150019283ea2bf1634d92ce081ec82a634f513>
	<hash_060019e9c43831e54eca8069317a2ce8c6f751>
		<name>Normal</name>
		<gprint_text>%8.2lf%s</gprint_text>
	</hash_060019e9c43831e54eca8069317a2ce8c6f751>
</cacti>

Код: Выделить всё

<cacti>	
	<hash_020017c17e2553b21c62b23e8527e056731ebc>
		<name>VmWare ESXi Host</name>
		<graph_templates>hash_000017e88fb1fbfcd2997b319c629210e27318|hash_0000173333971ab23c6f3fbc6758c995ed8167</graph_templates>
		<data_queries></data_queries>
	</hash_020017c17e2553b21c62b23e8527e056731ebc>
	<hash_000017e88fb1fbfcd2997b319c629210e27318>
		<name>VmWare ESXi - CPU</name>
		<graph>
			<t_title></t_title>
			<title>|host_description| - VmWare ESXi - CPU</title>
			<t_image_format_id></t_image_format_id>
			<image_format_id>1</image_format_id>
			<t_height></t_height>
			<height>120</height>
			<t_width></t_width>
			<width>500</width>
			<t_slope_mode></t_slope_mode>
			<slope_mode>on</slope_mode>
			<t_auto_scale></t_auto_scale>
			<auto_scale>on</auto_scale>
			<t_auto_scale_opts></t_auto_scale_opts>
			<auto_scale_opts>2</auto_scale_opts>
			<t_auto_scale_log></t_auto_scale_log>
			<auto_scale_log></auto_scale_log>
			<t_scale_log_units></t_scale_log_units>
			<scale_log_units></scale_log_units>
			<t_auto_scale_rigid></t_auto_scale_rigid>
			<auto_scale_rigid></auto_scale_rigid>
			<t_auto_padding></t_auto_padding>
			<auto_padding>on</auto_padding>
			<t_export></t_export>
			<export>on</export>
			<t_upper_limit></t_upper_limit>
			<upper_limit>100</upper_limit>
			<t_lower_limit></t_lower_limit>
			<lower_limit>0</lower_limit>
			<t_base_value></t_base_value>
			<base_value>1000</base_value>
			<t_unit_value></t_unit_value>
			<unit_value></unit_value>
			<t_unit_exponent_value></t_unit_exponent_value>
			<unit_exponent_value></unit_exponent_value>
			<t_vertical_label></t_vertical_label>
			<vertical_label></vertical_label>
		</graph>
		<items>
			<hash_100017304a89d69d7f6e6da9902a036ed9b835>
				<task_item_id>hash_080017385bb1c2640bab326ca4012fbfdd0da2</task_item_id>
				<color_id>0</color_id>
				<alpha>FF</alpha>
				<graph_type_id>9</graph_type_id>
				<consolidation_function_id>4</consolidation_function_id>
				<cdef_id>0</cdef_id>
				<value></value>
				<gprint_id>hash_060017e9c43831e54eca8069317a2ce8c6f751</gprint_id>
				<text_format>CPU Percent</text_format>
				<hard_return></hard_return>
				<sequence>8</sequence>
			</hash_100017304a89d69d7f6e6da9902a036ed9b835>
			<hash_10001726f878619677bb69f1bf2e826fd636d3>
				<task_item_id>hash_080017385bb1c2640bab326ca4012fbfdd0da2</task_item_id>
				<color_id>0</color_id>
				<alpha>FF</alpha>
				<graph_type_id>9</graph_type_id>
				<consolidation_function_id>1</consolidation_function_id>
				<cdef_id>0</cdef_id>
				<value></value>
				<gprint_id>hash_060017e9c43831e54eca8069317a2ce8c6f751</gprint_id>
				<text_format>Average:</text_format>
				<hard_return></hard_return>
				<sequence>9</sequence>
			</hash_10001726f878619677bb69f1bf2e826fd636d3>
			<hash_1000172f0fa11412fb36c3aad3e6413ebb20d7>
				<task_item_id>hash_080017385bb1c2640bab326ca4012fbfdd0da2</task_item_id>
				<color_id>0</color_id>
				<alpha>FF</alpha>
				<graph_type_id>9</graph_type_id>
				<consolidation_function_id>3</consolidation_function_id>
				<cdef_id>0</cdef_id>
				<value></value>
				<gprint_id>hash_060017e9c43831e54eca8069317a2ce8c6f751</gprint_id>
				<text_format>Maximum:</text_format>
				<hard_return>on</hard_return>
				<sequence>10</sequence>
			</hash_1000172f0fa11412fb36c3aad3e6413ebb20d7>
		</items>
		<inputs>
			<hash_0900179903e92bfbe0adeab4d7c2351f0cb763>
				<name>Data Source [esx_cpupercent]</name>
				<description></description>
				<column_name>task_item_id</column_name>
				<items>hash_000017304a89d69d7f6e6da9902a036ed9b835|hash_00001726f878619677bb69f1bf2e826fd636d3|hash_0000172f0fa11412fb36c3aad3e6413ebb20d7</items>
			</hash_0900179903e92bfbe0adeab4d7c2351f0cb763>
		</inputs>
	</hash_000017e88fb1fbfcd2997b319c629210e27318>
	<hash_0000173333971ab23c6f3fbc6758c995ed8167>
		<name>VmWare ESXi - Memory</name>
		<graph>
			<t_title></t_title>
			<title>|host_description| - VmWare ESXi - Memory</title>
			<t_image_format_id></t_image_format_id>
			<image_format_id>1</image_format_id>
			<t_height></t_height>
			<height>120</height>
			<t_width></t_width>
			<width>500</width>
			<t_slope_mode></t_slope_mode>
			<slope_mode>on</slope_mode>
			<t_auto_scale></t_auto_scale>
			<auto_scale>on</auto_scale>
			<t_auto_scale_opts></t_auto_scale_opts>
			<auto_scale_opts>2</auto_scale_opts>
			<t_auto_scale_log></t_auto_scale_log>
			<auto_scale_log></auto_scale_log>
			<t_scale_log_units></t_scale_log_units>
			<scale_log_units></scale_log_units>
			<t_auto_scale_rigid></t_auto_scale_rigid>
			<auto_scale_rigid></auto_scale_rigid>
			<t_auto_padding></t_auto_padding>
			<auto_padding>on</auto_padding>
			<t_export></t_export>
			<export>on</export>
			<t_upper_limit></t_upper_limit>
			<upper_limit>100</upper_limit>
			<t_lower_limit></t_lower_limit>
			<lower_limit>0</lower_limit>
			<t_base_value></t_base_value>
			<base_value>1000</base_value>
			<t_unit_value></t_unit_value>
			<unit_value></unit_value>
			<t_unit_exponent_value></t_unit_exponent_value>
			<unit_exponent_value></unit_exponent_value>
			<t_vertical_label></t_vertical_label>
			<vertical_label></vertical_label>
		</graph>
		<items>
			<hash_10001721c63115850048f873bbbdee06e57554>
				<task_item_id>hash_0800172e8f444c14c0fa9187cd15c3ef3f06fa</task_item_id>
				<color_id>0</color_id>
				<alpha>FF</alpha>
				<graph_type_id>9</graph_type_id>
				<consolidation_function_id>4</consolidation_function_id>
				<cdef_id>0</cdef_id>
				<value></value>
				<gprint_id>hash_060017e9c43831e54eca8069317a2ce8c6f751</gprint_id>
				<text_format>Memory Percent:</text_format>
				<hard_return></hard_return>
				<sequence>7</sequence>
			</hash_10001721c63115850048f873bbbdee06e57554>
			<hash_100017e669dafa83d840dfc0a049f375104748>
				<task_item_id>hash_0800172e8f444c14c0fa9187cd15c3ef3f06fa</task_item_id>
				<color_id>0</color_id>
				<alpha>FF</alpha>
				<graph_type_id>9</graph_type_id>
				<consolidation_function_id>1</consolidation_function_id>
				<cdef_id>0</cdef_id>
				<value></value>
				<gprint_id>hash_060017e9c43831e54eca8069317a2ce8c6f751</gprint_id>
				<text_format>Average:</text_format>
				<hard_return></hard_return>
				<sequence>8</sequence>
			</hash_100017e669dafa83d840dfc0a049f375104748>
			<hash_1000176b61f557768371294e1b83b54a6a917a>
				<task_item_id>hash_0800172e8f444c14c0fa9187cd15c3ef3f06fa</task_item_id>
				<color_id>0</color_id>
				<alpha>FF</alpha>
				<graph_type_id>9</graph_type_id>
				<consolidation_function_id>3</consolidation_function_id>
				<cdef_id>0</cdef_id>
				<value></value>
				<gprint_id>hash_060017e9c43831e54eca8069317a2ce8c6f751</gprint_id>
				<text_format>Maximum:</text_format>
				<hard_return>on</hard_return>
				<sequence>9</sequence>
			</hash_1000176b61f557768371294e1b83b54a6a917a>
		</items>
		<inputs>
			<hash_0900179f526d149c713ce6e19059e3d6f64fb3>
				<name>Data Source [esx_mempercent]</name>
				<description></description>
				<column_name>task_item_id</column_name>
				<items>hash_00001721c63115850048f873bbbdee06e57554|hash_000017e669dafa83d840dfc0a049f375104748|hash_0000176b61f557768371294e1b83b54a6a917a</items>
			</hash_0900179f526d149c713ce6e19059e3d6f64fb3>
		</inputs>
	</hash_0000173333971ab23c6f3fbc6758c995ed8167>
	<hash_01001781498091d6c7fcb2dfd66a42c5857790>
		<name>VmWare ESXi - Stats</name>
		<ds>
			<t_name></t_name>
			<name>|host_description| - VmWare ESXi - Stats</name>
			<data_input_id>hash_03001728cdbcec575e6cd81573d3ba44b918c8</data_input_id>
			<t_rra_id></t_rra_id>
			<t_rrd_step></t_rrd_step>
			<rrd_step>300</rrd_step>
			<t_active></t_active>
			<active>on</active>
			<rra_items>hash_150017c21df5178e5c955013591239eb0afd46|hash_1500170d9c0af8b8acdc7807943937b3208e29|hash_1500176fc2d038fb42950138b0ce3e9874cc60|hash_150017e36f3adb9f152adfa5dc50fd2b23337e|hash_150017283ea2bf1634d92ce081ec82a634f513</rra_items>
		</ds>
		<items>
			<hash_080017385bb1c2640bab326ca4012fbfdd0da2>
				<t_data_source_name></t_data_source_name>
				<data_source_name>esx_cpupercent</data_source_name>
				<t_rrd_minimum></t_rrd_minimum>
				<rrd_minimum>0</rrd_minimum>
				<t_rrd_maximum></t_rrd_maximum>
				<rrd_maximum>100</rrd_maximum>
				<t_data_source_type_id></t_data_source_type_id>
				<data_source_type_id>1</data_source_type_id>
				<t_rrd_heartbeat></t_rrd_heartbeat>
				<rrd_heartbeat>600</rrd_heartbeat>
				<t_data_input_field_id></t_data_input_field_id>
				<data_input_field_id>hash_07001715d109fd5d1d77f8ca9b7adba6efe785</data_input_field_id>
			</hash_080017385bb1c2640bab326ca4012fbfdd0da2>
			<hash_0800172e8f444c14c0fa9187cd15c3ef3f06fa>
				<t_data_source_name></t_data_source_name>
				<data_source_name>esx_mempercent</data_source_name>
				<t_rrd_minimum></t_rrd_minimum>
				<rrd_minimum>0</rrd_minimum>
				<t_rrd_maximum></t_rrd_maximum>
				<rrd_maximum>100</rrd_maximum>
				<t_data_source_type_id></t_data_source_type_id>
				<data_source_type_id>1</data_source_type_id>
				<t_rrd_heartbeat></t_rrd_heartbeat>
				<rrd_heartbeat>600</rrd_heartbeat>
				<t_data_input_field_id></t_data_input_field_id>
				<data_input_field_id>hash_0700179980d98c9021547d2a035e2a8929eea9</data_input_field_id>
			</hash_0800172e8f444c14c0fa9187cd15c3ef3f06fa>
		</items>
		<data>
			<item_000>
				<data_input_field_id>hash_070017267154ee3a480af5ac7cb5608b86b080</data_input_field_id>
				<t_value></t_value>
				<value></value>
			</item_000>
		</data>
	</hash_01001781498091d6c7fcb2dfd66a42c5857790>
	<hash_03001728cdbcec575e6cd81573d3ba44b918c8>
		<name>VmWare ESXi - Statistics</name>
		<type_id>1</type_id>
		<input_string>/root/scripts/VmWare/esxstats.pl <hostname></input_string>
		<fields>
			<hash_070017267154ee3a480af5ac7cb5608b86b080>
				<name>hostname</name>
				<update_rra></update_rra>
				<regexp_match></regexp_match>
				<allow_nulls></allow_nulls>
				<type_code>hostname</type_code>
				<input_output>in</input_output>
				<data_name>hostname</data_name>
			</hash_070017267154ee3a480af5ac7cb5608b86b080>
			<hash_07001715d109fd5d1d77f8ca9b7adba6efe785>
				<name>ESX CPU Percent</name>
				<update_rra>on</update_rra>
				<regexp_match></regexp_match>
				<allow_nulls></allow_nulls>
				<type_code></type_code>
				<input_output>out</input_output>
				<data_name>cpupercent</data_name>
			</hash_07001715d109fd5d1d77f8ca9b7adba6efe785>
			<hash_0700179980d98c9021547d2a035e2a8929eea9>
				<name>ESX Memory Percent</name>
				<update_rra>on</update_rra>
				<regexp_match></regexp_match>
				<allow_nulls></allow_nulls>
				<type_code></type_code>
				<input_output>out</input_output>
				<data_name>mempercent</data_name>
			</hash_0700179980d98c9021547d2a035e2a8929eea9>
		</fields>
	</hash_03001728cdbcec575e6cd81573d3ba44b918c8>
	<hash_150017c21df5178e5c955013591239eb0afd46>
		<name>Daily (5 Minute Average)</name>
		<x_files_factor>0.5</x_files_factor>
		<steps>1</steps>
		<rows>600</rows>
		<timespan>86400</timespan>
		<cf_items>1|2|3|4</cf_items>
	</hash_150017c21df5178e5c955013591239eb0afd46>
	<hash_1500170d9c0af8b8acdc7807943937b3208e29>
		<name>Weekly (30 Minute Average)</name>
		<x_files_factor>0.5</x_files_factor>
		<steps>6</steps>
		<rows>700</rows>
		<timespan>604800</timespan>
		<cf_items>1|2|3|4</cf_items>
	</hash_1500170d9c0af8b8acdc7807943937b3208e29>
	<hash_1500176fc2d038fb42950138b0ce3e9874cc60>
		<name>Monthly (2 Hour Average)</name>
		<x_files_factor>0.5</x_files_factor>
		<steps>24</steps>
		<rows>775</rows>
		<timespan>2678400</timespan>
		<cf_items>1|2|3|4</cf_items>
	</hash_1500176fc2d038fb42950138b0ce3e9874cc60>
	<hash_150017e36f3adb9f152adfa5dc50fd2b23337e>
		<name>Yearly (1 Day Average)</name>
		<x_files_factor>0.5</x_files_factor>
		<steps>288</steps>
		<rows>797</rows>
		<timespan>33053184</timespan>
		<cf_items>1|2|3|4</cf_items>
	</hash_150017e36f3adb9f152adfa5dc50fd2b23337e>
	<hash_150017283ea2bf1634d92ce081ec82a634f513>
		<name>Hourly (1 Minute Average)</name>
		<x_files_factor>0.5</x_files_factor>
		<steps>1</steps>
		<rows>500</rows>
		<timespan>14400</timespan>
		<cf_items>1|3</cf_items>
	</hash_150017283ea2bf1634d92ce081ec82a634f513>
	<hash_060017e9c43831e54eca8069317a2ce8c6f751>
		<name>Normal</name>
		<gprint_text>%8.2lf%s</gprint_text>
	</hash_060017e9c43831e54eca8069317a2ce8c6f751>
	<hash_050017b7037c26c3025a37f4ed8070773fb51f>
		<name>Multiply by 1000000</name>
		<items>
			<hash_140017075c72c207fabe8f5efdfb62311561ef>
				<sequence>1</sequence>
				<type>4</type>
				<value>CURRENT_DATA_SOURCE</value>
			</hash_140017075c72c207fabe8f5efdfb62311561ef>
			<hash_1400170498e5374e4542836d616059e2c6a454>
				<sequence>2</sequence>
				<type>6</type>
				<value>1000000</value>
			</hash_1400170498e5374e4542836d616059e2c6a454>
			<hash_140017ff32309588356bdd4a99f7f101345b98>
				<sequence>3</sequence>
				<type>2</type>
				<value>3</value>
			</hash_140017ff32309588356bdd4a99f7f101345b98>
		</items>
	</hash_050017b7037c26c3025a37f4ed8070773fb51f>
</cacti>
на выхлопе получаем два графика - загрузка проца и использование рамы - и то и другое в процентах
===========
что изменено по сравнению с оригиналом.
1. у меня используется один логин-пасс на всех серверах - делал для работы - все сервера одной организации.
2. мне не интересны графики в мегабайтах и мегагерцах - как в оригинале =)
Убей их всех! Бог потом рассортирует...

Хостинговая компания Host-Food.ru
Хостинг HostFood.ru
 

Услуги хостинговой компании Host-Food.ru

Хостинг HostFood.ru

Тарифы на хостинг в России, от 12 рублей: https://www.host-food.ru/tariffs/hosting/
Тарифы на виртуальные сервера (VPS/VDS/KVM) в РФ, от 189 руб.: https://www.host-food.ru/tariffs/virtualny-server-vps/
Выделенные сервера, Россия, Москва, от 2000 рублей (HP Proliant G5, Intel Xeon E5430 (2.66GHz, Quad-Core, 12Mb), 8Gb RAM, 2x300Gb SAS HDD, P400i, 512Mb, BBU):
https://www.host-food.ru/tariffs/vydelennyi-server-ds/
Недорогие домены в популярных зонах: https://www.host-food.ru/domains/

Аватара пользователя
Alex Keda
стреляли...
Сообщения: 35418
Зарегистрирован: 2004-10-18 14:25:19
Откуда: Made in USSR
Контактная информация:

Re: Мониторинг VmWare ESXi - cacti

Непрочитанное сообщение Alex Keda » 2010-02-10 13:31:57

да, в бесплатной версии, с бесплатным ключом, SNMP включается так - до ввода бесплатного ключа, пока считаются 60 дней, говорим такое:

Код: Выделить всё

radius# more /root/scripts/VmWare/enable.snmp.sh
#!/bin/sh

echo -n user: 
read user
echo -n pass: 
read pass
perl /root/scripts/VmWare/cli/bin/vicfg-snmp.pl \
        --username $user --password $pass --server $1 -c my-community-name

perl /root/scripts/VmWare/cli/bin/vicfg-snmp.pl \
        --username $user --password $pass --server $1 -E

radius#   
после чего вводим ключик - snmp продолжает работать =)))
Убей их всех! Бог потом рассортирует...

Аватара пользователя
Alex Keda
стреляли...
Сообщения: 35418
Зарегистрирован: 2004-10-18 14:25:19
Откуда: Made in USSR
Контактная информация:

Re: Мониторинг VmWare ESXi - cacti

Непрочитанное сообщение Alex Keda » 2010-02-11 19:31:25

да, одна из проблем - список модулей необходимых для работы перлоподелия (тут лишних навалом, на самом деле)

Код: Выделить всё

radius# pkg_info | grep ^p5- | awk '{print $1}'
p5-Archive-Zip-1.30
p5-AutoLoader-5.70
p5-B-Deobfuscate-0.20
p5-B-Keywords-1.09
p5-Class-MethodMaker-2.15
p5-Class-OOorNO-0.011
p5-Compress-Raw-Zlib-2.021
p5-Compress-Zlib-2.015
p5-Config-IniFiles-2.52
p5-Crypt-CBC-2.30
p5-Crypt-DES-2.05
p5-Crypt-SSLeay-0.57
p5-Crypt-UnixCrypt-1.0
p5-DBD-Oracle-1.19_3
p5-DBD-Pg-2.15.1
p5-DBD-mysql50-4.012
p5-DBI-1.60.9
p5-Digest-HMAC-1.01
p5-Digest-SHA-5.47
p5-Digest-SHA-PurePerl-5.47
p5-Digest-SHA1-2.12
p5-Exception-Handler-1.004
p5-ExtUtils-CBuilder-0.2603.01
p5-ExtUtils-ParseXS-2.20
p5-File-Util-3.27
p5-Getopt-ArgvFile-1.11
p5-HTML-Parser-3.62
p5-HTML-Tagset-3.20
p5-Hash-Case-1.006
p5-Hash-WithDefaults-0.04
p5-IO-Compress-Base-2.015
p5-IO-Compress-Zlib-2.015
p5-IO-stringy-2.110
p5-Mail-Sender-0.8.16
p5-Module-Build-0.35
p5-Module-ScanDeps-0.95
p5-Module-Signature-0.55_3
p5-NTLM-1.05
p5-Net-SNMP-5.2.0
p5-NetAddr-IP-4.02.7
p5-PAR-0.99.4
p5-PAR-Dist-0.46
p5-PAR-Packer-0.99.1
p5-Params-Util-1.00
p5-Parse-CSV-1.00
p5-Pg-2.1.1_3,1
p5-Proc-Daemon-0.03
p5-Proc-ProcessTable-0.45
p5-Storable-2.21
p5-Term-ANSIColor-1.12
p5-Term-ReadKey-2.30
p5-Text-CSV_XS-0.67
p5-URI-1.40
p5-XML-LibXML-1.70,1
p5-XML-NamespaceSupport-1.10
p5-XML-Parser-2.36_1
p5-XML-SAX-0.96
p5-YAML-0.70
p5-gettext-1.05_2
p5-libwww-5.834
p5-version-0.76
radius#    
и отзыв по результатам работы.
хреновина жутко грузит сервер - на стареньком ксеноне ~3GHz выполняется около 7 секунд.
т.е. машина позволяет полнойенно мониторить не более 4 хостов - если больше - то при периоде в минуту на графиках будут разрывы.
при периодах болье минуты (дефолт - 5) соответсвенно до 20 хостов
Убей их всех! Бог потом рассортирует...