PHP SETI@home web monitor (phpsetimon) 0.1.0b7.

PHP SETI Monitor banner

The PHP SETI@home web monitor is a very simple PHP script to monitor single or multiple setiathome programs running in your workstation or server, via the local web server. If you don't know what is SETI@home, visit the SETI@home website.

Features.

  • Ideal for remote servers (or headless servers) running SETI@home.
  • Provides basic historical and current processing statistics.
  • Can preserve a graphical historical record of processed units (as marks in a skymap).
  • Very little CPU usage (except a couple of seconds the first time a map is created).
  • Require software available by default in most GNU/Linux distributions.
  • Doesn't require an SQL database or SSH connections.
  • All graphic support is optional.
  • Works also in Windows workstations and servers.
  • Doesn't require special software to view the report page (no Java, no special libraries, just a web browser).
  • Can work with several setiathome clients running in the same server (in multiprocessor servers).
  • Can work with several remote setiathome clients (via mounted directories).
  • Can request skymap segments from NASA's SkyView virtual telescope.
  • GPL license (open-source).
  • Simple to install.
  • Very simple to use.

Screenshots.

Check out these annotated screenshots (click thumbnail to see larger image) to see what information you'll get when using the PHP SETI@home web monitor:
75 K, click thumbnail to see larger image 64 K, click thumbnail to see larger image 103 K, click thumbnail to see larger image 64 K, click thumbnail to see larger image

Download.

License.

PHP SETI@home web monitor (phpsetimon). Copyright ©2003 by Mario A. Valdez-Ramirez. You can contact Mario A. Valdez-Ramirez by email at mario@mariovaldez.org or by paper mail at Olmos 809, San Nicolas, NL. 66495, Mexico.

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA

OSI-Certified logo

Requirements.

  • Required: PHP 4.1.x or higher. Your web server should be able to interpret the PHP language. It really doesn't matter the platform (tested with GNU/Linux and Windows 2000).
  • Required: A web server. It should work with any web server running in your workstation or server (tested with Apache in GNU/Linux, with Apache in Windows 2000 and IIS in Windows 2000).
  • Optional: GD library (compiled in php) version 1.8 or 2.0. Recommended: GD version 2.0. Chances are your PHP distribution already has GD 2.0 support included.
  • Required: SETI@home client, (tested with 3.03 for Linux and 3.08 for Windows).
  • Required: A web browser., Any HTML 4.0/CSS 2 compatible browser can be used on any platform. Any recent version of Mozilla Netscape, Opera, Safari, Links, Lynx, Internet Explorer, etc. should work.

Installation.

1) Get the files.
Get the files from http://www.mariovaldez.net/software/phpsetimon/ (There are zip and tar.gz files available).

2) Unpack.
Extract the files in a web server directory. That will create a "phpsetimon" directory with several files and directories inside. (Be sure to unpack preserving the directory structure).

3) Change ownership.
Change the ownership of those files and the directory "phpsetimon" to the user used by your web server (usually "nobody" in Unix/Linux).
To change the ownership in Linux/Unix, you execute in a shell terminal in the server the command chown:

chown -h -R nobody:nobody phpsetimon/

In Windows environments, using the Windows Explorer, check the Security tab of the Properties dialog of the directory, and set the permissions so that the user IUSR_servername has permissions to read and write on the "phpsetimon" directory.

4) Locate your SETI files.
Locate the working files of your seti@home software (state.sah, user_info.sah, work_unit.sah, result.sah).

5) Configure.
Edit the seticlients.inc.php file, defining how many clients you want to monitor in the variable ps_seti_instances. Then define the location (directory) of the *.sah files of your SETI client in ps_homedir[1] for the first client, ps_homedir[2] for the second, and so on. For each client directory you need to define a name used to navigate the result page in ps_homename[1] for the first client, ps_homename[2] for the second, and so on.
For each client you need to define if it is local (in the same computer than the web server) or remote (in other computer, accessed via a mounted directory) in ps_homeislocal[1] for the first client, ps_homeislocal[2] for the second, and so on.

Also edit the config.inc.php file to define:

  • ps_cfg_truecolor. If you are using a GD graphics library 2.0.x or higher (which support truecolor processing) set this to true.
  • ps_cfg_useproxy, ps_cfg_proxyaddress, ps_cfg_proxyport. If the web server is behind a http proxy, set the parameters here.
  • ps_cfg_cangetpid. If you are using a non-Unix local client (if the web server is in a non-Unix host) set this to false. If you are using Windows 2000 and have installed the Support Tools (included in the installation CD), you can enable this option.
  • ps_cfg_ignorepidfile. If you are using a local client that don't create pid.sah files (like the Windows graphical clients), set this to true.

6) Test.
Try to open the seti.php file from your the browser thru the web server.

7) If you are upgrading.
If you are upograding from a version older than 0.1.0b7 then move the following files:

  • xxxx_history.txt files to the history directory.
  • xxxx_skymap.png files to the maps directory.
  • xxxx_zoom.png files to the zooms directory.
  • xxxx_skyview.gif files to the skyview directory.

8) You are done.

Questions, comments, suggestions.

You can send your questions, comments or suggestions by email or post them in the web forum.

Web forum for general questions.

This is a web forum for general discussion. If you have a question, answer o suggestion post a comment. This is an open forum, you are not required to register to read or post.

Or, if you feel more confortable, don't hesitate to contact the author by email (mario@mariovaldez.org).

Announces mailing list.

There is an announcements mailing list. You can subscribe to receive a mail message when a new version of the PHP SETI@home web monitor is released, as well as bugfixes announcements. This is a very low traffic list (expect 1 message per month or less). Please note that this is an announcements-only mailing list, it is not intended for general discussion.

To subscribe or unsubscribe check the mailing list page.

How does it work?

When you load the PHP SETI@home web monitor page, you trigger the following events:

  • It checks what client you asked to monitor (if you are monitoring more than one SETI client) and define the expected location of several status files: state.sah, user_info.sah, work_unit.sah, result.sah and pid.sah (this last available only on command-line clients).
  • It checks if there is a special request in this call, which can be: to show the big skymap, to download a SkyView skymap or to regenerate all graphics.
  • It opens (one by one) the SETI files and get only the first 10K of data (20 bytes for the pid.sah). The files are opened and closed as quickly as possible (this should take a fraction of second).
  • Then it parses the extracted data as follow:
    From the work unit file: date of recording, ID, start and end coordinates and range (angle).
    From the user file: SETI Id, results to date, total CPU time, date of registration, date of last results, and the script calculate total days as SETI member and units processed per day. (Please note that these data is updated by the SETI client only when downloading a new work unit, so it may be innacurate).
    From the state file: CPU time used in the current work unit, progress, better gaussian data and better pulse summary. The script calculate an estimation of the time to completion of the current unit (but the progress data is not linear, so the estimation is not accurate).
  • If there is not yet a history file (a small file named xxxx_history.txt), it means this is the first time the page is loaded while processing this work unit, so one is created. Each history file contains the coordinates and date of each work unit.
  • The script try to call the "ps" command (or tlist.exe in Windows 2000) to check if there are processes name "setiathome" (seti@home in windows) in the computer. If one or more are found the script check if it is the same reported in the pid.sah file. If yes, then we've found the process information for the current client (memory and cpu usage, nice level, PID). If not, we cannot declare the setiathome process is dead for the current client, because the status files we are reading may be files in remote machines (in mounted directories), so a warning is shown telling that it cannot be checked if the client is running or not. This step should take a fraction of second.
  • If there is work unit data available, it checks if there is already a big skymap for the current work unit. If not, then this is the first time the page is loaded while processing this work unit. So one is created. It uses the start coordinates of the current work unit and all the history files belonging to the current client. Then creates a copy of the source big skymap, and marks it in the calculated current coordinates and all history coordinates, creating a xxxx_skymap.png file. This step can take a couple of seconds if there are lots of history files for the current client.
  • If there is work unit data available, it checks if there is already a zoomed skymap for the current work unit. If not, then this is the first time the page is loaded while processing this work unit. So one is created. It uses the start coordinates of the current work unit creating a xxxx_zoom.png file. This step can take less than a second.
  • If there is work unit data available, it checks if there is already a downloaded SkyView skymap for the current work unit. If not, then the SkyView download has not been requested before (this is not done automatically). If the script has been loaded with a request to download a SkyView map, then open a http connection to the NASA's SkyView server and ask to generate an optical (DSS) image using the start coordinates of the current work unit. When the HTML response is received, is parsed to check the location of the temporary image and then the image is downloaded and stored as xxxx_skyview.gif. This step can take a couple of minutes (we must wait for the SkyView server to generate the image) but the script is just waiting, using almost no CPU time.
  • With all data gathered and all images created, now the script renders the page. First the header and navigation bar (with the information you defined in seticlients.inc.php), then the user, work unit and processing data. If some information is missing, the user is warned (some data can be missing because the client software is dead, or it is downloading or uploading data, or because an error condition), the zoomed and SkyView maps are displayed (if available), If resources usage data is available, it is displayed (also shown as graphic bars). If there is a request to shown the big skymap or history, they are displayed instead.

In summary: it gets the data from the SETI files, extract the useful statistics, creates the skymaps (only if they don't exist already), downloads the SkyView map (only if it doesn't exist already), tries to get resource usage information and then display the data.

Also note that several steps are optional, depending of the settings in config.inc.php. If you don't want the skymap generation/downloading or history recording, you can easily disable them in config.inc.php.

Response time varies but in our test servers (Pentium III 500 MHz, 128 MB RAM with Slackware GNU/Linux 8.1 and Duron 900 MHz, 256 MB RAM with Windows 2000 Pro, both running setiathome clients) the creation of images takes less than two seconds and after that the rendering of the page takes less than one second (because there is no need to create the maps again).

Browse the source files (0.1.0b7).

Tips.

Remember the PHP monitor only checks the progress of the SETI client when you load the page. If you want to use the PHP monitor as a continous record of the work done by the SETI client, you can use a cron job to load the page using wget or lynx every 3, 6 or 12 hours. (If you are monitoring more than one client, just add ?instance=2 to the URL to open the page for the second client, add ?instance=3 for the third client and so on). For example the following line tells cron to load the phpsetimon web page at 4:30 am and 4:30 pm everyday using wget (this is just an example, you should use your own settings):

30 4,16 * * * wget --output-document=x.txt http://127.0.0.1/phpsetimon/ 1> /dev/null 2> /dev/null

If you want to monitor remote clients, you should grant the local web server read-only access to the file system in the remote system. You can use NFS, Samba, Windows shares, etc. to mount the remote SETI directory.

If you want a minimal monitor (to include in your web page, for example) you can disable all the graphics generated by editing the config.inc.php file. The minimal configuration should set all these items to false: ps_cfg_createzoom, ps_cfg_createbigmap, ps_cfg_creategauss, ps_cfg_cangetpid, ps_cfg_linkskyview, ps_cfg_getskyview, ps_cfg_createhistory, ps_cfg_renderhistory; and ps_cfg_ignorepidfile item to true.

If you are unable to download the SkyView maps to the server, try to open the direct link to the SkyView site, sometimes the NASA server is down. If you are still unable to download the skymaps and you know the SkyView site is working but very slow, edit the config.inc.php file and set the ps_httpconn_timeout to a greater value (default 60 seconds) like 120 or 180 seconds.

Alternatives / other SETI monitoring products.

Isn't this software what you are looking for? There are several other products to monitor/manage your SETI@home software. Check the SETI list of add-ons and the Freshmeat.net software directory.


The skymaps.

The two flat skymaps included by the PHP SETI@home web monitor are rectangular projections generated by the open-source StarChart software for GNU/Linux. (You don't need to install the StarChart software to use the PHP SETI@home web monitor).

For the old skymap we generated four rectagular projections looking at 0, 6, 12 and 18 hrs RA (Right Ascension), 0 deg Dec (Declination) with a scale of 120 deg. Then we merged the images and added some extra lines manually (the grid, scales and the Milky Way shadow) with an image processing application. The resulting skymap ranges 24 hours RA and from +70 to -70 degrees declination.

For the newer skymap we generated eight rectangular projections looking at 0, 3, 6, 9, 12, 15, 18 and 21 hrs RA, 0 deg Dec with a scale of 80 deg. Then we merged the images and added some extra lines manually (the grid, scales and the Milky Way shadow) with an image processing application. The resulting skymap ranges 24 hours RA and from +40 to -40 degrees declination, which is enough for the SETI@home data as the Arecibo Observatory can only scan from +38 degrees to -2 degrees Dec.

Please note that the images downloaded from NASA's SkyView virtual telescope are rendered from copyrighted material by the dataset owners. By default, the PHP SETI@home web monitor requests images from the Digitized Sky Survey 1 which copyright note is as follow (according to SkyView):

The Space Telescope Science Institute (AURA Inc) asserts a copyright on these data which forbids the general distribution of the southern data prior to June 1995 and the northern data prior to February 1996. The original survey data is copyright ROE, the UK-PPARC (Particle Physics and Astronomy Research Council, the successor to the Science and Engineering Research Council), the AAO, CalTech and the National Geographic Society.

Alse note that by downloading images from the SkyView site you are bound to their privacy statement, disclaimer and security terms.

If you are only interested in the first skymap, you can get the image here (click thumbnail to see larger image, 82K, 1852x722):

Also you can get the original editable PNG to modify it in your favorite image processing software: skymap_source.png (382K, 1852x722). (This skymap is also covered by the GPL license).

If you are only interested in the second skymap, you can get the image here (click thumbnail to see larger image, 134K, 3242x720):

Also you can get the original editable PNG to modify it in your favorite image processing software: skymap_source_2.png (533K, 3242x720). (This skymap is also covered by the GPL license).

 
 
NA fum/lmd: 2006.09.25
Copyright ©1994-2024 by Mario A. Valdez-Ramírez.
no siga este enlace / do not follow this link