Difference between revisions of "Stats Server"

From AllStarLink Wiki
Jump to navigation Jump to search
imported>Bryan
(Created page with "Status server Requires graphviz This consists of several C programs as CGI's and uses LMDB to store data nodes post to the server. * index.cgi - generates the code for the...")
 
 
(7 intermediate revisions by 4 users not shown)
Line 1: Line 1:
Status server
+
{{ Note|This is outdated information as of 2021-01-17. A new stats server has been implemented. }}
 
 
 
Requires graphviz
 
Requires graphviz
  
 
This consists of several C programs as CGI's and uses LMDB to store data nodes post to the server.  
 
This consists of several C programs as CGI's and uses LMDB to store data nodes post to the server.  
 +
 +
The source is under /usr/local/src/status
  
 
* index.cgi - generates the code for the index page and textual output
 
* index.cgi - generates the code for the index page and textual output
Line 9: Line 10:
 
* nodeinfo.cgi - gives the per node report text page
 
* nodeinfo.cgi - gives the per node report text page
 
* getconn.cgi - not really needed for the user interface.  ?$NODE returns text with the total number of connected nodes and the state of each connected node separated by pipes
 
* getconn.cgi - not really needed for the user interface.  ?$NODE returns text with the total number of connected nodes and the state of each connected node separated by pipes
* statsdb.cgi - not needed for the interface.  If the compiled in IP is matched, it will return a dump of the database.
+
* statsdb.cgi - not needed for the interface.  If the compiled in IP is matched, it will return a dump of the database.
* jsondata.cgi - not needed for the interface, no sure what it does.
+
* jsondata.cgi - not needed for the interface, used for returning JSON formated node data from database.
* getstatus.cgi - generates the per node PNG image using getstatus and neato
+
* getstatus.cgi - generates the per node PNG image using getstatus and neato.  This is a bash script.
 +
* graphic-status.html - used to display the big network wide graph
  
These next are not publicly accessible files and are called by the system
+
These next are not publicly accessible files and are called by the system for generating the various parts of the config. 
  
* mkstatslmdb
+
These must be installed under /var/www/stats-private
* mkstatus
+
* updatenodesdb - updates the database from the registration server.  The registration server must permit this.
* getstatus
 
  
 +
* dostatus - executed from roots crontab, and makes the overall network PNG
  
 +
* mkstatslmdb - makes the raw stats LMDB if not there, might be good to run on boot
 +
* mkstatus - used by dostatus, it makes the text data that neato uses to make the large graph
 +
* getstatus - used by getstatus.cgi, it makes the text data neato uses to build the per node graph
 +
* /var/www/stats-private/stats-lmdb - location of the LMDB database.  This should be compiled in.
 +
For speed we can run the stats db on a tempfs in memory.  I've disabled this for now.  but it could be enabled in /etc/fstab.
  
 +
'''Note: The db hangs from time to time and one needs to run a cron job of /usr/local/src/liblmdb/mdb_stat -rr /var/www/stats-private/stats-lmdb to clear the stale readers. see: http://www.lmdb.tech/doc/index.html'''
  
For speed we
+
[[Category: Infrastructure]]

Latest revision as of 03:54, 18 January 2021

This is outdated information as of 2021-01-17. A new stats server has been implemented.

Requires graphviz

This consists of several C programs as CGI's and uses LMDB to store data nodes post to the server.

The source is under /usr/local/src/status

  • index.cgi - generates the code for the index page and textual output
  • uhandler.cgi - receives the http get requests of data from the nodes and writes it to the LMDB
  • nodeinfo.cgi - gives the per node report text page
  • getconn.cgi - not really needed for the user interface. ?$NODE returns text with the total number of connected nodes and the state of each connected node separated by pipes
  • statsdb.cgi - not needed for the interface. If the compiled in IP is matched, it will return a dump of the database.
  • jsondata.cgi - not needed for the interface, used for returning JSON formated node data from database.
  • getstatus.cgi - generates the per node PNG image using getstatus and neato. This is a bash script.
  • graphic-status.html - used to display the big network wide graph

These next are not publicly accessible files and are called by the system for generating the various parts of the config.

These must be installed under /var/www/stats-private

  • updatenodesdb - updates the database from the registration server. The registration server must permit this.
  • dostatus - executed from roots crontab, and makes the overall network PNG
  • mkstatslmdb - makes the raw stats LMDB if not there, might be good to run on boot
  • mkstatus - used by dostatus, it makes the text data that neato uses to make the large graph
  • getstatus - used by getstatus.cgi, it makes the text data neato uses to build the per node graph
  • /var/www/stats-private/stats-lmdb - location of the LMDB database. This should be compiled in.

For speed we can run the stats db on a tempfs in memory. I've disabled this for now. but it could be enabled in /etc/fstab.

Note: The db hangs from time to time and one needs to run a cron job of /usr/local/src/liblmdb/mdb_stat -rr /var/www/stats-private/stats-lmdb to clear the stale readers. see: http://www.lmdb.tech/doc/index.html