UPTIME in Percent

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

Moderators: Moderators, Developers

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

UPTIME in Percent

#1 Post by alvaro » Wed Mar 30, 2005 7:50 am

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

#2 Post by Thomas » Wed Mar 30, 2005 8:37 am

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: 12160
Joined: Sat May 08, 2004 12:44 pm
Location: USA

#3 Post by BSOD2600 » Wed Mar 30, 2005 1:21 pm

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

#4 Post by Thomas » Thu Mar 31, 2005 1:38 am

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

#5 Post by wvr120364 » Wed Nov 09, 2005 1:41 pm

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

#6 Post by Thomas » Fri Nov 11, 2005 4:31 am

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 1425 times
Thomas Rupp

wvr120364
Posts: 16
Joined: Tue May 06, 2003 7:48 am

#7 Post by wvr120364 » Tue Nov 22, 2005 8:25 am

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

#8 Post by archana » Fri Mar 06, 2009 7:09 am

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

#9 Post by tarapozan » Tue May 31, 2011 3:26 am

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

Post Reply