Uptime Tool
Description: Analyzes lists of servers, and produces report output of the uptime of these servers.Reasoning: One time a tool was being used which randomly rebooted hundreds of servers, in order to quickly identify those afflicted, I wrote this tool.
FileName: Uptime.cmd
rem -------------------------------rem Uptime Tool V1.0rem -------------------------------rem Description: Reads a file containing a list of servers and rem dynamically creates a web page that displays the uptime of each serverrem Script could be adjusted to display much more information on each serverrem Author: Nigel Glenwood October 26, 2006remrem *****************************************************************************rem technical desc:rem 1 display the web page, inside web page refresh every 5 secondsrem read server file, and run system information, parse out up timerem pipe this into dynamic web pagerem *****************************************************************************
clsecho off
rem create web page startup
copy /y clock2.gif clock
rem set thedir=c:\dat\*.*
rem echo directory set to %thedir%
rem use template to startcopy /y template.htm thepage.html
echo Analysis Start Time: %DATE% %TIME% >> thepage.html
sleep 2
rem open up the IE startup page, which displays # server uptime informationstart /b c:\progra~1\intern~1\iexplore.exe C:\dat\thepage.html
rem :looprem echo looping...
rem read the a server, and create web pagerem %%z passes into create, we pick it up as %1
for /F %%z in (servers.txt) do call create.cmd %%z
echo Analysis Complete >> thepage.htmlecho ^ >> thepage.htmlecho Uptime tool v1.0 by Nigel Glenwood >> thepage.htmlrem change the image on the page to finished.copy /y finish.jpg clockecho ^<^/i^> >> thepage.html
rem sleep 5
rem goto loop
==========================================================
filename: Create.cmd
echo ^Server: %1 ^<^/B^> >> thepage.html
srvinfo -nf \\%1 find "Up Time" >> thepage.html


0 Comments:
Post a Comment
<< Home