Cisco Uptime - Surely it can't be this hard??

Templates, scripts for templates, scripts and requests for templates.

Moderators: Developers, Moderators

Post Reply
Nunnsby
Posts: 16
Joined: Fri Dec 10, 2010 10:12 am

Cisco Uptime - Surely it can't be this hard??

Post by Nunnsby »

Hi All

I am really struggling to uptime for my Cisco Devices working. I HAVE trawled the site from top to bottom, and read literally all the articles I can find on it. I understand the roll-over issue, I understand the ticks instead of actual date output, but am still struggling. Seems no one else really is, and I can;t believe I am that stupid! :-?

I have tried the hrsystemuptime_unix template, from cacti_graph_template_host_mib_-_hrsystemuptime_unix.xml, and this graphs, but I am plagued by the 496 Day roll-over issue, so my 1yr+ graph is only showing 124 days.

I have also messed around with the generic_uptime template from cacti_graph_template_generic_uptime.xml, but that is returning errors, and is not working.

Output from Graph Debug

Code: Select all

/usr/bin/rrdtool graph - \
--imgformat=PNG \
--start=-86400 \
--end=-300 \
--title='ENG-CTN-R01 - Uptime' \
--base=1000 \
--height=120 \
--width=500 \
--alt-autoscale-max \
--lower-limit=0 \
--vertical-label='Days' \
--slope-mode \
--font TITLE:12: \
--font AXIS:8: \
--font LEGEND:10: \
--font UNIT:8: \
DEF:a="/var/lib/cacti/rra/233/531.rrd":uptime:LAST \
CDEF:cdefa=a,8640000,/ \
CDEF:cdefb=a,DUP,8640000,%,-,8640000,/ \
CDEF:cdefc=a,8640000,%,DUP,360000,%,-,360000,/ \
CDEF:cdefd=a,360000,%,DUP,6000,%,-,6000,/ \
AREA:cdefa#4668E4FF:"Uptime"  \
GPRINT:cdefb:LAST:"Days \:%3.0lf"  \
GPRINT:cdefc:LAST:"Hours \:%2.0lf"  \
GPRINT:cdefd:LAST:"Minutes\:%2.0lf" 

RRDTool Says:

ERROR: the RRD does not contain an RRA matching the chosen CF
I have also found reference to various other OIDs for uptime, but none of them seem to work, see output of various OIDs below.

Code: Select all

$ snmpwalk -v2c -c engen99  10.1.15.250 .1.3.6.1.2.1.1.3.0
iso.3.6.1.2.1.1.3.0 = Timeticks: (1072025379) 124 days, 1:50:53.79

$ snmpwalk -v2c -c engen99  10.1.15.250 .1.3.6.1.6.3.10.2.1.3
iso.3.6.1.6.3.10.2.1.3.0 = INTEGER: 53669953

$ snmpwalk -v2c -c engen99  10.1.15.250 .1.3.6.1.2.1.25.1.1.0
iso.3.6.1.2.1.25.1.1.0 = No Such Object available on this agent at this OID
Can someone point me to a working template, or assist in how to do this?

Regards
Nunnsby
Posts: 16
Joined: Fri Dec 10, 2010 10:12 am

Re: Cisco Uptime - Surely it can't be this hard?? [SOLVED]

Post by Nunnsby »

OKAY!!! I found the problem!!

1) the Calculation was wrong
2) the OID was wrong

So, to get it working, follow these steps:

1) Template here: http://samburney.com/blog/graph-uptime- ... snmp-cacti, direct link (http://samburney.com/system/files/cacti ... uptime.xml)

2) Install the template as per usual

3) Then, go to Data Templates > ucd/net - Uptime (ticks)

4) Change OID to : .1.3.6.1.6.3.10.2.1.3.0 - Must have ZERO at END! SAVE

5) Go to Graph Management > CDEFs > Ticks to Days

6) Select Item #2

7) Change to 86400 - Only 86 400 (one word) :) SAVE

Add to Cisco host, and voila!!!

Happy Days!!

8)
raiten
Posts: 43
Joined: Fri May 12, 2006 12:17 pm

Re: Cisco Uptime - Surely it can't be this hard??

Post by raiten »

Just a quick note

site is down but page & template are still accessible on
https://web.archive.org/web/20130619110 ... snmp-cacti?

and working w cacti 0.8.8b on ubuntu (with above changes)
moraist
Posts: 1
Joined: Wed Jun 27, 2018 4:21 pm

Re: Cisco Uptime - Surely it can't be this hard??

Post by moraist »

Hi Guys,

The files are not available to download, please is possible to share it again?

Best,
Morais
netniV
Cacti Guru User
Posts: 3441
Joined: Sun Aug 27, 2017 12:05 am

Re: Cisco Uptime - Surely it can't be this hard??

Post by netniV »

You can download the official templates at docs.cacti.net.

This was the code that Sam had on his site which is no longer available:

Code: Select all

<cacti>
	<hash_0000168f51eea7be722541da2db10170454718>
		<name>ucd/net - Uptime</name>
		<graph>
			<t_title></t_title>
			<title>|host_description| - Uptime</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>Days</vertical_label>
		</graph>
		<items>
			<hash_1000164157a3c9cd6c7089dd5b5fc2f4958830>
				<task_item_id>hash_080016b19f7e7658c6847b7e053761259803e1</task_item_id>
				<color_id>00CF00</color_id>
				<alpha>FF</alpha>
				<graph_type_id>7</graph_type_id>
				<consolidation_function_id>1</consolidation_function_id>
				<cdef_id>hash_05001668ccb6dfc67d4539d95b20128ba5951a</cdef_id>
				<value></value>
				<gprint_id>hash_060016e9c43831e54eca8069317a2ce8c6f751</gprint_id>
				<text_format></text_format>
				<hard_return></hard_return>
				<sequence>1</sequence>
			</hash_1000164157a3c9cd6c7089dd5b5fc2f4958830>
			<hash_100016bdf4fcf1debda9267bad5bbf7917e44a>
				<task_item_id>hash_080016b19f7e7658c6847b7e053761259803e1</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>hash_05001668ccb6dfc67d4539d95b20128ba5951a</cdef_id>
				<value></value>
				<gprint_id>hash_060016e9c43831e54eca8069317a2ce8c6f751</gprint_id>
				<text_format>Current:</text_format>
				<hard_return></hard_return>
				<sequence>2</sequence>
			</hash_100016bdf4fcf1debda9267bad5bbf7917e44a>
		</items>
		<inputs>
			<hash_090016bf977cfc52b3782b11ca1f79d3b9954e>
				<name>Data Source [uptime]</name>
				<description></description>
				<column_name>task_item_id</column_name>
				<items>hash_0000164157a3c9cd6c7089dd5b5fc2f4958830|hash_000016bdf4fcf1debda9267bad5bbf7917e44a</items>
			</hash_090016bf977cfc52b3782b11ca1f79d3b9954e>
		</inputs>
	</hash_0000168f51eea7be722541da2db10170454718>
	<hash_010016cf6aa4718d35e928c56f6b24126894a0>
		<name>ucd/net - Uptime (ticks)</name>
		<ds>
			<t_name></t_name>
			<name>ucd/net - Uptime (ticks)</name>
			<data_input_id>hash_0300163eb92bb845b9660a7445cf9740726522</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_080016b19f7e7658c6847b7e053761259803e1>
				<t_data_source_name></t_data_source_name>
				<data_source_name>uptime</data_source_name>
				<t_rrd_minimum></t_rrd_minimum>
				<rrd_minimum>0</rrd_minimum>
				<t_rrd_maximum></t_rrd_maximum>
				<rrd_maximum>4000000000</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_080016b19f7e7658c6847b7e053761259803e1>
		</items>
		<data>
			<item_000>
				<data_input_field_id>hash_07001620832ce12f099c8e54140793a091af90</data_input_field_id>
				<t_value></t_value>
				<value></value>
			</item_000>
			<item_001>
				<data_input_field_id>hash_070016c60c9aac1e1b3555ea0620b8bbfd82cb</data_input_field_id>
				<t_value></t_value>
				<value></value>
			</item_001>
			<item_002>
				<data_input_field_id>hash_070016feda162701240101bc74148415ef415a</data_input_field_id>
				<t_value></t_value>
				<value></value>
			</item_002>
			<item_003>
				<data_input_field_id>hash_070016fc64b99742ec417cc424dbf8c7692d36</data_input_field_id>
				<t_value></t_value>
				<value></value>
			</item_003>
			<item_004>
				<data_input_field_id>hash_0700164276a5ec6e3fe33995129041b1909762</data_input_field_id>
				<t_value></t_value>
				<value>.1.3.6.1.2.1.25.1.1.0</value>
			</item_004>
			<item_005>
				<data_input_field_id>hash_070016012ccb1d3687d3edb29c002ea66e72da</data_input_field_id>
				<t_value></t_value>
				<value></value>
			</item_005>
			<item_006>
				<data_input_field_id>hash_0700169c55a74bd571b4f00a96fd4b793278c6</data_input_field_id>
				<t_value></t_value>
				<value></value>
			</item_006>
			<item_007>
				<data_input_field_id>hash_070016ad14ac90641aed388139f6ba86a2e48b</data_input_field_id>
				<t_value></t_value>
				<value></value>
			</item_007>
			<item_008>
				<data_input_field_id>hash_07001632285d5bf16e56c478f5e83f32cda9ef</data_input_field_id>
				<t_value></t_value>
				<value></value>
			</item_008>
			<item_009>
				<data_input_field_id>hash_07001692f5906c8dc0f964b41f4253df582c38</data_input_field_id>
				<t_value></t_value>
				<value></value>
			</item_009>
		</data>
	</hash_010016cf6aa4718d35e928c56f6b24126894a0>
	<hash_0300163eb92bb845b9660a7445cf9740726522>
		<name>Get SNMP Data</name>
		<type_id>2</type_id>
		<input_string></input_string>
		<fields>
			<hash_07001692f5906c8dc0f964b41f4253df582c38>
				<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_07001692f5906c8dc0f964b41f4253df582c38>
			<hash_07001632285d5bf16e56c478f5e83f32cda9ef>
				<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_07001632285d5bf16e56c478f5e83f32cda9ef>
			<hash_070016ad14ac90641aed388139f6ba86a2e48b>
				<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_070016ad14ac90641aed388139f6ba86a2e48b>
			<hash_0700169c55a74bd571b4f00a96fd4b793278c6>
				<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_0700169c55a74bd571b4f00a96fd4b793278c6>
			<hash_070016012ccb1d3687d3edb29c002ea66e72da>
				<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_070016012ccb1d3687d3edb29c002ea66e72da>
			<hash_0700164276a5ec6e3fe33995129041b1909762>
				<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_0700164276a5ec6e3fe33995129041b1909762>
			<hash_070016fc64b99742ec417cc424dbf8c7692d36>
				<name>SNMP Port</name>
				<update_rra></update_rra>
				<regexp_match></regexp_match>
				<allow_nulls></allow_nulls>
				<type_code>snmp_port</type_code>
				<input_output>in</input_output>
				<data_name>snmp_port</data_name>
			</hash_070016fc64b99742ec417cc424dbf8c7692d36>
			<hash_07001620832ce12f099c8e54140793a091af90>
				<name>SNMP Authenticaion Protocol (v3)</name>
				<update_rra></update_rra>
				<regexp_match></regexp_match>
				<allow_nulls></allow_nulls>
				<type_code>snmp_auth_protocol</type_code>
				<input_output>in</input_output>
				<data_name>snmp_auth_protocol</data_name>
			</hash_07001620832ce12f099c8e54140793a091af90>
			<hash_070016c60c9aac1e1b3555ea0620b8bbfd82cb>
				<name>SNMP Privacy Passphrase (v3)</name>
				<update_rra></update_rra>
				<regexp_match></regexp_match>
				<allow_nulls></allow_nulls>
				<type_code>snmp_priv_passphrase</type_code>
				<input_output>in</input_output>
				<data_name>snmp_priv_passphrase</data_name>
			</hash_070016c60c9aac1e1b3555ea0620b8bbfd82cb>
			<hash_070016feda162701240101bc74148415ef415a>
				<name>SNMP Privacy Protocol (v3)</name>
				<update_rra></update_rra>
				<regexp_match></regexp_match>
				<allow_nulls></allow_nulls>
				<type_code>snmp_priv_protocol</type_code>
				<input_output>in</input_output>
				<data_name>snmp_priv_protocol</data_name>
			</hash_070016feda162701240101bc74148415ef415a>
		</fields>
	</hash_0300163eb92bb845b9660a7445cf9740726522>
	<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_05001668ccb6dfc67d4539d95b20128ba5951a>
		<name>Ticks to Days</name>
		<items>
			<hash_140016d817245c6d8d22b4be4602a9252a8928>
				<sequence>1</sequence>
				<type>4</type>
				<value>CURRENT_DATA_SOURCE</value>
			</hash_140016d817245c6d8d22b4be4602a9252a8928>
			<hash_140016fb72017604454eb5401dabee26b13b91>
				<sequence>2</sequence>
				<type>6</type>
				<value>8640000</value>
			</hash_140016fb72017604454eb5401dabee26b13b91>
			<hash_1400163f0a56422f5ed9940ea0c1201fdd5d56>
				<sequence>3</sequence>
				<type>2</type>
				<value>4</value>
			</hash_1400163f0a56422f5ed9940ea0c1201fdd5d56>
		</items>
	</hash_05001668ccb6dfc67d4539d95b20128ba5951a>
	<hash_060016e9c43831e54eca8069317a2ce8c6f751>
		<name>Normal</name>
		<gprint_text>%8.2lf %s</gprint_text>
	</hash_060016e9c43831e54eca8069317a2ce8c6f751>
</cacti>
Cacti Developer & Release Manager
The Cacti Group

Director
BV IT Solutions Ltd

+--------------------------------------------------------------------------+

Cacti Resources:
Cacti Website (including releases)
Cacti Issues
Cacti Development Releases
Cacti Development Documentation
Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests