Writeup:Servers module

From NeoWiki

By: Steve Bularca

This module is for reporting up-to-date status of the servers contained within the IRC network. If you have any comments or suggestions, feel free to append your ideas to this page.

Contents

[edit] Model design

We will have a database table associated with this module. Each row in the table represents a different server. Columns will be defined as follows:

  • Server name
  • net-reachable hostname
  • ports listening for IRC connections
  • Geographical location
  • Administrator
  • Status
  • Last updated

[edit] Controller design

The CakePHP controller will fetch this information from the model, to be displayed on our website.

Due to limited CakePHP skills, I am not yet sure how to incorporate the server list on the homepage. Perhaps creating a separate function within the Servers controller will be able to handle this task.

[edit] Obtaining status information

There are probably several methods about doing this.

  1. Have a cron job run a script which checks each server's status one by one (allowing for a 10-15 second timeout), and then record the resulting information in the database, along with a current timestamp. This can be implemented with a simple command line PHP script.
  2. Use a service already available to us (like trevorj's StatServ) to report the information. The only problem with this would be in the event that his server goes down.
    1. This seems to be the best method so far, and can easily be implemented with RSS feeds.
  3. Invent some crazy way of integrating this directly into CakePHP (who knows?)

[edit] Things to consider

  • How frequently should we poll for updated information?
  • Could tools such as CakePHP Shells help us in any way?
  • $this->requestAction('controller/action');
    • call a function residing in a different controller?
    • can be used to show server list on homepage (calling a function in 'servers' controller from 'pages' controller)