Community discussions

MikroTik App
 
User avatar
[ASM]
Member Candidate
Member Candidate
Topic Author
Posts: 284
Joined: Sun Jun 06, 2004 12:59 am
Location: Sofia, Bulgaria
Contact:

Cacti templates

Sat Oct 23, 2004 2:58 pm

Here I'll post some templates for Cacti. Each one of them is created for Mikrotik - Ruter OS. To use them you must have Cacti installed. You can get it from http://www.cacti.net .

Next go to Import templates and paste the text in "code" bellow.

CPU Usage
<cacti>	
	<hash_000005e698bfeed6840d045766635a9bacbbe0>
		<name>Mikrotik - CPU Usage</name>
		<graph>
			<t_title></t_title>
			<title>|host_description| - CPU Usage</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_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_auto_scale_rigid></t_auto_scale_rigid>
			<auto_scale_rigid>on</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>percent</vertical_label>
		</graph>
		<items>
			<hash_100005057d15afb7d8a06b90258c7988ee0b71>
				<task_item_id>hash_08000548f515755838763a71d68ed3d0fc7175</task_item_id>
				<color_id>FF0000</color_id>
				<graph_type_id>7</graph_type_id>
				<consolidation_function_id>1</consolidation_function_id>
				<cdef_id>0</cdef_id>
				<value></value>
				<gprint_id>hash_060005e9c43831e54eca8069317a2ce8c6f751</gprint_id>
				<text_format>CPU Usage</text_format>
				<hard_return></hard_return>
				<sequence>1</sequence>
			</hash_100005057d15afb7d8a06b90258c7988ee0b71>
			<hash_1000054b4bebaa5ec20a923a826fd072767e9a>
				<task_item_id>hash_08000548f515755838763a71d68ed3d0fc7175</task_item_id>
				<color_id>0</color_id>
				<graph_type_id>9</graph_type_id>
				<consolidation_function_id>4</consolidation_function_id>
				<cdef_id>0</cdef_id>
				<value></value>
				<gprint_id>hash_06000519414480d6897c8731c7dc6c5310653e</gprint_id>
				<text_format>Current:</text_format>
				<hard_return></hard_return>
				<sequence>2</sequence>
			</hash_1000054b4bebaa5ec20a923a826fd072767e9a>
			<hash_100005a49d96e10a3dc74512596d8485763649>
				<task_item_id>hash_08000548f515755838763a71d68ed3d0fc7175</task_item_id>
				<color_id>0</color_id>
				<graph_type_id>9</graph_type_id>
				<consolidation_function_id>1</consolidation_function_id>
				<cdef_id>0</cdef_id>
				<value></value>
				<gprint_id>hash_06000519414480d6897c8731c7dc6c5310653e</gprint_id>
				<text_format>Average:</text_format>
				<hard_return></hard_return>
				<sequence>3</sequence>
			</hash_100005a49d96e10a3dc74512596d8485763649>
			<hash_100005e7cb030d1036ffac6c675322240a4066>
				<task_item_id>hash_08000548f515755838763a71d68ed3d0fc7175</task_item_id>
				<color_id>0</color_id>
				<graph_type_id>9</graph_type_id>
				<consolidation_function_id>3</consolidation_function_id>
				<cdef_id>0</cdef_id>
				<value></value>
				<gprint_id>hash_06000519414480d6897c8731c7dc6c5310653e</gprint_id>
				<text_format>Maximum:</text_format>
				<hard_return></hard_return>
				<sequence>4</sequence>
			</hash_100005e7cb030d1036ffac6c675322240a4066>
		</items>
		<inputs>
			<hash_0900056e0f7a10eb1457ad6881bb3defc47140>
				<name>Data Source [cpu]</name>
				<description></description>
				<column_name>task_item_id</column_name>
				<items>hash_000005057d15afb7d8a06b90258c7988ee0b71|hash_0000054b4bebaa5ec20a923a826fd072767e9a|hash_000005a49d96e10a3dc74512596d8485763649|hash_000005e7cb030d1036ffac6c675322240a4066</items>
			</hash_0900056e0f7a10eb1457ad6881bb3defc47140>
		</inputs>
	</hash_000005e698bfeed6840d045766635a9bacbbe0>
	<hash_010005097a276485e6746cb677900ec4062d59>
		<name>Mikrotik - SNMP - CPU Load</name>
		<ds>
			<t_name></t_name>
			<name>|host_description| - Mikrotik - SNMP - CPU Load (5 min)</name>
			<data_input_id>hash_0300053eb92bb845b9660a7445cf9740726522</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_150005c21df5178e5c955013591239eb0afd46|hash_1500050d9c0af8b8acdc7807943937b3208e29|hash_1500056fc2d038fb42950138b0ce3e9874cc60|hash_150005e36f3adb9f152adfa5dc50fd2b23337e</rra_items>
		</ds>
		<items>
			<hash_08000548f515755838763a71d68ed3d0fc7175>
				<t_data_source_name></t_data_source_name>
				<data_source_name>cpu</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>0</data_input_field_id>
			</hash_08000548f515755838763a71d68ed3d0fc7175>
		</items>
		<data>
			<item_000>
				<data_input_field_id>hash_0700054276a5ec6e3fe33995129041b1909762</data_input_field_id>
				<t_value></t_value>
				<value>.1.3.6.1.2.1.25.3.3.1.2.1</value>
			</item_000>
			<item_001>
				<data_input_field_id>hash_070005012ccb1d3687d3edb29c002ea66e72da</data_input_field_id>
				<t_value></t_value>
				<value></value>
			</item_001>
			<item_002>
				<data_input_field_id>hash_0700059c55a74bd571b4f00a96fd4b793278c6</data_input_field_id>
				<t_value></t_value>
				<value></value>
			</item_002>
			<item_003>
				<data_input_field_id>hash_070005ad14ac90641aed388139f6ba86a2e48b</data_input_field_id>
				<t_value></t_value>
				<value></value>
			</item_003>
			<item_004>
				<data_input_field_id>hash_07000532285d5bf16e56c478f5e83f32cda9ef</data_input_field_id>
				<t_value></t_value>
				<value></value>
			</item_004>
			<item_005>
				<data_input_field_id>hash_07000592f5906c8dc0f964b41f4253df582c38</data_input_field_id>
				<t_value></t_value>
				<value></value>
			</item_005>
		</data>
	</hash_010005097a276485e6746cb677900ec4062d59>
	<hash_0300053eb92bb845b9660a7445cf9740726522>
		<name>Get SNMP Data</name>
		<type_id>2</type_id>
		<input_string></input_string>
		<fields>
			<hash_07000592f5906c8dc0f964b41f4253df582c38>
				<name>SNMP IP Address</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>management_ip</data_name>
			</hash_07000592f5906c8dc0f964b41f4253df582c38>
			<hash_07000532285d5bf16e56c478f5e83f32cda9ef>
				<name>SNMP Community</name>
				<update_rra></update_rra>
				<regexp_match></regexp_match>
				<allow_nulls></allow_nulls>
				<type_code>snmp_community</type_code>
				<input_output>in</input_output>
				<data_name>snmp_community</data_name>
			</hash_07000532285d5bf16e56c478f5e83f32cda9ef>
			<hash_070005ad14ac90641aed388139f6ba86a2e48b>
				<name>SNMP Username</name>
				<update_rra></update_rra>
				<regexp_match></regexp_match>
				<allow_nulls>on</allow_nulls>
				<type_code>snmp_username</type_code>
				<input_output>in</input_output>
				<data_name>snmp_username</data_name>
			</hash_070005ad14ac90641aed388139f6ba86a2e48b>
			<hash_0700059c55a74bd571b4f00a96fd4b793278c6>
				<name>SNMP Password</name>
				<update_rra></update_rra>
				<regexp_match></regexp_match>
				<allow_nulls>on</allow_nulls>
				<type_code>snmp_password</type_code>
				<input_output>in</input_output>
				<data_name>snmp_password</data_name>
			</hash_0700059c55a74bd571b4f00a96fd4b793278c6>
			<hash_070005012ccb1d3687d3edb29c002ea66e72da>
				<name>SNMP Version (1, 2, or 3)</name>
				<update_rra></update_rra>
				<regexp_match></regexp_match>
				<allow_nulls>on</allow_nulls>
				<type_code>snmp_version</type_code>
				<input_output>in</input_output>
				<data_name>snmp_version</data_name>
			</hash_070005012ccb1d3687d3edb29c002ea66e72da>
			<hash_0700054276a5ec6e3fe33995129041b1909762>
				<name>OID</name>
				<update_rra></update_rra>
				<regexp_match></regexp_match>
				<allow_nulls></allow_nulls>
				<type_code>snmp_oid</type_code>
				<input_output>in</input_output>
				<data_name>oid</data_name>
			</hash_0700054276a5ec6e3fe33995129041b1909762>
		</fields>
	</hash_0300053eb92bb845b9660a7445cf9740726522>
	<hash_150005c21df5178e5c955013591239eb0afd46>
		<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_150005c21df5178e5c955013591239eb0afd46>
	<hash_1500050d9c0af8b8acdc7807943937b3208e29>
		<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_1500050d9c0af8b8acdc7807943937b3208e29>
	<hash_1500056fc2d038fb42950138b0ce3e9874cc60>
		<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_1500056fc2d038fb42950138b0ce3e9874cc60>
	<hash_150005e36f3adb9f152adfa5dc50fd2b23337e>
		<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_150005e36f3adb9f152adfa5dc50fd2b23337e>
	<hash_060005e9c43831e54eca8069317a2ce8c6f751>
		<name>Normal</name>
		<gprint_text>%8.2lf %s</gprint_text>
	</hash_060005e9c43831e54eca8069317a2ce8c6f751>
	<hash_06000519414480d6897c8731c7dc6c5310653e>
		<name>Exact Numbers</name>
		<gprint_text>%8.0lf</gprint_text>
	</hash_06000519414480d6897c8731c7dc6c5310653e>
</cacti>
 
User avatar
[ASM]
Member Candidate
Member Candidate
Topic Author
Posts: 284
Joined: Sun Jun 06, 2004 12:59 am
Location: Sofia, Bulgaria
Contact:

Memory Usage

Sat Oct 23, 2004 3:00 pm

Memory Usage
<cacti>	
	<hash_00000502d5e7579ab9b390756192bb43d3c1cd>
		<name>Mikrotik - Memory Usage</name>
		<graph>
			<t_title></t_title>
			<title>|host_description| - Memory Usage</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_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_auto_scale_rigid></t_auto_scale_rigid>
			<auto_scale_rigid>on</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>bytes</vertical_label>
		</graph>
		<items>
			<hash_100005556267797455ef3f8d4a1cdf6d20ae46>
				<task_item_id>hash_080005ee6d22b020f5a247862b508811716784</task_item_id>
				<color_id>FF0000</color_id>
				<graph_type_id>7</graph_type_id>
				<consolidation_function_id>1</consolidation_function_id>
				<cdef_id>hash_050005634a23af5e78af0964e8d33b1a4ed26b</cdef_id>
				<value></value>
				<gprint_id>hash_060005e9c43831e54eca8069317a2ce8c6f751</gprint_id>
				<text_format>Memory Used</text_format>
				<hard_return></hard_return>
				<sequence>1</sequence>
			</hash_100005556267797455ef3f8d4a1cdf6d20ae46>
			<hash_1000058e60e8408ca9685c031411d1c2842e20>
				<task_item_id>hash_080005ee6d22b020f5a247862b508811716784</task_item_id>
				<color_id>0</color_id>
				<graph_type_id>9</graph_type_id>
				<consolidation_function_id>4</consolidation_function_id>
				<cdef_id>hash_050005634a23af5e78af0964e8d33b1a4ed26b</cdef_id>
				<value></value>
				<gprint_id>hash_060005e9c43831e54eca8069317a2ce8c6f751</gprint_id>
				<text_format>Current:</text_format>
				<hard_return></hard_return>
				<sequence>2</sequence>
			</hash_1000058e60e8408ca9685c031411d1c2842e20>
			<hash_1000054dd4844b4c16bb6ce6327dc1d1cdaca8>
				<task_item_id>hash_080005ee6d22b020f5a247862b508811716784</task_item_id>
				<color_id>0</color_id>
				<graph_type_id>9</graph_type_id>
				<consolidation_function_id>1</consolidation_function_id>
				<cdef_id>hash_050005634a23af5e78af0964e8d33b1a4ed26b</cdef_id>
				<value></value>
				<gprint_id>hash_060005e9c43831e54eca8069317a2ce8c6f751</gprint_id>
				<text_format>Average:</text_format>
				<hard_return></hard_return>
				<sequence>3</sequence>
			</hash_1000054dd4844b4c16bb6ce6327dc1d1cdaca8>
			<hash_100005aea20d6c5e3354426e2d6d75627c77fe>
				<task_item_id>hash_080005ee6d22b020f5a247862b508811716784</task_item_id>
				<color_id>0</color_id>
				<graph_type_id>9</graph_type_id>
				<consolidation_function_id>3</consolidation_function_id>
				<cdef_id>hash_050005634a23af5e78af0964e8d33b1a4ed26b</cdef_id>
				<value></value>
				<gprint_id>hash_060005e9c43831e54eca8069317a2ce8c6f751</gprint_id>
				<text_format>Maximum:</text_format>
				<hard_return></hard_return>
				<sequence>4</sequence>
			</hash_100005aea20d6c5e3354426e2d6d75627c77fe>
		</items>
		<inputs>
			<hash_090005fac0d49f1bbe597cbd83bfc4a3209956>
				<name>Data Source [memory]</name>
				<description></description>
				<column_name>task_item_id</column_name>
				<items>hash_000005556267797455ef3f8d4a1cdf6d20ae46|hash_0000058e60e8408ca9685c031411d1c2842e20|hash_0000054dd4844b4c16bb6ce6327dc1d1cdaca8|hash_000005aea20d6c5e3354426e2d6d75627c77fe</items>
			</hash_090005fac0d49f1bbe597cbd83bfc4a3209956>
		</inputs>
	</hash_00000502d5e7579ab9b390756192bb43d3c1cd>
	<hash_0100053053e472f299be5161205d276755db34>
		<name>Mikrotik - SNMP - Memory Usage</name>
		<ds>
			<t_name></t_name>
			<name>|host_description| - Mikrotik - SNMP - Memory Usage</name>
			<data_input_id>hash_0300053eb92bb845b9660a7445cf9740726522</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_150005c21df5178e5c955013591239eb0afd46|hash_1500050d9c0af8b8acdc7807943937b3208e29|hash_1500056fc2d038fb42950138b0ce3e9874cc60|hash_150005e36f3adb9f152adfa5dc50fd2b23337e</rra_items>
		</ds>
		<items>
			<hash_080005ee6d22b020f5a247862b508811716784>
				<t_data_source_name></t_data_source_name>
				<data_source_name>memory</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>0</data_input_field_id>
			</hash_080005ee6d22b020f5a247862b508811716784>
		</items>
		<data>
			<item_000>
				<data_input_field_id>hash_07000592f5906c8dc0f964b41f4253df582c38</data_input_field_id>
				<t_value></t_value>
				<value></value>
			</item_000>
			<item_001>
				<data_input_field_id>hash_07000532285d5bf16e56c478f5e83f32cda9ef</data_input_field_id>
				<t_value></t_value>
				<value></value>
			</item_001>
			<item_002>
				<data_input_field_id>hash_070005ad14ac90641aed388139f6ba86a2e48b</data_input_field_id>
				<t_value></t_value>
				<value></value>
			</item_002>
			<item_003>
				<data_input_field_id>hash_0700059c55a74bd571b4f00a96fd4b793278c6</data_input_field_id>
				<t_value></t_value>
				<value></value>
			</item_003>
			<item_004>
				<data_input_field_id>hash_070005012ccb1d3687d3edb29c002ea66e72da</data_input_field_id>
				<t_value></t_value>
				<value></value>
			</item_004>
			<item_005>
				<data_input_field_id>hash_0700054276a5ec6e3fe33995129041b1909762</data_input_field_id>
				<t_value></t_value>
				<value>.1.3.6.1.2.1.25.2.3.1.6.2</value>
			</item_005>
		</data>
	</hash_0100053053e472f299be5161205d276755db34>
	<hash_0300053eb92bb845b9660a7445cf9740726522>
		<name>Get SNMP Data</name>
		<type_id>2</type_id>
		<input_string></input_string>
		<fields>
			<hash_07000592f5906c8dc0f964b41f4253df582c38>
				<name>SNMP IP Address</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>management_ip</data_name>
			</hash_07000592f5906c8dc0f964b41f4253df582c38>
			<hash_07000532285d5bf16e56c478f5e83f32cda9ef>
				<name>SNMP Community</name>
				<update_rra></update_rra>
				<regexp_match></regexp_match>
				<allow_nulls></allow_nulls>
				<type_code>snmp_community</type_code>
				<input_output>in</input_output>
				<data_name>snmp_community</data_name>
			</hash_07000532285d5bf16e56c478f5e83f32cda9ef>
			<hash_070005ad14ac90641aed388139f6ba86a2e48b>
				<name>SNMP Username</name>
				<update_rra></update_rra>
				<regexp_match></regexp_match>
				<allow_nulls>on</allow_nulls>
				<type_code>snmp_username</type_code>
				<input_output>in</input_output>
				<data_name>snmp_username</data_name>
			</hash_070005ad14ac90641aed388139f6ba86a2e48b>
			<hash_0700059c55a74bd571b4f00a96fd4b793278c6>
				<name>SNMP Password</name>
				<update_rra></update_rra>
				<regexp_match></regexp_match>
				<allow_nulls>on</allow_nulls>
				<type_code>snmp_password</type_code>
				<input_output>in</input_output>
				<data_name>snmp_password</data_name>
			</hash_0700059c55a74bd571b4f00a96fd4b793278c6>
			<hash_070005012ccb1d3687d3edb29c002ea66e72da>
				<name>SNMP Version (1, 2, or 3)</name>
				<update_rra></update_rra>
				<regexp_match></regexp_match>
				<allow_nulls>on</allow_nulls>
				<type_code>snmp_version</type_code>
				<input_output>in</input_output>
				<data_name>snmp_version</data_name>
			</hash_070005012ccb1d3687d3edb29c002ea66e72da>
			<hash_0700054276a5ec6e3fe33995129041b1909762>
				<name>OID</name>
				<update_rra></update_rra>
				<regexp_match></regexp_match>
				<allow_nulls></allow_nulls>
				<type_code>snmp_oid</type_code>
				<input_output>in</input_output>
				<data_name>oid</data_name>
			</hash_0700054276a5ec6e3fe33995129041b1909762>
		</fields>
	</hash_0300053eb92bb845b9660a7445cf9740726522>
	<hash_150005c21df5178e5c955013591239eb0afd46>
		<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_150005c21df5178e5c955013591239eb0afd46>
	<hash_1500050d9c0af8b8acdc7807943937b3208e29>
		<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_1500050d9c0af8b8acdc7807943937b3208e29>
	<hash_1500056fc2d038fb42950138b0ce3e9874cc60>
		<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_1500056fc2d038fb42950138b0ce3e9874cc60>
	<hash_150005e36f3adb9f152adfa5dc50fd2b23337e>
		<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_150005e36f3adb9f152adfa5dc50fd2b23337e>
	<hash_050005634a23af5e78af0964e8d33b1a4ed26b>
		<name>Multiply by 1024</name>
		<items>
			<hash_14000586370cfa0008fe8c56b28be80ee39a40>
				<sequence>1</sequence>
				<type>4</type>
				<value>CURRENT_DATA_SOURCE</value>
			</hash_14000586370cfa0008fe8c56b28be80ee39a40>
			<hash_1400059a35cc60d47691af37f6fddf02064e20>
				<sequence>2</sequence>
				<type>6</type>
				<value>1024</value>
			</hash_1400059a35cc60d47691af37f6fddf02064e20>
			<hash_1400055d7a7941ec0440b257e5598a27dd1688>
				<sequence>3</sequence>
				<type>2</type>
				<value>3</value>
			</hash_1400055d7a7941ec0440b257e5598a27dd1688>
		</items>
	</hash_050005634a23af5e78af0964e8d33b1a4ed26b>
	<hash_060005e9c43831e54eca8069317a2ce8c6f751>
		<name>Normal</name>
		<gprint_text>%8.2lf %s</gprint_text>
	</hash_060005e9c43831e54eca8069317a2ce8c6f751>
</cacti>
 
User avatar
stephenpatrick
Forum Veteran
Forum Veteran
Posts: 702
Joined: Fri Aug 20, 2004 12:26 pm
Location: UK
Contact:

Sat Oct 23, 2004 4:04 pm

Hi ASM,

That looks a great piece of work!

Any chance you plan to do scripts for
- bandwidth (TX/RX) on ethernet interfaces
- bandwidth (TX/RX) on wireless interfaces
- signal strength on wireless interfaces

?

I think that would be really popular-

Regards

Stephen
 
User avatar
[ASM]
Member Candidate
Member Candidate
Topic Author
Posts: 284
Joined: Sun Jun 06, 2004 12:59 am
Location: Sofia, Bulgaria
Contact:

Sat Oct 23, 2004 5:20 pm

Hi ASM,
Any chance you plan to do scripts for
- bandwidth (TX/RX) on ethernet interfaces
- bandwidth (TX/RX) on wireless interfaces
You can use Interface - Traffic query for that
- signal strength on wireless interfaces
Now I'm creating the template but I have a little problem:
There is no interface filed(and radio name) in SNMP of /interface wireless registration table print oid

I can get data only if mode=station from /interface wireless print oid

This sucks :)

Btw... other way is to enter the OID, but if you have 20 wireless links you'll go crazy :) It takes up to a minute to make it that way... we'll see what I can make...

Next: /queue tree one-directional query and /queue tree bi-directional query :)
 
User avatar
[ASM]
Member Candidate
Member Candidate
Topic Author
Posts: 284
Joined: Sun Jun 06, 2004 12:59 am
Location: Sofia, Bulgaria
Contact:

Mon Oct 25, 2004 7:04 am

Queue Tree (bi-directional)

Purpose of this template is to make graph of two queues at the same time. It asumes that queue named "abc" and "abc_up" are part of one shaping rule. "abc" is used to shape download(traffic to user(s)) and "abc_up" is used to shape upload (traffic from user(s)). It's more complex then the above.

To install it make this steps:

Step 1. Save the file below as mt_queues.php in scripts/ directory of cacti:
<?php
$no_http_headers = true;

/* display No errors */
error_reporting(E_ERROR);
 
include_once(dirname(__FILE__) . "/../lib/snmp.php");
                                                                                                    
if (!isset($called_by_script_server)) {                                                             
    include_once(dirname(__FILE__) . "/../include/config.php");                                 
                                                                                                
    array_shift($_SERVER["argv"]);                                                              
    print call_user_func_array("mt_queues", $_SERVER["argv"]);                                
}                                                                                                   
                                                                                                                    
function make_data($arr_index, $arr_bytes) {
        $return_arr = array();

        foreach ($arr_index as $key => $value) {
            $return_arr[$key] = array(  'in'     => $arr_bytes[$value['in']],
                                        'out'    => $arr_bytes[$value['out']],
                                        'oid_in' => $value['in'],
                                        'oid_out'=> $value['out']
                                        );
        }

//      var_dump($return_arr); die();
        return $return_arr;
}

function reindex($arr) {
        $return_arr = array();

        for ($i=0;($i<sizeof($arr));$i++) {
            $a = explode('.', $arr[$i]['oid']);
            $return_arr[$i]['oid'] = $a[count($a)-1];
            $return_arr[$i]['value'] = $arr[$i]['value'];
        }
//      var_dump($arr); die();
//      var_dump($return_arr); die();
        return $return_arr;
}

function get_bytes($hostname, $snmp_community, $snmp_version, $snmp_port, $snmp_timeout) {
        $arr = reindex(cacti_snmp_walk($hostname, $snmp_community, ".1.3.6.1.4.1.14988.1.1.2.2.1.5", $snmp_version, "", "", $snmp_port, $snmp_timeout));
        $return_arr = array();

        $c = sizeof($arr);

        for ($i=0;($i<$c);$i++) {
                $return_arr[$arr[$i]['oid']] = $arr[$i]['value'];
        }
//      var_dump($return_arr); die();
        return $return_arr;
}

function get_indexes($hostname, $snmp_community, $snmp_version, $snmp_port, $snmp_timeout) {
        $arr = reindex(cacti_snmp_walk($hostname, $snmp_community, ".1.3.6.1.4.1.14988.1.1.2.2.1.2", $snmp_version, "", "", $snmp_port, $snmp_timeout));
        $return_arr = array();

        $c = sizeof($arr);

        for ($i=0;$i<$c;$i++) {
            for ($j=$i;$j<$c;$j++) {
                if (strpos($arr[$j]['value'], '_up')) {
                    if (strcmp($arr[$i]['value'], str_replace('_up', "", $arr[$j]['value'])) == 0 ) {
                        $return_arr[$arr[$i]['value']] = array(
                                            'in'   => $arr[$i]['oid'],
                                            'out'  => $arr[$j]['oid']
                                        );
                        $j=$c;
                    }
                }
            }
        }
//      var_dump($return_arr); die();
        return $return_arr;
}

function mt_queues($hostname, $snmp_community, $snmp_version, $host_id, $cmd, $arg1 = "", $arg2 = "", $snmp_port = 161, $snmp_timeout = 500) {

    $oids = array(
        "name" => ".1.3.6.1.4.1.14988.1.1.2.2.1.2",
        "bytes_in" => ".1.3.6.1.4.1.14988.1.1.2.2.1.5",
        "bytes_out => .1.3.6.1.4.1.14988.1.1.2.2.1.5"
    );

    if ((func_num_args() == "9") || (func_num_args() == "7") || (func_num_args() == "6") || (func_num_args() == "5")) {
        if ($cmd == "index") {                                                              
            $arr_index = get_indexes($hostname, $snmp_community, $snmp_version, $snmp_port, $snmp_timeout);

            foreach ($arr_index as $key => $value) {
                print($key . "\n");
            }
        } elseif ($cmd == "query") {
            $arr_index = get_indexes($hostname, $snmp_community, $snmp_version, $snmp_port, $snmp_timeout);
            $arr_bytes = get_bytes($hostname, $snmp_community, $snmp_version, $snmp_port, $snmp_timeout);
            $arr = make_data($arr_index, $arr_bytes);

            foreach ($arr as $key => $value) {
                if ($arg1 == 'bytes_in') {
                    print $key . ":" . $value['in'] . "\n";
                }elseif ($arg1 == 'bytes_out') {
                    print $key . ":" . $value['out'] . "\n";
                }elseif ($arg1 == 'index') {
                    print $key . ":" . $key . "\n";
                }
            }
        }elseif ($cmd == "get") {
            $arr_index = get_indexes($hostname, $snmp_community, $snmp_version, $snmp_port, $snmp_timeout);
            $arr_bytes = get_bytes($hostname, $snmp_community, $snmp_version, $snmp_port, $snmp_timeout);
            $arr = make_data($arr_index, $arr_bytes);

            if (isset($arr[$arg2])) {
                if ($arg1 == 'bytes_in') {
                    return $arr[$arg2]['in'];
                } elseif ($arg1 == 'bytes_out') {
                    return $arr[$arg2]['out'];
                }else {
                    return "ERROR: Invalid Return Value";
                }
            }
        }
    } else {
        return "ERROR: Invalid Parameters\n";
    }
}
?>
Step 2. Save the file below as mt_queues.xml in resources/script_server in your cacti directory:
<queues>
        <name>Get Mikrotik Queues</name>
        <script_path>|path_cacti|/scripts/mt_queues.php</script_path>
        <script_function>mt_queues</script_function>
        <script_server>php</script_server>
        <arg_prepend>|host_hostname| |host_snmp_community| |host_snmp_version| |host_id|</arg_prepend>
        <arg_index>index</arg_index>
        <arg_query>query</arg_query>
        <arg_get>get</arg_get>
        <output_delimeter>:</output_delimeter>
        <index_order>mtIndex:mtQueueName</index_order>
        <index_order_type>alphabetic</index_order_type>
        <index_title_format>|chosen_order_field|</index_title_format>

        <fields>
                <mtQueueName>
                        <name>Mikrotik Queue Name</name>
                        <direction>input</direction>
                        <query_name>index</query_name>
                </mtQueueName>

                <mtBytesIn>
                        <name>Incomming Traffic</name>
                        <direction>output</direction>
                        <query_name>bytes_in</query_name>
                </mtBytesIn>

                <mtBytesOut>                                                                         
                        <name>Outgoing Traffic</name>
                        <direction>output</direction>
                        <query_name>bytes_out</query_name>
                </mtBytesOut>
        </fields>
</queues>
Step 3. Import the template below:
<cacti>	
	<hash_040005d1f390563c77ce4d04670d2dd99ba8d9>
		<name>Mikrotik - Queues bi-directional</name>
		<description></description>
		<xml_path>&lt;path_cacti&gt;/resource/script_server/mt_queues.xml</xml_path>
		<data_input_id>hash_030005332111d8b54ac8ce939af87a7eac0c06</data_input_id>
		<graphs>
			<hash_110005d451540e1c2352e82289f01b5faf3108>
				<name>Traffic Graph</name>
				<graph_template_id>hash_0000058f47fea29183a837e6ccc506514cbffc</graph_template_id>
				<rrd>
					<item_000>
						<snmp_field_name>mtBytesOut</snmp_field_name>
						<data_template_id>hash_0100057832bc48128c99ccd6f879461ad684f2</data_template_id>
						<data_template_rrd_id>hash_08000553f1b8f4c35c201c3dc7cec8ab0f4fee</data_template_rrd_id>
					</item_000>
					<item_001>
						<snmp_field_name>mtBytesIn</snmp_field_name>
						<data_template_id>hash_0100057832bc48128c99ccd6f879461ad684f2</data_template_id>
						<data_template_rrd_id>hash_0800050632606461f4443c9f2a02bfcd9c8e5e</data_template_rrd_id>
					</item_001>
				</rrd>
				<sv_graph>
					<hash_120005bfa3ace5a5beb748e835e67aa88748de>
						<field_name>title</field_name>
						<sequence>1</sequence>
						<text>|host_description| - Traffic - |query_mtQueueName|</text>
					</hash_120005bfa3ace5a5beb748e835e67aa88748de>
				</sv_graph>
				<sv_data_source>
					<hash_1300056d4ee9a6d513a17ecbb116bd1197e55a>
						<field_name>name</field_name>
						<data_template_id>hash_0100057832bc48128c99ccd6f879461ad684f2</data_template_id>
						<sequence>1</sequence>
						<text>|host_description| - Traffic - |query_mtQueueName|</text>
					</hash_1300056d4ee9a6d513a17ecbb116bd1197e55a>
				</sv_data_source>
			</hash_110005d451540e1c2352e82289f01b5faf3108>
		</graphs>
	</hash_040005d1f390563c77ce4d04670d2dd99ba8d9>
	<hash_030005332111d8b54ac8ce939af87a7eac0c06>
		<name>Get Script Server Data (Indexed)</name>
		<type_id>6</type_id>
		<input_string></input_string>
		<fields>
			<hash_070005172b4b0eacee4948c6479f587b62e512>
				<name>Index Type</name>
				<update_rra></update_rra>
				<regexp_match></regexp_match>
				<allow_nulls></allow_nulls>
				<type_code>index_type</type_code>
				<input_output>in</input_output>
				<data_name>index_type</data_name>
			</hash_070005172b4b0eacee4948c6479f587b62e512>
			<hash_07000530fb5d5bcf3d66bb5abe88596f357c26>
				<name>Index Value</name>
				<update_rra></update_rra>
				<regexp_match></regexp_match>
				<allow_nulls></allow_nulls>
				<type_code>index_value</type_code>
				<input_output>in</input_output>
				<data_name>index_value</data_name>
			</hash_07000530fb5d5bcf3d66bb5abe88596f357c26>
			<hash_07000531112c85ae4ff821d3b288336288818c>
				<name>Output Type ID</name>
				<update_rra></update_rra>
				<regexp_match></regexp_match>
				<allow_nulls></allow_nulls>
				<type_code>output_type</type_code>
				<input_output>in</input_output>
				<data_name>output_type</data_name>
			</hash_07000531112c85ae4ff821d3b288336288818c>
			<hash_0700055be8fa85472d89c621790b43510b5043>
				<name>Output Value</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>output</data_name>
			</hash_0700055be8fa85472d89c621790b43510b5043>
		</fields>
	</hash_030005332111d8b54ac8ce939af87a7eac0c06>
	<hash_0000058f47fea29183a837e6ccc506514cbffc>
		<name>Mikrotik - SNMP - Queue Traffic bi-directional</name>
		<graph>
			<t_title>on</t_title>
			<title>|host_description| - Traffic - |query_mtQueueName|</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_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_auto_scale_rigid></t_auto_scale_rigid>
			<auto_scale_rigid>on</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>100000000</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>bits per second</vertical_label>
		</graph>
		<items>
			<hash_100005e3979d51c42a650e3556b89f6adb1d0a>
				<task_item_id>hash_0800050632606461f4443c9f2a02bfcd9c8e5e</task_item_id>
				<color_id>EA8F00</color_id>
				<graph_type_id>7</graph_type_id>
				<consolidation_function_id>1</consolidation_function_id>
				<cdef_id>hash_05000573f95f8b77b5508157d64047342c421e</cdef_id>
				<value></value>
				<gprint_id>hash_060005e9c43831e54eca8069317a2ce8c6f751</gprint_id>
				<text_format>Inbound</text_format>
				<hard_return></hard_return>
				<sequence>1</sequence>
			</hash_100005e3979d51c42a650e3556b89f6adb1d0a>
			<hash_10000548969f16da063834adb17f1d8acf39be>
				<task_item_id>hash_0800050632606461f4443c9f2a02bfcd9c8e5e</task_item_id>
				<color_id>0</color_id>
				<graph_type_id>9</graph_type_id>
				<consolidation_function_id>4</consolidation_function_id>
				<cdef_id>hash_05000573f95f8b77b5508157d64047342c421e</cdef_id>
				<value></value>
				<gprint_id>hash_060005e9c43831e54eca8069317a2ce8c6f751</gprint_id>
				<text_format>Current:</text_format>
				<hard_return></hard_return>
				<sequence>2</sequence>
			</hash_10000548969f16da063834adb17f1d8acf39be>
			<hash_10000518e92ebee4673c28dc8000fc14d3b0f2>
				<task_item_id>hash_0800050632606461f4443c9f2a02bfcd9c8e5e</task_item_id>
				<color_id>0</color_id>
				<graph_type_id>9</graph_type_id>
				<consolidation_function_id>1</consolidation_function_id>
				<cdef_id>hash_05000573f95f8b77b5508157d64047342c421e</cdef_id>
				<value></value>
				<gprint_id>hash_060005e9c43831e54eca8069317a2ce8c6f751</gprint_id>
				<text_format>Average:</text_format>
				<hard_return></hard_return>
				<sequence>3</sequence>
			</hash_10000518e92ebee4673c28dc8000fc14d3b0f2>
			<hash_100005bef63c173e2ac65b099cf1c6cec7ffc2>
				<task_item_id>hash_0800050632606461f4443c9f2a02bfcd9c8e5e</task_item_id>
				<color_id>0</color_id>
				<graph_type_id>9</graph_type_id>
				<consolidation_function_id>3</consolidation_function_id>
				<cdef_id>hash_05000573f95f8b77b5508157d64047342c421e</cdef_id>
				<value></value>
				<gprint_id>hash_060005e9c43831e54eca8069317a2ce8c6f751</gprint_id>
				<text_format>Maximum:</text_format>
				<hard_return>on</hard_return>
				<sequence>4</sequence>
			</hash_100005bef63c173e2ac65b099cf1c6cec7ffc2>
			<hash_10000520d7177f6ed9b031f00a09c5b8fbbae5>
				<task_item_id>hash_08000553f1b8f4c35c201c3dc7cec8ab0f4fee</task_item_id>
				<color_id>DE0056</color_id>
				<graph_type_id>5</graph_type_id>
				<consolidation_function_id>1</consolidation_function_id>
				<cdef_id>hash_05000573f95f8b77b5508157d64047342c421e</cdef_id>
				<value></value>
				<gprint_id>hash_060005e9c43831e54eca8069317a2ce8c6f751</gprint_id>
				<text_format>Outbound</text_format>
				<hard_return></hard_return>
				<sequence>5</sequence>
			</hash_10000520d7177f6ed9b031f00a09c5b8fbbae5>
			<hash_100005166bf8b23ee6db05e6085fbb327d4878>
				<task_item_id>hash_08000553f1b8f4c35c201c3dc7cec8ab0f4fee</task_item_id>
				<color_id>0</color_id>
				<graph_type_id>9</graph_type_id>
				<consolidation_function_id>1</consolidation_function_id>
				<cdef_id>hash_05000573f95f8b77b5508157d64047342c421e</cdef_id>
				<value></value>
				<gprint_id>hash_060005e9c43831e54eca8069317a2ce8c6f751</gprint_id>
				<text_format>Average</text_format>
				<hard_return></hard_return>
				<sequence>6</sequence>
			</hash_100005166bf8b23ee6db05e6085fbb327d4878>
			<hash_1000051de987c37944efb39b5b96bc793b302b>
				<task_item_id>hash_08000553f1b8f4c35c201c3dc7cec8ab0f4fee</task_item_id>
				<color_id>0</color_id>
				<graph_type_id>9</graph_type_id>
				<consolidation_function_id>4</consolidation_function_id>
				<cdef_id>hash_05000573f95f8b77b5508157d64047342c421e</cdef_id>
				<value></value>
				<gprint_id>hash_060005e9c43831e54eca8069317a2ce8c6f751</gprint_id>
				<text_format>Current</text_format>
				<hard_return></hard_return>
				<sequence>7</sequence>
			</hash_1000051de987c37944efb39b5b96bc793b302b>
			<hash_1000056ec6836891ac4543456d4bc6e5bbab93>
				<task_item_id>hash_08000553f1b8f4c35c201c3dc7cec8ab0f4fee</task_item_id>
				<color_id>0</color_id>
				<graph_type_id>9</graph_type_id>
				<consolidation_function_id>3</consolidation_function_id>
				<cdef_id>hash_05000573f95f8b77b5508157d64047342c421e</cdef_id>
				<value></value>
				<gprint_id>hash_060005e9c43831e54eca8069317a2ce8c6f751</gprint_id>
				<text_format>Maximum</text_format>
				<hard_return></hard_return>
				<sequence>8</sequence>
			</hash_1000056ec6836891ac4543456d4bc6e5bbab93>
		</items>
		<inputs>
			<hash_090005ea2505415f1ac855550963fdc22959c2>
				<name>Data Source [bytes_out]</name>
				<description></description>
				<column_name>task_item_id</column_name>
				<items>hash_00000520d7177f6ed9b031f00a09c5b8fbbae5|hash_000005166bf8b23ee6db05e6085fbb327d4878|hash_0000051de987c37944efb39b5b96bc793b302b|hash_0000056ec6836891ac4543456d4bc6e5bbab93</items>
			</hash_090005ea2505415f1ac855550963fdc22959c2>
			<hash_09000558056cbd3aac51b2c94a3e905056a137>
				<name>Data Source [bytes_in]</name>
				<description></description>
				<column_name>task_item_id</column_name>
				<items>hash_000005e3979d51c42a650e3556b89f6adb1d0a|hash_00000548969f16da063834adb17f1d8acf39be|hash_00000518e92ebee4673c28dc8000fc14d3b0f2|hash_000005bef63c173e2ac65b099cf1c6cec7ffc2</items>
			</hash_09000558056cbd3aac51b2c94a3e905056a137>
		</inputs>
	</hash_0000058f47fea29183a837e6ccc506514cbffc>
	<hash_0100057832bc48128c99ccd6f879461ad684f2>
		<name>Mikrotik - Queue Traffic bi-directional</name>
		<ds>
			<t_name></t_name>
			<name>|host_description| - Traffic - |query_mtQueueName|</name>
			<data_input_id>hash_030005332111d8b54ac8ce939af87a7eac0c06</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_150005c21df5178e5c955013591239eb0afd46|hash_1500050d9c0af8b8acdc7807943937b3208e29|hash_1500056fc2d038fb42950138b0ce3e9874cc60|hash_150005e36f3adb9f152adfa5dc50fd2b23337e</rra_items>
		</ds>
		<items>
			<hash_08000553f1b8f4c35c201c3dc7cec8ab0f4fee>
				<t_data_source_name></t_data_source_name>
				<data_source_name>bytes_out</data_source_name>
				<t_rrd_minimum></t_rrd_minimum>
				<rrd_minimum>0</rrd_minimum>
				<t_rrd_maximum></t_rrd_maximum>
				<rrd_maximum>100000000</rrd_maximum>
				<t_data_source_type_id></t_data_source_type_id>
				<data_source_type_id>2</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>0</data_input_field_id>
			</hash_08000553f1b8f4c35c201c3dc7cec8ab0f4fee>
			<hash_0800050632606461f4443c9f2a02bfcd9c8e5e>
				<t_data_source_name></t_data_source_name>
				<data_source_name>bytes_in</data_source_name>
				<t_rrd_minimum></t_rrd_minimum>
				<rrd_minimum>0</rrd_minimum>
				<t_rrd_maximum></t_rrd_maximum>
				<rrd_maximum>100000000</rrd_maximum>
				<t_data_source_type_id></t_data_source_type_id>
				<data_source_type_id>2</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>0</data_input_field_id>
			</hash_0800050632606461f4443c9f2a02bfcd9c8e5e>
		</items>
		<data>
			<item_000>
				<data_input_field_id>hash_07000531112c85ae4ff821d3b288336288818c</data_input_field_id>
				<t_value>on</t_value>
				<value></value>
			</item_000>
			<item_001>
				<data_input_field_id>hash_07000530fb5d5bcf3d66bb5abe88596f357c26</data_input_field_id>
				<t_value>on</t_value>
				<value></value>
			</item_001>
			<item_002>
				<data_input_field_id>hash_070005172b4b0eacee4948c6479f587b62e512</data_input_field_id>
				<t_value>on</t_value>
				<value></value>
			</item_002>
		</data>
	</hash_0100057832bc48128c99ccd6f879461ad684f2>
	<hash_150005c21df5178e5c955013591239eb0afd46>
		<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_150005c21df5178e5c955013591239eb0afd46>
	<hash_1500050d9c0af8b8acdc7807943937b3208e29>
		<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_1500050d9c0af8b8acdc7807943937b3208e29>
	<hash_1500056fc2d038fb42950138b0ce3e9874cc60>
		<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_1500056fc2d038fb42950138b0ce3e9874cc60>
	<hash_150005e36f3adb9f152adfa5dc50fd2b23337e>
		<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_150005e36f3adb9f152adfa5dc50fd2b23337e>
	<hash_05000573f95f8b77b5508157d64047342c421e>
		<name>Turn Bytes into Bits</name>
		<items>
			<hash_1400059bbf6b792507bb9bb17d2af0970f9be9>
				<sequence>1</sequence>
				<type>4</type>
				<value>CURRENT_DATA_SOURCE</value>
			</hash_1400059bbf6b792507bb9bb17d2af0970f9be9>
			<hash_140005a4b8eb2c3bf4920a3ef571a7a004be53>
				<sequence>2</sequence>
				<type>6</type>
				<value>8</value>
			</hash_140005a4b8eb2c3bf4920a3ef571a7a004be53>
			<hash_140005caa4e023ac2d7b1c4b4c8c4adfd55dfe>
				<sequence>3</sequence>
				<type>2</type>
				<value>3</value>
			</hash_140005caa4e023ac2d7b1c4b4c8c4adfd55dfe>
		</items>
	</hash_05000573f95f8b77b5508157d64047342c421e>
	<hash_060005e9c43831e54eca8069317a2ce8c6f751>
		<name>Normal</name>
		<gprint_text>%8.2lf %s</gprint_text>
	</hash_060005e9c43831e54eca8069317a2ce8c6f751>
</cacti>
 
rubenb
just joined
Posts: 10
Joined: Mon Sep 27, 2004 4:27 pm

Simple Queue

Tue Nov 02, 2004 4:50 pm

this is a great script...
I have any simple queue for each ip address in my internal lan.
can we do the same for this queues? how?

gracias!!!
 
User avatar
[ASM]
Member Candidate
Member Candidate
Topic Author
Posts: 284
Joined: Sun Jun 06, 2004 12:59 am
Location: Sofia, Bulgaria
Contact:

Re: Simple Queue

Tue Nov 02, 2004 8:50 pm

this is a great script...
I have any simple queue for each ip address in my internal lan.
can we do the same for this queues? how?

gracias!!!
I have a lot of work... I'll make it when I'm free
 
rubenb
just joined
Posts: 10
Joined: Mon Sep 27, 2004 4:27 pm

No problem

Tue Nov 02, 2004 9:39 pm

My friend this is not a problem.
I can sent the best wine bottle from Argentina... :-)

No, talking seriusly, tellme what is the best way to do this?
Thank you
 
User avatar
[ASM]
Member Candidate
Member Candidate
Topic Author
Posts: 284
Joined: Sun Jun 06, 2004 12:59 am
Location: Sofia, Bulgaria
Contact:

Wed Nov 10, 2004 12:20 am

Active PPP Connections

Step 1: in console mode type "perl -MCPAN -e install Net::SSH::Perl", this will install the Net::SSH::Perl modul for Perl If you don't have it. Install all the packages thet it will want.

Step 2: Just add this code in /usr/lib/perl5/site_perl/5.8.4/Net/Perl/SSH1.pm after line 339:
Note: the path may differ to your Linux distribution.
sub shell_cmd {
	my $ssh = shift;

	my($prompt, $cmd) = @_;

	require Net::SSH::Perl::Handle::SSH1;

	unless ($cmd) {
		$ssh->{config}->set('use_pty', 1)
		unless defined $ssh->{config}->get('use_pty');
	}
	$ssh->_setup_connection;

	$ssh->debug("Requesting shell.");
	my $packet = $ssh->packet_start(SSH_CMSG_EXEC_SHELL);
	$packet->send;

	my ($packet,$pr);
	do {
		$packet = Net::SSH::Perl::Packet->read($ssh);
		$pr = $packet->get_str;
	} while ( ($pr =~ /$prompt/ ) == 0 );

	$ssh->debug("Sending command.");
	my $packet = $ssh->packet_start(SSH_CMSG_STDIN_DATA);
	$packet->put_str($cmd);
	$packet->send;

	$ssh->debug("Command sended");

	my $out = "";

	do {
		$packet = Net::SSH::Perl::Packet->read($ssh);
		$out .= $packet->get_str;
	} while ( ($out =~ /$prompt/ ) == 0 );
	$ssh->_disconnect;
	($out);
} 
Step 3: Create a file named mt_getactivepppusers.pl in your cacti/scripts directory. Paste the code bellow into it:
#!/usr/bin/perl
use Net::SSH::Perl;

my ($host, $user, $pass) = @ARGV;

$ssh = Net::SSH::Perl->new($host, port => 2222, protocol => 1, use_pty => 1, debug => 0 );

$ssh->login($user, $pass);

($out) = $ssh->shell_cmd("] >","/ppp active print count-only\r"); 

($out =~ /(\d+)/) && (($out) = ($1));

print "active:$out";
Step 4: Import the template bellow:
<cacti>	
	<hash_00000658c06625bcc49d7092d1a1653809b6a2>
		<name>Mikrotik - Active PPP Connections</name>
		<graph>
			<t_title></t_title>
			<title>|host_description| - Active PPP Connections</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_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_auto_scale_rigid></t_auto_scale_rigid>
			<auto_scale_rigid>on</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>1000</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>users</vertical_label>
		</graph>
		<items>
			<hash_100006e879276773cc57f10403da50b062a937>
				<task_item_id>hash_08000626866bb834a3e066b0050b1d9dfd097b</task_item_id>
				<color_id>FF0000</color_id>
				<graph_type_id>7</graph_type_id>
				<consolidation_function_id>1</consolidation_function_id>
				<cdef_id>0</cdef_id>
				<value></value>
				<gprint_id>hash_060006e9c43831e54eca8069317a2ce8c6f751</gprint_id>
				<text_format>CPU Usage</text_format>
				<hard_return></hard_return>
				<sequence>1</sequence>
			</hash_100006e879276773cc57f10403da50b062a937>
			<hash_10000699bf768384653af245b632264de59810>
				<task_item_id>hash_08000626866bb834a3e066b0050b1d9dfd097b</task_item_id>
				<color_id>0</color_id>
				<graph_type_id>9</graph_type_id>
				<consolidation_function_id>4</consolidation_function_id>
				<cdef_id>0</cdef_id>
				<value></value>
				<gprint_id>hash_06000619414480d6897c8731c7dc6c5310653e</gprint_id>
				<text_format>Current:</text_format>
				<hard_return></hard_return>
				<sequence>2</sequence>
			</hash_10000699bf768384653af245b632264de59810>
			<hash_100006735b1e036e0285f6c5bc148eecd4c99e>
				<task_item_id>hash_08000626866bb834a3e066b0050b1d9dfd097b</task_item_id>
				<color_id>0</color_id>
				<graph_type_id>9</graph_type_id>
				<consolidation_function_id>1</consolidation_function_id>
				<cdef_id>0</cdef_id>
				<value></value>
				<gprint_id>hash_06000619414480d6897c8731c7dc6c5310653e</gprint_id>
				<text_format>Average:</text_format>
				<hard_return></hard_return>
				<sequence>3</sequence>
			</hash_100006735b1e036e0285f6c5bc148eecd4c99e>
			<hash_1000067806df08db3f4189a028cf6b494c8d93>
				<task_item_id>hash_08000626866bb834a3e066b0050b1d9dfd097b</task_item_id>
				<color_id>0</color_id>
				<graph_type_id>9</graph_type_id>
				<consolidation_function_id>3</consolidation_function_id>
				<cdef_id>0</cdef_id>
				<value></value>
				<gprint_id>hash_06000619414480d6897c8731c7dc6c5310653e</gprint_id>
				<text_format>Maximum:</text_format>
				<hard_return></hard_return>
				<sequence>4</sequence>
			</hash_1000067806df08db3f4189a028cf6b494c8d93>
		</items>
		<inputs>
			<hash_0900061aaa64d745df6b9f6b90fe4f9ff8f4dd>
				<name>Data Source [active]</name>
				<description></description>
				<column_name>task_item_id</column_name>
				<items>hash_000006e879276773cc57f10403da50b062a937|hash_00000699bf768384653af245b632264de59810|hash_000006735b1e036e0285f6c5bc148eecd4c99e|hash_0000067806df08db3f4189a028cf6b494c8d93</items>
			</hash_0900061aaa64d745df6b9f6b90fe4f9ff8f4dd>
		</inputs>
	</hash_00000658c06625bcc49d7092d1a1653809b6a2>
	<hash_010006f9d6a6a7343437d435ce57cfddbb794f>
		<name>Mikrotik - Active PPP users</name>
		<ds>
			<t_name></t_name>
			<name>|host_description| - Active PPP users</name>
			<data_input_id>hash_0300067abffd745fb7ebd05b7fbf85a5069aaa</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_150006c21df5178e5c955013591239eb0afd46|hash_1500060d9c0af8b8acdc7807943937b3208e29|hash_1500066fc2d038fb42950138b0ce3e9874cc60|hash_150006e36f3adb9f152adfa5dc50fd2b23337e</rra_items>
		</ds>
		<items>
			<hash_08000626866bb834a3e066b0050b1d9dfd097b>
				<t_data_source_name></t_data_source_name>
				<data_source_name>active</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_07000665745643edc0baf8ead5c11a16f7335b</data_input_field_id>
			</hash_08000626866bb834a3e066b0050b1d9dfd097b>
		</items>
		<data>
			<item_000>
				<data_input_field_id>hash_07000648aed63055a1879a309dda5725ff2fa1</data_input_field_id>
				<t_value>on</t_value>
				<value>pass</value>
			</item_000>
			<item_001>
				<data_input_field_id>hash_070006cb16b7648e055fe088d39e06ad11430b</data_input_field_id>
				<t_value>on</t_value>
				<value>cacti</value>
			</item_001>
			<item_002>
				<data_input_field_id>hash_0700061f4ad9b066d814f941507bc42bd49f37</data_input_field_id>
				<t_value></t_value>
				<value></value>
			</item_002>
		</data>
	</hash_010006f9d6a6a7343437d435ce57cfddbb794f>
	<hash_0300067abffd745fb7ebd05b7fbf85a5069aaa>
		<name>Mikrotik - Get Active PPP users</name>
		<type_id>1</type_id>
		<input_string>/usr/bin/perl &lt;path_cacti&gt;/scripts/mt_getactivepppusers.pl &lt;ip&gt; &lt;user&gt; &lt;pass&gt;</input_string>
		<fields>
			<hash_0700061f4ad9b066d814f941507bc42bd49f37>
				<name>IP Address</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>ip</data_name>
			</hash_0700061f4ad9b066d814f941507bc42bd49f37>
			<hash_070006cb16b7648e055fe088d39e06ad11430b>
				<name>Username</name>
				<update_rra></update_rra>
				<regexp_match></regexp_match>
				<allow_nulls></allow_nulls>
				<type_code></type_code>
				<input_output>in</input_output>
				<data_name>user</data_name>
			</hash_070006cb16b7648e055fe088d39e06ad11430b>
			<hash_07000648aed63055a1879a309dda5725ff2fa1>
				<name>Password</name>
				<update_rra></update_rra>
				<regexp_match></regexp_match>
				<allow_nulls></allow_nulls>
				<type_code></type_code>
				<input_output>in</input_output>
				<data_name>pass</data_name>
			</hash_07000648aed63055a1879a309dda5725ff2fa1>
			<hash_07000665745643edc0baf8ead5c11a16f7335b>
				<name>Number of active PPP connections</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>active</data_name>
			</hash_07000665745643edc0baf8ead5c11a16f7335b>
		</fields>
	</hash_0300067abffd745fb7ebd05b7fbf85a5069aaa>
	<hash_150006c21df5178e5c955013591239eb0afd46>
		<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_150006c21df5178e5c955013591239eb0afd46>
	<hash_1500060d9c0af8b8acdc7807943937b3208e29>
		<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_1500060d9c0af8b8acdc7807943937b3208e29>
	<hash_1500066fc2d038fb42950138b0ce3e9874cc60>
		<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_1500066fc2d038fb42950138b0ce3e9874cc60>
	<hash_150006e36f3adb9f152adfa5dc50fd2b23337e>
		<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_150006e36f3adb9f152adfa5dc50fd2b23337e>
	<hash_060006e9c43831e54eca8069317a2ce8c6f751>
		<name>Normal</name>
		<gprint_text>%8.2lf %s</gprint_text>
	</hash_060006e9c43831e54eca8069317a2ce8c6f751>
	<hash_06000619414480d6897c8731c7dc6c5310653e>
		<name>Exact Numbers</name>
		<gprint_text>%8.0lf</gprint_text>
	</hash_06000619414480d6897c8731c7dc6c5310653e>
</cacti>

P.S.: add the file atachment module to the forum... it will be GREAT :)
 
mrdarbandy
just joined
Posts: 3
Joined: Fri Jan 25, 2013 10:17 pm

Re: Cacti templates

Fri Jan 25, 2013 11:12 pm

Hello my friend
I am trying to create a temperature graph for my routerboard 450G.
I have got the oid from "system health print oid" but do not know how to make cacti draw the temperature graph for this oid.
I would be so glad if you could make such a temperature graph template for this device.
 
Toiletbowl
Member Candidate
Member Candidate
Posts: 169
Joined: Fri Jun 03, 2011 6:49 am
Location: Boracay Philippines

Re: Cacti templates

Fri May 24, 2013 6:21 pm

Hi there

i try this your template in ros 4.xx but after importing these cpu and memory usage template the result is it doesn't show in data templates :)

Thanks
 
viczulu

Re:

Mon Jan 09, 2017 10:08 am

The script does look great. I am trying to graph my mikrotik queue trees. However i am encountering the issues below:

+ Running data query [16].
+ Found type = '6' [Script Query - Script Server].
+ Found data query XML file at '/usr/share/cacti/site/resource/script_server/mt_queues.xml'
+ XML file parsed ok.
+ Invalid field <index_order>mtIndex:mtQueueName</index_order>
+ Must contain <direction>input</direction> fields only


I am using mikrotik CCR1016-12G
RouterOS version 6.34.4

Who is online

Users browsing this forum: Bing [Bot], gdanov, K0NCTANT1N and 111 guests