Code Monkey home page Code Monkey logo

php-server-status-dashboard's Introduction

PHP Server Status Dashboard

Overview

PHP Server Status Dashboard is a collection of client and server software that make it easier to monitor your servers in near real-time. It impliments both Long Polling and EventSource (https://github.com/Yaffle/EventSource/) load methods. Currently, the EventSource load style is implemented using a Polyfill due to some bugs in the current versions of mainstream browsers dealing with CORS.

Server components (Server.class.php) were built on CentOS (RHEL) so some calls make use of RPM commands and would need to be translated to work in your environment. A binary wrapper is included to make calls from the dashboard to the server to start/restart/stop services as a pass-through for PHP. Source for the wrapper is included in 'build' in case you need to modify and re-compile it.

The software is setup to use Basic Authentication for accessing the server data. If you want to roll your own authentication system you'll want to make changes to the headers both load styles send as they currently send Authentication headers.

Setup

Server

  • Copy contents of 'server' to a directory on your server.
  • Setup Basic Authentication on directory
  • Edit the header Access-Control-Allow-Origin in both info.json.php and info.event.json.php to match the domain your dashboard will live on.
  • Edit the array of services to poll in Server::getServicesInfo in both info.json.php and info.event.json.php
  • Edit the directory string and forbidden array in Server::getDomainList in both info.json.php and info.event.json.php. Directory string is a path to a directory containing your domains. Idealy, each domain will have a directory named after itself; /var/www/vhosts/domain1.com, /var/www/vhosts/domain2.com, etc. The forbidden array is a list of directory names to not include when traversing the main directory.
  • Make any necessary changes to Server.class.php so that system calls will work on your setup. We've tested on CentOS 5.6 and CentOS 6.3.
  • Upload it all
  • Set permissions on service.sh to chown root service.sh and chmod u=rwx,go=xr service.sh
  • Set permissions on service to chown root service and chmod u=rwx,go=xr,+s service

Dashboard

  • Copy contents of 'dashboard' to a directory on your server. Does not need to be the same server as above.
  • Edit the list of available servers to poll in application.js under assets/scripts
  • Default is set to use Long Polling at a 5 second interval. Change that on lines 73 and 74 of application.js if needed.
  • Set Basic Authentication username and password on line 75 of application.js
  • Upload it all

Screenshots

01 01 01 01 01 01

License

Copyright (c) 2013, e-works media, inc. All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  • Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  • Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
  • Neither the name of e-works media, inc. nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

php-server-status-dashboard's People

Contributors

eworksmedia avatar

Watchers

James Cloos avatar Andrew avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.