Cacti Мониторинг потоков с нескольких cisco

Тут появилась задача мониторить в Cacti количество активных звонков с нескольких cisco 5350 и отобразить суммарно на одном графике. Host Template <cacti> <hash_000016ffe29998ceabc5d59d4f3d88c02b31bb> <name>Cisco Summ Call E1</name> <graph> <t_title>on</t_title> <title>Cisco Summ Call E1 - |host_description| </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>on</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_1000169dbcd9985b97f9519179fe76a0635344> <task_item_id>hash_080016bc4c126d7db8ad665617d65c92519980</task_item_id> <color_id>00aa00</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_060016e9c43831e54eca8069317a2ce8c6f751</gprint_id> <text_format></text_format> <hard_return></hard_return> <sequence>1</sequence> </hash_1000169dbcd9985b97f9519179fe76a0635344> <hash_1000162cfa2bcf9e75bb9ee37f567a6bbb06a1> <task_item_id>hash_080016bc4c126d7db8ad665617d65c92519980</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_060016e9c43831e54eca8069317a2ce8c6f751</gprint_id> <text_format>Current:</text_format> <hard_return></hard_return> <sequence>2</sequence> </hash_1000162cfa2bcf9e75bb9ee37f567a6bbb06a1> <hash_1000169a274aed346c60475c74972707a925e7> <task_item_id>hash_080016bc4c126d7db8ad665617d65c92519980</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_060016e9c43831e54eca8069317a2ce8c6f751</gprint_id> <text_format>Average:</text_format> <hard_return></hard_return> <sequence>3</sequence> </hash_1000169a274aed346c60475c74972707a925e7> <hash_100016f80d1501965c91a5bdd937d3829f95ca> <task_item_id>hash_080016bc4c126d7db8ad665617d65c92519980</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_060016e9c43831e54eca8069317a2ce8c6f751</gprint_id> <text_format>Maximum:</text_format> <hard_return>on</hard_return> <sequence>4</sequence> </hash_100016f80d1501965c91a5bdd937d3829f95ca> </items> <inputs> <hash_090016a17a75a4eba88960474278117b5458e1> <name>Data Source [summ]</name> <description></description> <column_name>task_item_id</column_name> <items>hash_0000169dbcd9985b97f9519179fe76a0635344|hash_0000162cfa2bcf9e75bb9ee37f567a6bbb06a1|hash_0000169a274aed346c60475c74972707a925e7|hash_000016f80d1501965c91a5bdd937d3829f95ca</items> </hash_090016a17a75a4eba88960474278117b5458e1> </inputs> </hash_000016ffe29998ceabc5d59d4f3d88c02b31bb> <hash_01001697adb40f7066ab5750a6dd44c95d3f1e> <name>Cisco Summ Call E1</name> <ds> <t_name>on</t_name> <name>Cisco Summ Call E1 - |host_description| </name> <data_input_id>hash_03001635fbf3e6afb68ab8f8402ab255301165</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_150016c21df5178e5c955013591239eb0afd46|hash_1500160d9c0af8b8acdc7807943937b3208e29|hash_1500166fc2d038fb42950138b0ce3e9874cc60|hash_150016e36f3adb9f152adfa5dc50fd2b23337e|hash_150016283ea2bf1634d92ce081ec82a634f513</rra_items> </ds> <items> <hash_080016bc4c126d7db8ad665617d65c92519980> <t_data_source_name></t_data_source_name> <data_source_name>summ</data_source_name> <t_rrd_minimum></t_rrd_minimum> <rrd_minimum>0</rrd_minimum> <t_rrd_maximum></t_rrd_maximum> <rrd_maximum>0</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_07001650576fe19042b4af102fefdd954e1099</data_input_field_id> </hash_080016bc4c126d7db8ad665617d65c92519980> </items> <data> <item_000> <data_input_field_id>hash_070016d02a8328476338c214acedf5b1eb7122</data_input_field_id> <t_value>on</t_value> <value></value> </item_000> </data> </hash_01001697adb40f7066ab5750a6dd44c95d3f1e> <hash_03001635fbf3e6afb68ab8f8402ab255301165> <name>Summ E1 Cisco</name> <type_id>1</type_id> <input_string>&lt;path_cacti&gt;/scripts/potok.php &lt;arg&gt;</input_string> <fields> <hash_070016d02a8328476338c214acedf5b1eb7122> <name>Формат записи для поля через пробел ip-community-[0/3,3/7]</name> <update_rra></update_rra> <regexp_match></regexp_match> <allow_nulls></allow_nulls> <type_code></type_code> <input_output>in</input_output> <data_name>arg</data_name> </hash_070016d02a8328476338c214acedf5b1eb7122> <hash_07001650576fe19042b4af102fefdd954e1099> <name>Сумма активных звонков</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>summ</data_name> </hash_07001650576fe19042b4af102fefdd954e1099> </fields> </hash_03001635fbf3e6afb68ab8f8402ab255301165> <hash_150016c21df5178e5c955013591239eb0afd46> <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_150016c21df5178e5c955013591239eb0afd46> <hash_1500160d9c0af8b8acdc7807943937b3208e29> <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_1500160d9c0af8b8acdc7807943937b3208e29> <hash_1500166fc2d038fb42950138b0ce3e9874cc60> <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_1500166fc2d038fb42950138b0ce3e9874cc60> <hash_150016e36f3adb9f152adfa5dc50fd2b23337e> <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_150016e36f3adb9f152adfa5dc50fd2b23337e> <hash_150016283ea2bf1634d92ce081ec82a634f513> <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_150016283ea2bf1634d92ce081ec82a634f513> <hash_060016e9c43831e54eca8069317a2ce8c6f751> <name>Normal</name> <gprint_text>%8.2lf %s</gprint_text> </hash_060016e9c43831e54eca8069317a2ce8c6f751> </cacti> Файл scripts/potok.php Незабываем менять /usr/local/bin/php #!/usr/local/bin/php -q < ?php $summ=0; $f=fopen('/usr/local/share/cacti/log/potok.log',"a"); fputs($f,"\n".date("H-i-s")."\n".implode("\n",$_SERVER['argv'])); fclose($f); for($n=1;count($_SERVER['argv'])-1>=$n;$n++){ $tmp=trim($_SERVER['argv'][$n]); if(preg_match("/^([0-9]+\.[0-9]+\.[0-9]+\.[0-9]+)-(.*?)-\[([0-9\/,]+)\]$/",$tmp,$mas)){ $potok[]=$mas; }else{ echo "\nError in $tmp\n"; } } foreach($potok as $key=>$val){ $potok_num=explode(",",$val[3]); foreach($potok_num as $num){ $summ=$summ+str_replace("Gauge32: ","",snmpget($val[1],$val[2],'.1.3.6.1.4.1.9.10.19.1.1.9.1.3.'.str_replace('/','.',$num))); } unset($potok_num); } unset($potok,$tmp,$mas); echo $summ; ?>
VN:D [1.9.22_1171]
Rating: 10.0/10 (1 vote cast)
VN:D [1.9.22_1171]
Rating: +1 (from 1 vote)
Cacti Мониторинг потоков с нескольких cisco, 10.0 out of 10 based on 1 rating

Добавить комментарий

Ваш e-mail не будет опубликован. Обязательные поля помечены *

Login

Рубрики

Праздники

Армейские праздники

Счетчики

Яндекс.Метрика