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