UPTIME in Percent

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

Moderators: Developers, Moderators

Post Reply
alvaro
Posts: 39
Joined: Wed Mar 23, 2005 8:18 am

UPTIME in Percent

Post by alvaro »

Hi all,

Someone have an script to generate servers uptime in percent ?

Thank you,

Alvaro
Thomas
Cacti User
Posts: 112
Joined: Thu Dec 09, 2004 1:51 pm
Location: Austria

Post by Thomas »

As the numbers are already available in CACTI - maybe they could be made available in the next version? (See http://forums.cacti.net/viewtopic.php?t=5222)

If you need to monitor the uptime of M$ systems right now you could use their "uptime.exe".
The statistics look like:

Code: Select all

uptime.exe /s
Uptime Report for: \\xxxxxx

Current OS: Microsoft Windows XP, Service Pack 2, Uniprocessor Free.
Time Zone: Westeuropäische Normalzeit

System Events as of 30.03.2005 15:23:13:

Date:      Time:        Event:               Comment:
---------- -----------  -------------------  -----------------------------------
30.03.2005    12:32:17  Shutdown
30.03.2005    12:34:49  Boot                 Prior downtime:0d 0h:2m:32s

Current System Uptime: 0 day(s), 2 hour(s), 48 minute(s), 55 second(s)


--------------------------------------------------------------------------------

Since 30.03.2005:

           System Availability: 98.5179%
                  Total Uptime: 0d 2h:48m:24s
                Total Downtime: 0d 0h:2m:32s
                 Total Reboots: 1
     Mean Time Between Reboots: 0.12 days
             Total Bluescreens: 0
I've written a script to extract "System Availability:" (has been a bit tricky). This value could be fed into CACTI.
HTH
Thomas Rupp
User avatar
BSOD2600
Cacti Moderator
Posts: 12171
Joined: Sat May 08, 2004 12:44 pm
Location: USA

Post by BSOD2600 »

Thomas wrote:I've written a script to extract "System Availability:" (has been a bit tricky). This value could be fed into CACTI.HTH
Tricky, how so? Just write a simple perl script that looks for "System Availability:", parse the numbers after it, and removes the %.
Thomas
Cacti User
Posts: 112
Joined: Thu Dec 09, 2004 1:51 pm
Location: Austria

Post by Thomas »

Tricky, how so?
Because sometimes you get more than one of this blocks:

Code: Select all

Since 30.03.2005: 

           System Availability: 98.5179% 
                  Total Uptime: 0d 2h:48m:24s 
                Total Downtime: 0d 0h:2m:32s 
                 Total Reboots: 1 
     Mean Time Between Reboots: 0.12 days 
             Total Bluescreens: 0
And I didn't want to write a skript (and install another language). So I used the unix tools for windows (grep, awk ...)
Thomas Rupp
wvr120364
Posts: 16
Joined: Tue May 06, 2003 7:48 am

Post by wvr120364 »

Thomas,

I'm very interested in your script that extracts "System Availability", could you post it here?
Thomas wrote:I've written a script to extract "System Availability:" (has been a bit tricky). This value could be fed into CACTI.
HTH
Wietze
Thomas
Cacti User
Posts: 112
Joined: Thu Dec 09, 2004 1:51 pm
Location: Austria

Post by Thomas »

Hi,

attached you'll find a ZIP file with all required programs, cmd- and text-files. Simply list all servers you would like to monitor in uptime_server.txt and run uptime.cmd. This will create a html-file for all servers.
uptime_server.cmd <servername> C:\temp\UT.log will query one server and save the results in a text file.
uptime /help will show detailed infos about the MS program. You have to be authorized to query other servers (administrator).

HTH
Thomas
Attachments
Uptime.zip
(208.55 KiB) Downloaded 1503 times
Thomas Rupp
wvr120364
Posts: 16
Joined: Tue May 06, 2003 7:48 am

Post by wvr120364 »

Thomas wrote:Hi,

attached you'll find a ZIP file with all required programs, cmd- and text-files. Simply list all servers you would like to monitor in uptime_server.txt and run uptime.cmd. This will create a html-file for all servers.
uptime_server.cmd <servername> C:\temp\UT.log will query one server and save the results in a text file.
uptime /help will show detailed infos about the MS program. You have to be authorized to query other servers (administrator).

HTH
Thomas
Hello Thomas and others,

Thank you for posting the files. I created a new topic http://forums.cacti.net/viewtopic.php?t=10514 that gives a complete solution based on the files Thomas sent. I hope it works.

Wietze Visscher
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
tarapozan
Posts: 1
Joined: Tue May 31, 2011 3:09 am
Contact:

Re: UPTIME in Percent

Post by tarapozan »

Sorry I newbie, how make that file script to be executable?
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests