Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Initial Commit

  • Loading branch information...
commit 22aa30f4b62fdd4d864ffa232c561a3022dfafd2 1 parent 8543b14
Zag authored
BIN  down.jpg
66 index.php
... ... @@ -0,0 +1,66 @@
  1 +<!DOCTYPE html PUBLIC "-//IETF//DTD HTML 2.0//EN">
  2 +<html><head><title>.:: PHP Server Monitor :..</title></head> <div align="center">
  3 + <p><font color="#003366" size="6" face="Verdana, Arial, Helvetica, sans-serif"><em><strong>School Server Monitor</strong></em></font></p>
  4 + <p><font face="Verdana, Arial, Helvetica, sans-serif"><img src="Images/server.jpg"></font></p><p></p> <font face="Verdana, Arial, Helvetica, sans-serif">
  5 +<?php
  6 +$system = ini_get('system');
  7 +$win = (bool) $windows;
  8 +$count = 1;
  9 +
  10 +// -------------------------
  11 +// Type in the name of the servers inside the quotation marks.
  12 +// Add or remove as many as you want but make sure they have an added "services" entry.
  13 +// -------------------------
  14 +$host[1] = "Server1";
  15 +$host[2] = "Server2";
  16 +$host[3] = "Server3";
  17 +$host[4] = "Server4";
  18 +$host[5] = "Server5";
  19 +$host[6] = "Server6";
  20 +$host[7] = "Server7";
  21 +$host[8] = "Server8";
  22 +$host[9] = "Server9";
  23 +$host[10] = "Server10";
  24 +// -------------------------
  25 +// Type in the function of each server inside the quotation marks.
  26 +// -------------------------
  27 +$services[1] = "User Documents, T: Drive";
  28 +$services[2] = "Active Directory";
  29 +$services[3] = "Backup Active Directory";
  30 +$services[4] = "Email, Webmail";
  31 +$services[5] = "Sims, Payroll, G: Drive";
  32 +$services[6] = "Sharepoint VLE 2003";
  33 +$services[7] = "Sharepoint VLE 2007 Test";
  34 +$services[8] = "Oliver Library Database";
  35 +$services[9] = "Backup, Shared Printers";
  36 +$services[10] = "User Settings";
  37 +
  38 +// You don't need to edit anything beyond here
  39 +echo "<table border=\"0\" align=\"center\">";
  40 +foreach ($host as $value)
  41 +{
  42 + $counter = $counter + 1;
  43 + echo "<tr><td width=120>$value</td>";
  44 + echo '<body bgcolor="#FFFFFF" text="#000000"></body>';
  45 + //check target IP or domain
  46 + $pingreply = exec("ping -n $count $value");
  47 + if ( substr($pingreply, -2) == 'ms')
  48 + {
  49 + #echo "<td width=60><strong><font color='#006600'>UP</font></strong></td>";
  50 + echo "<td width=60><img src='up.png'></td>";
  51 + echo "<td width=230>". $services[$counter] . "</td>";
  52 + echo "<td>Reply Speed ";
  53 + echo substr($pingreply, -13);
  54 + }
  55 + else
  56 + {
  57 + #echo "<td width=60><strong><font color='#990000'>DOWN</font></strong></td>";
  58 + echo "<td width=60><img src='down.jpg'></td>";
  59 + echo "<td width=230>". $services[$counter] . "</td>";
  60 + echo "<td>";
  61 + echo "Timeout...";
  62 + }
  63 +}
  64 +echo "</td></tr></table>";
  65 +?>
  66 +</font></div>
9 readme.txt
... ... @@ -0,0 +1,9 @@
  1 +Just a little PHP script to ping your servers.
  2 +
  3 +You will need to add your servers and their roles to the top of the file.
  4 +
  5 +Code is free, use as you wish.
  6 +
  7 +You will need a web server that runs PHP and the servers must be pingable from inside your network.
  8 +
  9 +Zag (2010)
BIN  server.jpg
BIN  up.png

0 comments on commit 22aa30f

Please sign in to comment.
Something went wrong with that request. Please try again.