Graphite user creation

Graphite is a powerful graphing tool. It allow you to graph anything fast and applying lots of functions so you can have the data exactly as you want. All graph configuration parameters (data to show, dimensions of the graph, legend, functions, etc) are in the URL itself, so if we want to share a particular graph, we just need to share the URL. But graphite has a way to store the graphs and keep them close at “My Graphs” or “User Graphs”, pretty handy. To store the graphs first we need to authenticate (graphs must be assigned to someone!) and, obviously, to authenticate we need to have a user. And in the previous post explaining how to install graphite, that wasn’t explained.

Users, graphs and dashboards are stored in the file /opt/graphite/storage/graphite.db, which is a sqlite database. We can look at the contents (sqlclent3 required!):

$ cd /opt/graphite/webapp/graphite
$ python manage.py dbshell
Error: You appear not to have the 'sqlite3' program installed or on your path.
$ sudo apt-get install sqlite3
(...)
Processing triggers for man-db ...
Setting up sqlite3 (3.7.3-1) ...
$ python manage.py dbshell
SQLite version 3.7.3
Enter ".help" for instructions
Enter SQL statements terminated with a ";"
sqlite> .databases
seq name file
--- --------------- ----------------------------------------------------------
0 main /opt/graphite/storage/graphite.db
sqlite> .table
account_mygraph auth_user_groups
account_profile auth_user_user_permissions
account_variable dashboard_dashboard
account_view dashboard_dashboard_owners
account_window django_admin_log
auth_group django_content_type
auth_group_permissions django_session
auth_message events_event
auth_permission tagging_tag
auth_user tagging_taggeditem
sqlite> ^D
$

We will not modify this data ourselves (that would require us to understand exactly what that means, and I’m not in the mood right now :P), because we will do that through graphite (technically, through its framework, django). First of all we need a superuser, which we create from the command line:


$ cd /opt/graphite/webapp/graphite
$ python manage.py createsuperuser
Username: tomas
E-mail address: [email protected]
Password: xxxxxx
Password (again): xxxxxx
Superuser created successfully.
$

Now we can login with this user and pass in the login at te top of the page.

Fer login al graphite

Once authenticated, we can go to the admin interface in “/admin/“, as in http://your-graphite-server.tld/admin/, and here we can add all the users we want.

Panel d'administracio django a graphite

Tomàs

Tomàs

I'll make something up