How can i add Uptime to the Statistics?

Post support questions that relate to the Windows 2003/2000/XP operating systems.

Moderators: Developers, Moderators

archana
Posts: 5
Joined: Tue Mar 03, 2009 4:54 am

uptime graph

Post by archana »

hi Thomas,

wow, great script, Thomas could you plz give this same coding for Linux server also.i am also wants implement this in my system
aaronnicoli
Posts: 33
Joined: Tue May 05, 2009 7:28 pm

You have the wrong MIB/OID

Post by aaronnicoli »

Hi there,

One thing I have noticed with this script where it uses system.sysUpTime.0 as the uptime source is wrong, this is purely the time since snmpd was last started...

I believe in your script you may want to change this to OID .1.3.6.1.2.1.25.1.1.0 as this will give you the actual uptime of the system rather than just the SNMP daemon.

Thanks,
lwq
Posts: 3
Joined: Sat Feb 20, 2010 7:52 am
Location: Czech Republic
Contact:

Improved uptime.sh - in Bash

Post by lwq »

Hi,

this original script is interesting but I've had problems with getting data from some hosts (especially PtP radio link with some kind of linux in it).
The problem was that they doesn't support enterprise MIB - OID 1.3.6.1.2.1.25.1.1.0 2 but only 1.3.6.1.2.1.25.1.1.0 2 which provides uptime of SNMP daemon. Uptime of SNMPd is quite fine actualy because on these problematic hosts SNMPd starts right after bootup and it is impossible (nearly) to stop SNMPd running there. Therefor uptime gathered by this OID is OK. :wink:

I sit down and rewrite whole original shell script to Bash and I hope that it will useful for somebody.
Script constains comments therefor it is pretty selfexplanatory. Enjoy :)

See content of attached uptime.sh for more info.


PS : I think there is quite easy way to improve this script even to be run under Win env. Unfortunately I have no Win machine running to try it. Actually I can use VirtualBox :lol: I'll see 8)

EDIT: I've add changed data and graph template for this script - works for me, subject to be changed for your need, useful for inspiration (I hope) :)
Attachments
cacti_data_template_snmp_-_system_uptime.xml
Changed data template for Improved script
(4.28 KiB) Downloaded 446 times
cacti_graph_template_snmp_-_system_uptime.xml
Changed graph template for Improved script
(8.9 KiB) Downloaded 494 times
uptime.sh
Improved uptime.sh rewritten in BASH
(958 Bytes) Downloaded 563 times
Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests