Statistics
| Branch: | Tag: | Revision:

root / README.md @ 96f19857

History | View | Annotate | Download (4.6 kB)

1
# MUPY
2

    
3
<img src="https://github.com/grnet/mupy/blob/master/mupy/static/images/mupy_logo.png" alt="MuPy">
4

    
5
## What is Mupy?
6

    
7
Mupy is a Munin Python Parser. It is written in Python and is powered by Django framework.
8
Its functionality is pretty straightforward. It parses the HTML DOM of a munin site, stores the graphable
9
data into a db and provides a friendly user interface for retrieving munin graphs.
10

    
11
### Features
12
- parse multiple Munin instances
13
- save a search and use it again later
14
- set permissions, which hosts can be seen by a specific user.
15
- set read only users who can only see assigned searches to them.
16

    
17

    
18
### Munin version compatibility
19
Mupy was built on Munin version 1.4.5, but is supports version 2 as well.
20

    
21

    
22
## Installation
23

    
24
### Installation Requirements
25
Mupy's installation and operation depends on the following modules/packages
26

    
27
* python-django (=1.4.5)
28
* python-mysqldb
29
* python-requests
30
* python-ldap (if ldap user auth is needed)
31
* django_auth_ldap
32
* python-bs4 (won't work with <4)
33
* memcached
34
* python-django-south
35

    
36
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:
37
	- `MUNIN_URL` : url that munin welcome page lives, eg. "http://munin.example.com"
38
	- `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/"
39

    
40
2. To serve via Apache (static files),
41
create an alias for the static dir in your apache conf and a WSGI script alias eg.
42

    
43
		Alias /static       /<installation_location>/mupy/static
44
		WSGIScriptAlias /      /<installation_location>/mupy/apache/django.wsgi
45

    
46
3. Copy `sample_local_settings.py` to `local_settings.py`
47
4. Run `./manage.py syncdb --noinput`
48
5. Run `./manage.py migrate`
49
6. Run `./manage.py createsuperuser`
50
7. Run `./manage.py collectstatic`
51
8. Add the nodes you need to parse. See Adding Nodes.
52
9. Run `./manage.py parse_munin` to parse the `MUNIN_URL` and store data into db. A daily cronjob of this command is suggested.
53
10. Restart Apache (or `touch apache/django.wsgi`) and enjoy
54

    
55

    
56
## Documentation
57
Here is a small description of the way that mupy should be used.
58
The idea is to let each account monitor only some of the hosts.
59

    
60
### Adding Nodes
61
The munin nodes are stored in the dictionary `MUNIN_NODES` in local_settings.py.
62
Look at sample_local_settings for an example. If a node is older than v2 an extra
63
attribute must be set, `version`. Nodes can also be added through the admin interface.
64

    
65
#### htaccess
66
If a node is under htaccess, then the `MUNIN_URL` one should set, must have the following form:
67
`https://username:password@munin.node.org/`.
68

    
69
### Usage
70
Whenever a user is created, the administrator (set in the `ADMIN` in
71
local_settings), receives an email notification to go and chose which hosts can
72
 be viewed by the new user. The new user cannot see any host by default.
73

    
74
#### Read only users
75
A user is read only by default. An admin can assign to him nodes and saved searches to watch through the admin interface.
76

    
77
#### Limits
78
If a user is assigned more than 1000 graphs then, mupy will be sloppy and irritating to use.
79
So assigning too many graphs to a user is strongly discouraged.
80

    
81
#### Searches
82
After making a search, one can save it by clicking the save button on the menu.
83
Then the search will appear in the searches section of the menu.
84

    
85
A user can also select a default search, which will appear after the next login
86
on the initial page.
87

    
88
A search can be deleted by clicking the X button on its right, on the saved searches menu.
89

    
90

    
91
### Attention - Notes
92
- If using sqlite3, migrations dont work, some changes must be made manually.
93

    
94
- If using ldap without groups, all new users are marked as inactive by default. This will change in future releases.
95

    
96
#### Selecting which hosts can be viewed by users
97
In the administration panel (`/admin/`), there is a link named `user profiles`
98
under `Accounts` section. Select it, then select `add user profile`. There
99
should be a select input with the names of the existing users (you can add a
100
new one by clicking the `+` button). Then there is a multy-select box with host
101
names. Move the nodes that the user will be able to see on the box below. Save
102
the changes.
103

    
104
### Screenshot
105

    
106
<img src="https://github.com/grnet/mupy/blob/master/mupy/static/images/mupy-screenshot.png" alt="MuPy">
107

    
108
## Demo
109
Feel free to play with the [demo](http://mupy-demo.grnet.gr/ "Mupy Demo") we have set up at `http://mupy-demo.grnet.gr`.
110
It parses `http://demo.munin-monitoring.org`.
111