Statistics
| Branch: | Tag: | Revision:

root / README.md @ 6370fdfb

History | View | Annotate | Download (3 kB)

1 783328a9 Stauros Kroustouris
# MUPY
2 783328a9 Stauros Kroustouris
3 783328a9 Stauros Kroustouris
## What is Mupy?
4 9d3550f4 Leonidas Poulopoulos
5 9d3550f4 Leonidas Poulopoulos
Mupy is a Munin Python Parser. It is written in Python and is powered by Django framework.
6 9d3550f4 Leonidas Poulopoulos
Its functionality is pretty straightforward. It parses the HTML DOM of a munin site, stores the graphable
7 9d3550f4 Leonidas Poulopoulos
data into a db and provides a friendly user interface for retrieving munin graphs.
8 9d3550f4 Leonidas Poulopoulos
9 6370fdfb Stauros Kroustouris
### Features
10 6370fdfb Stauros Kroustouris
- parse multiple Munin instances
11 6370fdfb Stauros Kroustouris
- save a search and use it again later
12 6370fdfb Stauros Kroustouris
- set permissions, which hosts can be seen by a specific user.
13 6370fdfb Stauros Kroustouris
14 9d3550f4 Leonidas Poulopoulos
15 783328a9 Stauros Kroustouris
### Munin version compatibility
16 c1b38a6b Stauros Kroustouris
Mupy was built on Munin version 1.4.5, but is supports version 2 as well.
17 9d3550f4 Leonidas Poulopoulos
18 9d3550f4 Leonidas Poulopoulos
19 6370fdfb Stauros Kroustouris
## Installation
20 6370fdfb Stauros Kroustouris
21 783328a9 Stauros Kroustouris
### Installation Requirements
22 9d3550f4 Leonidas Poulopoulos
Mupy's installation and operation depends on the following modules/packages
23 9d3550f4 Leonidas Poulopoulos
24 c1b38a6b Stauros Kroustouris
* python-django (>=1.4.5)
25 9d3550f4 Leonidas Poulopoulos
* python-mysqldb
26 9d3550f4 Leonidas Poulopoulos
* python-ldap (if ldap user auth is needed)
27 73609e08 Stauros Kroustouris
* python-bs4 (won't work with <4)
28 9d3550f4 Leonidas Poulopoulos
* memcached
29 9d3550f4 Leonidas Poulopoulos
30 c1b38a6b Stauros Kroustouris
1. Untar the package (or clone via git) to your desired location, copy sample_local_settings.py to local_settings.py, apache/django.wsgi.dist to local files ommiting dist and edit loca_settings.py and apache/django.wsgi according to your needs. Pay special attention to:
31 783328a9 Stauros Kroustouris
	- `MUNIN_URL` : url that munin welcome page lives, eg. "http://munin.example.com"
32 783328a9 Stauros Kroustouris
	- `MUNIN_CGI_PATH` : if images are updated frequently (without the need to visit) then set the cgi path here, eg. "cgi-bin/munin-cgi-graph/"
33 c1b38a6b Stauros Kroustouris
34 9d3550f4 Leonidas Poulopoulos
2. To serve via Apache (static files),
35 c1b38a6b Stauros Kroustouris
create an alias for the static dir in your apache conf and a WSGI script alias eg.
36 9d3550f4 Leonidas Poulopoulos
37 783328a9 Stauros Kroustouris
		Alias /static       /<installation_location>/mupy/static
38 783328a9 Stauros Kroustouris
		WSGIScriptAlias /      /<installation_location>/mupy/apache/django.wsgi
39 9d3550f4 Leonidas Poulopoulos
40 6370fdfb Stauros Kroustouris
3. Copy `sample_local_settings.py` to `local_settings.py`
41 6370fdfb Stauros Kroustouris
4. Run `./manage.py syncdb --noinput`
42 6370fdfb Stauros Kroustouris
5. Run `./manage.py migrate`
43 6370fdfb Stauros Kroustouris
6. Run `./manage.py createsuperuser`
44 6370fdfb Stauros Kroustouris
7. Run `./manage.py collectstatic`
45 6370fdfb Stauros Kroustouris
8. Run `./manage.py parse_munin2` to parse the `MUNIN_URL` and store data into db. In case you have an older version of munin you have to run `./manage parse_munin`. A daily cronjob of this command is suggested.
46 6370fdfb Stauros Kroustouris
9. Restart Apache (or `touch apache/django.wsgi`) and enjoy
47 6370fdfb Stauros Kroustouris
48 6370fdfb Stauros Kroustouris
49 6370fdfb Stauros Kroustouris
## Documentation
50 6370fdfb Stauros Kroustouris
Here is a small description of the way that mupy should be used.
51 6370fdfb Stauros Kroustouris
The idea is to let each account monitor only some of the hosts.
52 6370fdfb Stauros Kroustouris
53 6370fdfb Stauros Kroustouris
### Settings
54 6370fdfb Stauros Kroustouris
The munin nodes are stored in the dictionary `MUNIN_NODES` in local_settings.py.
55 6370fdfb Stauros Kroustouris
Look at sample_local_settings for an example.
56 6370fdfb Stauros Kroustouris
57 6370fdfb Stauros Kroustouris
### Usage
58 6370fdfb Stauros Kroustouris
Whenever a user is created, the administrator (set in the `ADMIN` in
59 6370fdfb Stauros Kroustouris
local_settings), receives an email notification to go and chose which hosts can
60 6370fdfb Stauros Kroustouris
 be viewed by the new user. The new user cannot see any host by default.
61 6370fdfb Stauros Kroustouris
62 6370fdfb Stauros Kroustouris
#### Selecting which hosts can be viewed by users
63 6370fdfb Stauros Kroustouris
In the administration panel (`/admin/`), there is a link named `user profiles`
64 6370fdfb Stauros Kroustouris
under `Accounts` section. Select it, then select `add user profile`. There
65 6370fdfb Stauros Kroustouris
should be a select input with the names of the existing users (you can add a
66 6370fdfb Stauros Kroustouris
new one by clicking the `+` button). Then there is a multy-select box with host
67 6370fdfb Stauros Kroustouris
names. Move the nodes that the user will be able to see on the box below. Save
68 6370fdfb Stauros Kroustouris
the changes.