Graph template for SNMPv2-MIB - sysUpTime

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

Moderators: Developers, Moderators

Guest

Graph template for SNMPv2-MIB - sysUpTime

Post by Guest »

Hi

I created and exported a template to show uptime graphs.

Be warned that this template includes the dependencies, so be careful not to overwrite your existing implementation with this template (backup your Cacti first).

The data template uses the "SNMPv2-MIB::sysUpTime.0" / ".1.3.6.1.2.1.1.3.0" OID.

There is also a "HOST-RESOURCES-MIB::hrSystemUptime.0" / ".1.3.6.1.2.1.25.1.1.0" OID which could do the same thing, should the other OID not be available to you. Simply modify the data template accordingly.

Unfortunately, these graphs will not show uptime of a host as a percentage, which is a bit more complicated.

Have fun!
Attachments
cacti_graph_template_snmpv2mib_sysuptime.xml
(9.59 KiB) Downloaded 2291 times
Guest

Post by Guest »

Okay, SNMPv2-MIB::sysUpTime is only for the SNMP daemon uptime, which isn't the host uptime. Instead, use HOST-RESOURCES-MIB::hrSystemUptime as you had mentioned.

Here are comments from the MIBs;

SNMPv2-MIB
sysUpTime OBJECT-TYPE
SYNTAX TimeTicks
MAX-ACCESS read-only
STATUS current
DESCRIPTION
"The time (in hundredths of a second) since the
network management portion of the system was last
re-initialized."
::= { system 3 }

--

HOST-RESOURCES-MIB
hrSystemUptime OBJECT-TYPE
SYNTAX TimeTicks
MAX-ACCESS read-only
STATUS current
DESCRIPTION
"The amount of time since this host was last
initialized. Note that this is different from
sysUpTime in the SNMPv2-MIB [RFC1907] because
sysUpTime is the uptime of the network management
portion of the system."
::= { hrSystem 1 }



Attached is an updated host template with the dependencies.
Attachments
cacti_graph_template_host_mib_hrsystemuptime.xml
(9.61 KiB) Downloaded 1949 times
websat
Cacti User
Posts: 70
Joined: Wed Jun 22, 2005 3:00 pm
Contact:

Post by websat »

Hi
I use your template, but i have a problem, the graph show 16 days and the server had only 1 day and 15 hours of update....
Attachments
graph_40_1.png
graph_40_1.png (17.39 KiB) Viewed 36240 times
Visit my web site: http://www.websat-telecom.com
Mikf
Posts: 47
Joined: Fri Aug 13, 2004 11:35 am
Location: Paris, France

Post by Mikf »

Hello

Here my template, i use CDEF to display true values of days, hours, minutes ...
Attachments
cacti_graph_template_generic_uptime.xml
Generic Uptime Template with dependencies (updated)
(15.08 KiB) Downloaded 1996 times
Uptime exemple
Uptime exemple
graph_image.png (2.34 KiB) Viewed 36165 times
Last edited by Mikf on Tue Aug 30, 2005 11:07 am, edited 1 time in total.
User avatar
sumsum
Cacti User
Posts: 68
Joined: Mon Apr 26, 2004 7:18 am
Location: Switzerland
Contact:

Post by sumsum »

hi

i like your scripts. thanx for sharing. is it difficult to have a graph which looks like this ? : with additional idle time. or would that be just fancy stuff :)
Attachments
proc.uptime.0.png
proc.uptime.0.png (14.36 KiB) Viewed 36159 times
http://www.lounge-radio.com/
User avatar
sumsum
Cacti User
Posts: 68
Joined: Mon Apr 26, 2004 7:18 am
Location: Switzerland
Contact:

Post by sumsum »

@ Mikf

the following error appear if i try to import your template. i use the lates cacti version. any idea ?

Notice: Undefined index: cf_items in /home/zumbi/public_html/cacti-stats/lib/import.php on line 532

Notice: Undefined index: cf_items in /home/zumbi/public_html/cacti-stats/lib/import.php on line 532

Notice: Undefined index: cf_items in /home/zumbi/public_html/cacti-stats/lib/import.php on line 532

Notice: Undefined index: cf_items in /home/zumbi/public_html/cacti-stats/lib/import.php on line 532

Warning: Cannot modify header information - headers already sent by (output started at /home/zumbi/public_html/cacti-stats/lib/import.php:532) in /home/zumbi/public_html/cacti-stats/templates_import.php on line 67
http://www.lounge-radio.com/
Mikf
Posts: 47
Joined: Fri Aug 13, 2004 11:35 am
Location: Paris, France

Post by Mikf »

ok

i have updated the template file
arto
Posts: 5
Joined: Wed Sep 07, 2005 1:45 am

Post by arto »

Mikf wrote:ok

i have updated the template file
It works great with Fedora Core 2, but with Fedora Core 3 (several servers) all started with 1 day 10 hours, allthough their update were between 54 and 112 days.
Mikf
Posts: 47
Joined: Fri Aug 13, 2004 11:35 am
Location: Paris, France

Post by Mikf »

arto wrote: It works great with Fedora Core 2, but with Fedora Core 3 (several servers) all started with 1 day 10 hours, allthough their update were between 54 and 112 days.
What are the values returned for the OID .1.3.6.1.2.1.1.3.0 by each server?
arto
Posts: 5
Joined: Wed Sep 07, 2005 1:45 am

Post by arto »

Mikf wrote:
arto wrote: It works great with Fedora Core 2, but with Fedora Core 3 (several servers) all started with 1 day 10 hours, allthough their update were between 54 and 112 days.
What are the values returned for the OID .1.3.6.1.2.1.1.3.0 by each server?
Problematic ones:
(FC3)
.1.3.6.1.2.1.1.3.0 = Timeticks: (29079051) 3 days, 8:46:30.51
(uptime) 12:55:28 up 67 days, 20:07, 3 users, load average: 0.54, 0.45, 0.44

.1.3.6.1.2.1.1.3.0 = Timeticks: (29093493) 3 days, 8:48:54.93
(uptime) 12:56:01 up 54 days, 18:40, 2 users, load average: 0.82, 0.51, 0.49

.1.3.6.1.2.1.1.3.0 = Timeticks: (29063698) 3 days, 8:43:56.98
(uptime) 12:56:25 up 57 days, 6:20, 6 users, load average: 1.75, 1.22, 1.01

.1.3.6.1.2.1.1.3.0 = Timeticks: (29098105) 3 days, 8:49:41.05
(uptime) 12:56:45 up 113 days, 1:18, 2 users, load average: 0.34, 0.26, 0.20

(FC4)
.1.3.6.1.2.1.1.3.0 = Timeticks: (29107142) 3 days, 8:51:11.42
(uptime) 13:00:15 up 22 days, 4:04, 21 users, load average: 0.31, 0.26, 0.22

.1.3.6.1.2.1.1.3.0 = Timeticks: (29131106) 3 days, 8:55:11.06
(uptime) 12:57:44 up 22 days, 18:37, 1 user, load average: 0.00, 0.00, 0.00

Others, which are ok:
(FC2)
.1.3.6.1.2.1.1.3.0 = Timeticks: (295155528) 34 days, 3:52:35.28
(uptime) 13:00:43 up 34 days, 3:53, 5 users, load average: 0.07, 0.03, 0.04

(Debian Sarge)
.1.3.6.1.2.1.1.3.0 = Timeticks: (829841426) 96 days, 1:06:54.26
(uptime) 12:57:58 up 96 days, 1:51, 3 users, load average: 0.01, 0.04, 0.01

arto
Mikf
Posts: 47
Joined: Fri Aug 13, 2004 11:35 am
Location: Paris, France

Post by Mikf »

the uptime returned by net-snmp is the uptime of the daemon, not the uptime of the server
arto
Posts: 5
Joined: Wed Sep 07, 2005 1:45 am

Post by arto »

Mikf wrote:the uptime returned by net-snmp is the uptime of the daemon, not the uptime of the server
How should that be fixed?

arto
Mikf
Posts: 47
Joined: Fri Aug 13, 2004 11:35 am
Location: Paris, France

Post by Mikf »

try with HOST-RESOURCES-MIB::hrSystemUptime.0
OID : .1.3.6.1.2.1.25.1.1.0
arto
Posts: 5
Joined: Wed Sep 07, 2005 1:45 am

Post by arto »

Mikf wrote:try with HOST-RESOURCES-MIB::hrSystemUptime.0
OID : .1.3.6.1.2.1.25.1.1.0
It is ok now. Thank you.
tman
Cacti User
Posts: 97
Joined: Thu Oct 14, 2004 4:14 pm

Post by tman »

We're using a recently compiled version of net-snmp 5.3.1 on RHEL 4 (Centos).

Anybody care to explain why hrsystemuptime doesn't respond on these hosts. Surely it's not something you'd have to compile support into net-snmp for! Sounds like it should be something always available.

Even our Windows servers respond to .1.3.6.1.2.1.1.3.0.
Post Reply

Who is online

Users browsing this forum: No registered users and 5 guests