Jump to content

Recommended Posts

Posted

No idea where this has to go, move if needed.

 

I am looking to make a webpage that would be hosted internally that is a "System Status" page, very much like whats at the top here: Mojang | Support Center so staff can get at a glance the status of things like: Network Status, Email System, VPN. Preferably something I can control from the office, I don't need it automated as that's a bit overkill for what I want.

 

I found this, don't know if its relevant: Stashboard: The open source status dashboard. I have knowledge of HTML and web design but thats my limit so Python is way over my head!

 

Somebody please help!

 

Matt

Posted

Why not just do a flat HTML page on your intranet and edit the code when necessary? We have a traffic light on our helpdesk page and when something is iffy, I shuffle the comments brackets around and change the lightbulb to orange (usually whilst making the Red Dwarf joke).

 

I just leave the relevant HTML file open in Notepad++ all the time, edit when needed and hit Ctrl+S. Change made. Easy.

Posted

That was my first thought. I might start trying to code that when i get home. Its been a while since i built something from scratch.

 

I was wondering if there are any pre-made things out there.

 

Thanks!

Posted

I'd say that if you're not shoving it front-and-centre, no-one is going to go out of their way to look at it - stick it on your main intranet page then it'll actually get seen!

 

I don't think you need to go over the top and list lots of systems - we just have a single red/orange/green lightbulb PNG image and anytime it's not green, I write a brief comment as to why.

Posted
I'd say that if you're not shoving it front-and-centre, no-one is going to go out of their way to look at it - stick it on your main intranet page then it'll actually get seen!

 

I don't think you need to go over the top and list lots of systems - we just have a single red/orange/green lightbulb PNG image and anytime it's not green, I write a brief comment as to why.

 

I am planning to put this on the main page of our helpdesk so when they go to make complaints that they can't email pictures of LOL cats to their friends they can see i'm dealing with it :)

 

Could you possibly post the code for your traffic light page?

 

Im just going to put basic systems eg: Servers up and active, email, VPN.

 

Matt

Posted
Could you possibly post the code for your traffic light page?

 

Literally just this (goes in a block on our Spiceworks page)



System Status: Normal


http://ws0:9675/portal/logo/greenLight.png
All systems working fine.

(now you know the last two major problems we had here as well)

 

The three images are attached, not that they're much special.

greenLight.png

amberLight.png

redLight.png

  • Thanks 1
Posted

Here's a bit of code I came up with the other day which might help

/*
# check server status (replaces servers alive)
# relies on https://github.com/geerlingguy/Ping
# relies on http://www.leefindlow.com/projects/server-status/
*/

require_once('Ping.php');
include('ServerStatus.class.php');

# servers to check
#                                    hostname                  function                   services to check  
$cfg['servers'][0] = array('host' => 'sisko', 'description' => 'Main Website', 'ports' => '80,143,3306');
$cfg['servers'][1] = array('host' => 'odo',   'description' => 'Moodle',       'ports' => '80,3306');
$cfg['servers'][2] = array('host' => 'kim',   'description' => 'Media',	       'ports' => '80');

# services table
#                                     service                 port                   service description
$cfg['services'][0] = array('name' => 'Web Server',	'port' => 80, 	'description' => 'Web server, such as Apache');
$cfg['services'][1] = array('name' => 'SSH',		'port' => 22, 	'description' => 'Secure SHell service is running for remote access');
$cfg['services'][2] = array('name' => 'MySQL',		'port' => 3306,	'description' => 'MySQL database server');
$cfg['services'][3] = array('name' => 'SMTP',		'port' => 25,	'description' => 'Mail server (SMTP)');
$cfg['services'][4] = array('name' => 'FTP',		'port' => 21,	'description' => 'FTP server running to allow file transfers');
$cfg['services'][5] = array('name' => 'Telnet',		'port' => 23,	'description' => 'Telnet server running to allow (unsecure) remote access');
$cfg['services'][6] = array('name' => 'POP',		'port' => 110,	'description' => 'Mail server (POP)');
$cfg['services'][7] = array('name' => 'IMAP',		'port' => 143,	'description' => 'Mail server (IMAP)');

$ping = new Ping('127.0.0.1');															// initialise ping
$ss = new ServerStatus();																// initialise server status
$detail = false;
$detail = $_GET['detail'];
?>

<br />
.resultstable{border-collapse:collapse;}<br />
.resultstable td,.resultstable th{<br />
    padding:10px;<br />
}<br />
.resultstable tr:hover .name,.resultstable tr:hover .description{<br />
    background-color:#ddd;<br />
    -webkit-transition:all 0.8s;<br />
}<br />
.host{background-color:#768da9;}<br />
.bg-red{background-color:#F33;}<br />
.bg-green{background-color:#3F3;}<br />


</pre><table class="resultstable">


foreach($cfg['servers'] as $server) {
$ping->setHost($server['host']);													// check server is up
$latency = $ping->ping('socket');
echo '';
echo '' . $server['host'] . '';
echo ''.$server['description'].'';
if ($latency) {
	echo 'Up';
} else {
	echo 'Down';
}
echo '';
if ($detail) {
if ($latency) {																		// server up, check services
	$ports = explode(',',$server['ports']);
	foreach($ports as $port) {
		foreach($cfg['services'] as $service) {										// locate each service in table
			if ($port == $service['port']) {
				echo '';
				echo '' . $service['name'] . '';
				if ($ss->checkServer($server['host'], $service['port'])) {
					echo 'Ok';    
				} else {
					echo 'Fail';
				}
				echo '' . $service['description'] . '';
				echo '';
			}
		}
	}
}
echo '';
}
}
?>


</tabl

Posted

Right! After some headbanging and HTML lessons ive knocked this up!

 

Its a combination of both Zag's code and Sonofsantas code. I think its quite good!

 

[ATTACH=CONFIG]17833[/ATTACH]

 

Tell me what you think!

 

Matt

Posted
@zag Ive got that setup and working. Does it refresh automatically? If a server was to go down would it pick it up straight away or would a refresh be needed?

 

No its doesn't refresh automatically, but someone posted some code in the original thread to do that.

 

Looks great :)

  • 1 month later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...