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
How can i add Uptime to the Statistics?
Moderators: Developers, Moderators
-
- Posts: 33
- Joined: Tue May 05, 2009 7:28 pm
You have the wrong MIB/OID
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,
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,
Improved uptime.sh - in Bash
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.
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 I'll see
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)
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.
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 I'll see
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 447 times
-
- cacti_graph_template_snmp_-_system_uptime.xml
- Changed graph template for Improved script
- (8.9 KiB) Downloaded 495 times
-
- uptime.sh
- Improved uptime.sh rewritten in BASH
- (958 Bytes) Downloaded 564 times
Who is online
Users browsing this forum: No registered users and 0 guests