summaryrefslogtreecommitdiffstats
path: root/doc/server/reports/dynamic.txt
diff options
context:
space:
mode:
Diffstat (limited to 'doc/server/reports/dynamic.txt')
-rw-r--r--doc/server/reports/dynamic.txt172
1 files changed, 172 insertions, 0 deletions
diff --git a/doc/server/reports/dynamic.txt b/doc/server/reports/dynamic.txt
new file mode 100644
index 000000000..a22132afb
--- /dev/null
+++ b/doc/server/reports/dynamic.txt
@@ -0,0 +1,172 @@
+.. -*- mode: rst -*-
+
+.. _server-reports-dynamic:
+
+==============================
+Bcfg2 Dynamic Reporting System
+==============================
+
+Installation
+============
+
+Overview
+--------
+
+Installation of the new reporting system requires installation of a python module and configuration of the Apache webserver with a virtual host. Additionally, until fully integrated, periodically an "import script" must be executed via Cron or similar mechanism.
+
+Versions 0.9.5pre1 and greater no longer need to be installed at the root url for a given host, and therefore no longer require their own virtual host.
+
+Prerequisites
+-------------
+
+* sqlite3
+* pysqlite2
+* `Django <http://www.djangoproject.com>`_
+* mod-python
+
+Install
+-------
+
+'''setup bcfg2.conf or bcfg2-web.conf'''
+
+Be sure to include the specified fields included the example bcfg2.conf file. These can be specified in either /etc/bcfg2.conf, if it is readable by the webserver user, or /etc/bcfg2-web.conf.
+
+
+'''Install skeleton database'''
+
+Inside the {{{bcfg2-tarball/examples/}}} directory from the tarball you will find {{{brpt.sqlite}}}. Copy this file to <path-to-bcfg2-repository>/etc/brpt.sqlite
+
+If you are not using sqlite (the default choice), please see the "Notes on Alternative Databases" section below.
+
+At this point we can import statistics date in to the database from your {{{clients.xml}}} and {{{statistics.xml}}} files.
+
+execute the following: {{{python .../site-packages/Bcfg2/Server/Reports/importscript.py }}}
+
+At this point you shouldn't get any errors or tracebacks. Common problems include incorrect installation of the pysqlite2 module.
+
+'''Next we configure Apache:'''
+
+An example site config is included below for the vhost "reports.mcs.anl.gov"::
+
+ <VirtualHost reports.mcs.anl.gov>
+ ServerAdmin webmaster@mcs.anl.gov
+ ServerName reports.mcs.anl.gov
+ DocumentRoot /var/www/reports
+ <Directory /var/www/reports>
+ Order deny,allow
+ Deny from all
+ Allow from localhost #you may want to change this
+ AllowOverride None
+ </Directory>
+
+ # Possible values include: debug, info, notice, warn, error, crit,
+ # alert, emerg.
+ LogLevel warn
+
+ ServerSignature Off
+
+ # Stop TRACE/TRACK vulnerability
+ <IfModule mod_rewrite.c>
+ RewriteEngine on
+ RewriteCond %{REQUEST_METHOD} ^(TRACE|TRACK)
+ RewriteRule .* - [F]
+ </IfModule>
+ <Location "/">
+ SetHandler python-program
+ PythonHandler django.core.handlers.modpython
+ SetEnv DJANGO_SETTINGS_MODULE Bcfg2.Server.Reports.settings
+ PythonDebug On
+ </Location>
+ <Location "/site_media/">
+ SetHandler None
+ </Location>
+ </VirtualHost>
+
+The first three lines of this configuration must be customized per site.
+
+The {{{bcfg2-tarball/reports/site_media/}}} directory needs to be copied to {{{/var/www/reports/site_media/}}} It could live anywhere; as long as the contents are accessible on the virtual host at {{{/site_media/}}}.
+
+At this point you should be able to point your web browser to the virtualhost you created '''and see the new reports'''.
+
+One final step is to configure your system to import statistics data regularly.
+execute the following: {{{python .../site-packages/Bcfg2/Server/Reports/importscript.py }}}
+
+(''Versions 0.8.7 and prior must specify: {{{python .../site-packages/Bcfg2/Server/Reports/importscript.py-c <repo>/Metadata/clients.xml -s <repo>/etc/statistics.xml}}} '')
+
+on a regular basis, perhaps as often as every 5 or 10 minutes or as infrequent as daily, so your reports are always up to date.
+
+Notes on Alternative Databases
+------------------------------
+
+ If you choose to use a different database, you'll need to edit settings.py from inside of the brpt module. Instructions on this process can be found on the Django website. The provided sqlite database file is pre-populated with the appropriate tables, if you choose a different database engine, you will need to run "python manage.py syncdb" from the brpt module directory to configure it before importing any data. As of vers 0.9.5, these settings are moved to the more appropriate /etc/bcfg2.conf
+
+
+''If you encounter any problems or have suggestions for these instructions feedback is welcome and encouraged.''
+
+Summary and Features
+====================
+
+The new reporting system was implemented to address a number of deficiencies in the previous system. By storing statistics data in a relational database, we are now able to view and analyze more information about the state of the configuration, including information about previous configuration. Specific features in the new system include:
+
+* The ability to look at past statistics information. [[Image(summary_cal.jpg, 30%, right)]]
+* More recent data concerning hosts. The import script may be run quite often, updating the database that contains all statistics information. In the future we anticipate development of a database based statistics module for the server that will allow statistics updates to happen immediately as configuration changes happen.
+* Additional information display in reports. Primarily, reasons for configuration item verification failure are now accessible. This additional data is provided only by the most recent client.
+* Instead of static pages, pages are generated on the fly, allowing users to drill down to find out about a specific host, rather than have one huge page with too much information.
+
+Planned improvements include
+============================
+
+* Accounts, customized displays for each admin. And privacy of config data.
+* Config browsing capabilities; to look at your config in an interesting way.
+* Fixing all the known bugs from below.
+
+Unfortunately with all the improvements, there are a few less exciting elements about the new reporting system. The new reporting system moves away from static pages and towards a real web application, which causes mainly problems with dependancies and makes installation and more difficult. This should become less of a problem over time as Django is packaged and we develop a better installation process for a web app. This should become clear when reading the Installation section that follows.
+
+Usage
+=====
+
+You can use these new reports in tandem with the old system. Currently the new reporting system simply periodically runs an importer script via cron. This imports the XML statistics and clients files to the relational database, building historical information. In the future, a new statistics module in the server will allow direct writing to the database whenever a configuration interaction occurs, which will make the reports always up to date.
+
+bcfg2-reports (command line script)
+-----------------------------------
+
+bcfg2-reports allows you to retrieve data from the database about clients, and the states of their current interactions. It also allows you to change the expired/unexpired states.
+
+The utility runs as a standalone application. It does, however, use the models from /src/lib/Server/Reports/reports/models.py.
+
+A number of different options can be used to change what bcfg2-reports
+displays::
+
+ Usage: python bcfg2-reports [option] ...
+
+ Options and arguments (and corresponding environment variables):
+ -a : shows all hosts, including expired hosts
+ -b NAME : single-host mode - shows bad entries from the
+ current interaction of NAME
+ -c : shows only clean hosts
+ -d : shows only dirty hosts
+ -e NAME : single-host mode - shows extra entries from the
+ current interaction of NAME
+ -h : shows help and usage info about bcfg2-reports
+ -s NAME : single-host mode - shows bad and extra entries from
+ the current interaction of NAME
+ -x NAME : toggles expired/unexpired state of NAME
+ --badentry=KIND,NAME : shows only hosts whose current interaction has bad
+ entries in of KIND kind and NAME name; if a single
+ argument ARG1 is given, then KIND,NAME pairs will be
+ read from a file of name ARG1
+ --extraentry=KIND,NAME : shows only hosts whose current interaction has extra
+ entries in of KIND kind and NAME name; if a single
+ argument ARG1 is given, then KIND,NAME pairs will be
+ read from a file of name ARG1
+ --fields=ARG1,ARG2,... : only displays the fields ARG1,ARG2,...
+ (name,time,state)
+ --sort=ARG1,ARG2,... : sorts output on ARG1,ARG2,... (name,time,state)
+ --stale : shows hosts which haven't run in the last 24 hours
+
+Screenshots
+===========
+
+[[Image(summary_cal.jpg, 30%)]]
+[[Image(node_dropdown.jpg, 30%)]]
+[[Image(item_detail.jpg, 30%)]]