Single web front end for jsonstats.
- Only requires Python (w/ simplejson if 2.4 or 2.5)
- Python 2.4+ compatible
- Simple filesystem based caching
- Access and application logging
- JSON based configuration
- host and environment REST endpoints
- Ajaxy
- Unit tested
Use ./setup.py test from the main directory to execute unittests.
Configuration of the server is done in JSON and is by default kept in the current directories config.json file. You can override the location by setting TALOOK_CONFIG_FILE environment variable or using the -c/--config switch on the all in one server.
Name | Type | Value |
---|---|---|
hosts | dict | hostname: environment pairs |
endpoint | str | Endpoint url to pull json data from with a %s placeholder for hostname |
templatedir | str | Directory which holds the templates directory |
cachedir | str | Full path to the cache directory |
cachetime | dict | kwargs for Python's datetime.timedelta 1 |
logdir | str | Full path to the log directory |
staticdir | str | Full path to the static files directory |
{
"hosts": {
"somehost.example.com": "prod",
"another.host.example.com": "prod",
"aqasystem.example.com": "qa",
"127.0.0.1": "dev"
},
"endpoint": "http://%s:8888/stats.json",
"templatedir": "/var/www/talook",
"cachedir": "/var/cache/talook/",
"cachetime": {"hours": 1},
"logdir": "/var/logs/talook/",
"staticdir": "/srv/www/talook/static/"
}
Index page. What a user will interact with.
Returns JSON data listing all configured hosts.
Returns JSON data listing all configured environments.
Returns stats for a specific host in JSON format. Cache is used if available.
Returns a static file from the static directory.
There are two log file which are produced by a running instance.
- talook_access.log: Access log similar to apache's access log.
- talook_app.log: Application level logging which logs some logic results.
- Edit the configuration file
- python server.py --listen 0.0.0.0 --port 8008 --config ./config.json
mod_wsgi can be used with Apache to mount talook. There are example files in contrib/apache/ which can help set an instance up. Note that the wsgi process owner will need to be able to write and/or read from the locations listed in the config.json just like in the standalone server!
- talook.wsgi: The WSGI file that mod_wsgi will use.
- talook.conf: The configuration file which mounts the WSGI application.
One or both may be needed when using mod_wsgi on Apache if SELinux is enabled.
- setsebool -P httpd_can_network_connect 1
- semanage port -a -t http_port_t -p tcp 8888