This is the magic behind the Network Status Page (NetSP), masterminded by Nate Book and modified slightly by Hassler Thurston, currently live here.
- The main script,
infobox.pl
, runs on every computer on the network. - The current status is stored by this script in a world readable file, called
the Data file, located at
data.json
in this directory. It is .gitignored because it will update frequently as each script modifies it. - When you visit
netsp-csug.html
, the current status interpreted fromstatic-setup.json
anddata.json
.- First, the page is constructed with
static-setup.json
which holds meta-data, including layout positions, for all devices to be shown. - Second, the statuses are retrieved once a minute (or more often by user
request) from
data.json
and the tooltips are created by JavaScript.
- First, the page is constructed with
Components:
infobox.pl
: The polling script. Tries to be idle as often as possible, updatingdata.json
once every 60 seconds with the current device status. There is a "master" script running and checking for other computers' scripts' downtime (when they haven't updateddata.json
recently enough). If so, the offender is marked as "Down" and the script is attempted to be restarted. The master script checks the non-computer devices, such as drives, cameras, and printers. The rest are called "slaves" and only check themselves. The system is designed to have exactly one script running on each system.data.json
: A dynamically-modified JSON file for the current status.static-setup.json
: The network configuration, just containing the hosts on the network, their addresses, and how to lay out a page to display them.../netsp-csug.html
: The page that renders this NetSP by includingnetsp.js
,style.css
, a validstatic-setup.json
, a set of running devices with at least one computer runninginfobox.pl
, one instance for each device, and a valid tag with the iddiv#netsp-link
to replace.style.css
: Stylesheet for elements of the NetSP.netsp.js
: The JavaScript to run the NetSP.index.php
: A short script that moves you up one level to the NetSP page.
Useful links:
- netsp-csug.html page, in Nate Book's CSUG-home repository
- GitHub home of Nate's CSUG-home repository