Simple function for displaying a few key elements of information regarding your server.
By : Matt
<?
//written by TDenholm (tim@radresource.net)
function server_stats() {
$server_software_get = getenv('SERVER_SOFTWARE');
$server_software = explode(" ", $server_software_get);
$server_name = getenv('SERVER_NAME');
$gateway_interface = getenv('GATEWAY_INTERFACE');
$server_protocol = getenv('SERVER_PROTOCOL');
$server_port = getenv('SERVER_PORT');
?>
<table border="0" cellspacing="0" bgcolor="#000000">
<tr>
<td><table border="0" cellspacing="0">
<tr>
<td colspan="2" bgcolor="#FF8000"><p
align="center"><font size="2" face="Verdana Ref"><strong>Server
Statistics</strong></font></p>
</td>
</tr>
<tr>
<td bgcolor="#FFFFFF" valign="top"><font size="2"
face="Verdana Ref">Server Software:</font></td>
<td bgcolor="#FFFFFF"><font size="2"
face="Verdana Ref">
<?
for ($i = 0; $i < count($server_software); $i++) {
echo $server_software[$i];
echo "<br>";
}
?>
</font></td>
</tr>
<tr>
<td bgcolor="#FFFFFF"><font size="2"
face="Verdana Ref">Server Name:</font></td>
<td bgcolor="#FFFFFF"><font size="2"
face="Verdana Ref"><?echo $server_name;?></font></td>
</tr>
<tr>
<td bgcolor="#FFFFFF"><font size="2"
face="Verdana Ref">Server Protocol:</font></td>
<td bgcolor="#FFFFFF"><font size="2"
face="Verdana Ref"><?echo $server_protocol;?></font></td>
</tr>
<tr>
<td bgcolor="#FFFFFF"><font size="2"
face="Verdana Ref">Server Port:</font></td>
<td bgcolor="#FFFFFF"><font size="2"
face="Verdana Ref"><?echo $server_port;?></font></td>
</tr>
<tr>
<td bgcolor="#FFFFFF"><font size="2"
face="Verdana Ref">Server CGI Revision:</font></td>
<td bgcolor="#FFFFFF"><font size="2"
face="Verdana Ref"><?echo $gateway_interface;?></font></td>
</tr>
</table>
</td>
</tr>
</table>
<?
}
?>
| DISCLAIMER: The content provided in this article is not warranted or guaranteed by Developer Shed, Inc. The content provided is intended for entertainment and/or educational purposes in order to introduce to the reader key ideas, concepts, and/or product reviews. As such it is incumbent upon the reader to employ real-world tactics for security and implementation of best practices. We are not liable for any negative consequences that may result from implementing any information covered in our articles or tutorials. If this is a hardware review, it is not recommended to open and/or modify your hardware. |
More Counters Code Articles
More By Codewalkers
developerWorks - FREE Tools! |
Learn field-tested SOA principles, methodology, technology and implementation from the global SOA market leader - in a new e-book by an IBM SOA expert. Written by IBM Certified SOA Solution Designer Bobby Woolf, "Exploring IBM SOA Technology & Practice" is the ultimate insider's guide to SOA - a PDF e-book packed cover to cover with IBM's specific advice on how to make your SOA implementation a success. FREE! Go There Now!
|
|
|
|
Poor Requirements Management capabilities in an Enterprise have been linked to excessive project failures, escalating IT costs, and failure to deliver competitive advantage into the marketplace. Join Brianna M Smith from IBM Rational and learn about how successful organizations align IT and Business stakeholders through collaborative processes and tools for effective requirements management, and how an integrated approach across the IT lifecycle can provide unparalleled visibility and traceability to ensure that project teams are delivering on the business vision by "doing the right things" and "doing things right." FREE! Go There Now!
|
|
|
|
Download a free trial version of IBM DB2 9.5 for Linux, UNIX, and Windows. DB2 9 is the result of a five-year development project that transformed traditional (static) database technology into an interactive data server that merges the high performance and ease of use of DB2 with the self-describing benefits of XML. FREE! Go There Now!
|
|
|
|
Learn how Rational Build Forge can extend a simple compile and package build process by adding customization and deployment capability. Go from a manual method to automating: checking for code changes; getting the latest source; compiling and packaging; customizing; copying to and restarting a deployment server; and sending e-mail notification that a new version is available. FREE! Go There Now!
|
|
|
|
Ken Krugler, co-founder of code search company Krugle, and Laura Merling, vice president of Marketing and Business Development for Krugle, join to talk about the ins and outs of code search and what it means as a new feature for developerWorks users. FREE! Go There Now!
|
|
|
|
Learn how to do more with your reusable assets with the free Rational Asset Manager eKit. The eKit includes demos on how Rational Asset Manager tracks and audits your assets in order to utilize them for reuse. Plus you’ll find white papers and a Webcast that discuss the challenges of a Service Oriented Architecture and how Rational Asset Manager can provide quick and effective solutions. FREE! Go There Now!
|
|
|
|
Get a free trial download of the latest version of IBM Rational Method Composer V7.2 which helps you deliver customized yet consistent process guidance to your project teams and IT organization, and includes the latest version of IBM Rational Unified Process (RUP), which has provided process guidance to teams since 1996. FREE! Go There Now!
|
|
|
|
You can now evaluate IBM Rational Asset Manager V7.0 online without installing or configuring it on your own system! Rational Asset Manager helps create, modify, govern, find, and reuse any type of development assets, including SOA and systems development assets. Rational Asset Manager helps you reduce software development costs and improve quality by facilitating the reuse of all types of software development-related assets. Visit developerWorks to learn more about this product and register to explore its capabilities online. FREE! Go There Now!
|
|
|
|
Whether you are creating new applications or modifying existing ones, managing integration of new components with traditional z/OS elements is a critical part of building and deploying modern applications. Listen to this webcast to see how IBM can help you optimize your development process using an IDE like Rational Developer for System z that integrates with management tools, such as ClearCase to manage your application development on mainframes. FREE! Go There Now!
|
|
|
|
Attend this launch webcast with Scott Hebner, Vice President of IBM Rational Marketing and Strategy, where he will overview Rational’s new offerings and programs to help customers accelerate software innovation on System z. He will discuss how these solutions help organizations extend their core business processes toward modern architectures such as SOA and web technologies to deliver business improvements that stand the test of time. FREE! Go There Now!
|
|
|
|
All FREE IBM® developerWorks Tools! |