Sunday, May 25, 2008

Simple Application - Checks the machine status(Lab use)

So, here goes the first post. Not anything that deals with the concept of Web Component but the first place where I have used JSP which initially was written in CGI and you can't believe JSP is so fast than CGI. Here goes the scenario:

If you are working in a product oriented company, you must be using lot of machines including your PC. There is a chance that there is a lab which is maintaining your all types of Computer... Windows, Solaris, Linux and so on. Most of the time(for me its most of the time :( ), when some machines are down(and that was the time, you want to work on those machines :D). Now knowing the machine is down or not is itself a tedious job and you keep on pinging all machine to check this. Why not, write a JSP page and let everyone in your team to watch which machines are up and which are down. Here goes my code:

MachineDetails.jsp (place it in /webapps folder)
(I am sick of placing HTML code here, so I have uploaded the file somewhere and given you the link, blogspot is frustrating me :-( )
This use something called machine.txt which is not but just a plain file with all machine names like:

machine.txt:

MachineName1
MachineName2
WinBox_15
LinuxBox_20
SolarixBox_1
MachineName11
..
..
and so on.

So simple and so useful :). There is a very small flaw in the code, which I like reader to find out :D.

Feel free to use this code for your lab condition.

No comments: