AFS version tracking database
Project description
avdb - AFS version tracking database
avdb runs the OpenAFS rxdebug command in batches to find versions of AFS servers running in the wild. The data is stored in a small database. Sqlite and mysql databases are currently supported.
Installation
Install the OpenAFS rxdebug command before installing avdb. The rxdebug command may be installed from packages or from building the OpenAFS user-space packages from source. rxdebug is the only OpenAFS program used by avdb at this time. A cache manager (OpenAFS client) is not required.
A makefile is provided with avdb to facilate development and installation from a git checkout. The avdb package can be installed directly from a git checkout with the install-user target:
$ make install-user
or for site-wide installation:
$ sudo make install
Next, run the avdb init subcommand to create the database and tables. Provide a connection url on the command line to specify the database type and the connection credentials. The connection url will be saved in the avdb config file ~/.avdb.ini for subsequent invocations of avdb.
To create an sqlite database:
$ avdb init --url sqlite:////<path>/<to>/avdb.db
To create a mysql database:
$ avdb init --url mysql://<user>:<secret>@<hostname>/avdb \ --admin <mysql-admin-user> \ --password <mysql-admin-password>
Example usage
Import the list of cells to be scanned with the ‘import’ subcommand.:
$ avdb import --csdb https://grand.central.org/dl/cellservdb/CellServDB \ --name sinenomine.net $ avdb list
Periodically scan the hosts to find versions with the ‘scan’ subcommand.:
$ avdb scan --nprocs 100 --verbose
Output the versions discovered the ‘report’ subcommand.:
$ avdb report --output /tmp/results --format html
Configuration
avdb command line option defaults may be set by an ini style configuration file. The site-wide configuation file is /etc/avdb.ini, and the per-user configuration file is located at $HOME/.avdb.ini. The per-user configuration file will override options present in the site-wide file, and command-line arguments will override the values in the configuration files.
The configuration file contains a global section for common options, which includes the sql url to specify the database connection and common logging options. There is are separate sections for each avdb subsections to specify default values for each subcommand. See the command line help for option names.
Example configuration file:
$ cat ~/.avdb.ini [global] url = sqlite:////var/lib/avdb/example.db log = /tmp/avdb.log [scan] nprocs = 10 [report] format = html output = /var/www/html/avdb.html
Using avdb in Python
In addition to the command line interface, the avdb module may be imported into Python programs. This allows the avdb subcommands to be invoked directly as regular Python functions. All of the subcommand functions have a single trailing underscore to avoid naming conflicts with standard python names. For example, function for the import subcommand is called import_.
The database connection url must be set once before calling avdb subcommand functions. Use the avdb.model.init_db() function to set the connection url.
The avdb config parser object, if needed, is available as avdb.subcmd.config.
Example:
import avdb url = avdb.subcmd.config.get('global', 'url') avdb.model.init_db(url) avdb.import_(name='sinenomine.net') avdb.scan_(nprocs=20) avdb.report_(format='html', output='myfile.html')
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file avdb-1.3.0.tar.gz
.
File metadata
- Download URL: avdb-1.3.0.tar.gz
- Upload date:
- Size: 12.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.7.1 importlib_metadata/4.8.2 pkginfo/1.8.2 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f12eac45ecde46e115b53b4a00cd356dca4b305b66ad3a8174875e04af404ba6 |
|
MD5 | f89d180822d7d6436e04fa069ad13602 |
|
BLAKE2b-256 | f6a162bb77d62970b75a55f8617e39d6111bb468ecd091f3c7d8315416076428 |
File details
Details for the file avdb-1.3.0-py3-none-any.whl
.
File metadata
- Download URL: avdb-1.3.0-py3-none-any.whl
- Upload date:
- Size: 14.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.7.1 importlib_metadata/4.8.2 pkginfo/1.8.2 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 227a38111e7ff16c60a19d0471eabc6782ed110e48c088f2942bd9670a2c60b8 |
|
MD5 | a4215a14c20babe441091d27cae996a7 |
|
BLAKE2b-256 | b57ecd72b8e95c9c3b5fe4256b0d6bf89857ce7adafe322eec5a183bae9e8f47 |