In this post, I will show you how easy you can integrate Graphite with Icinga Web 2. I assume you have a Icinga 2 ready with Icinga Web 2 Server running, and you have an additional Linux Server where you will install Graphite. It’s recommended to have Graphite in a Linux box out of your Icinga Web 2 Server. This scenario was tested on two Linux Servers with Centos 7. Let’s rock:
On the Linux Box for installing Graphite, let’s update / upgrade our CentOS, then install epel-release repository, and ifinally install graphite and tools needed from epel-release repository:
You just installed Django's auth system, which means you don't have any superusers defined.
Would you like to create one now? (yes/no): yes <- HERE YOU NEED TO ANSWER YES
Username(leave blank to use 'root'): <- IT WILL TAKE USERNAME AUTOMATICALLY, FOLLOW INSTRUCTION
Email address: root@localhost <- YOU NEED TO SPECIFY EMAIL
Password: <- ADD A PASSWORD HERE
Password(again): <- CONFIRM PASSWORD AGAIN
Superuser created successfully.
Installing custom SQL ...
Installing indexes ...
Installed 0object(s) from 0fixture(s)
Creating tables ...
Creating table account_profile
Creating table account_variable
Creating table account_view
Creating table account_window
Creating table account_mygraph
Creating table dashboard_dashboard_owners
Creating table dashboard_dashboard
Creating table events_event
Creating table url_shortener_link
Creating table auth_permission
Creating table auth_group_permissions
Creating table auth_group
Creating table auth_user_groups
Creating table auth_user_user_permissions
Creating table auth_user
Creating table django_session
Creating table django_admin_log
Creating table django_content_type
Creating table tagging_tag
Creating table tagging_taggeditem
You just installed Django's auth system, which means you don't have any superusers defined.
Would you like to create one now? (yes/no): yes <- HERE YOU NEED TO ANSWER YES
Username (leave blank to use 'root'): <- IT WILL TAKE USERNAME AUTOMATICALLY, FOLLOW INSTRUCTION
Email address: root@localhost <- YOU NEED TO SPECIFY EMAIL
Password: <- ADD A PASSWORD HERE
Password (again): <- CONFIRM PASSWORD AGAIN
Superuser created successfully.
Installing custom SQL ...
Installing indexes ...
Installed 0 object(s) from 0 fixture(s)
Creating tables ...
Creating table account_profile
Creating table account_variable
Creating table account_view
Creating table account_window
Creating table account_mygraph
Creating table dashboard_dashboard_owners
Creating table dashboard_dashboard
Creating table events_event
Creating table url_shortener_link
Creating table auth_permission
Creating table auth_group_permissions
Creating table auth_group
Creating table auth_user_groups
Creating table auth_user_user_permissions
Creating table auth_user
Creating table django_session
Creating table django_admin_log
Creating table django_content_type
Creating table tagging_tag
Creating table tagging_taggeditem
You just installed Django's auth system, which means you don't have any superusers defined.
Would you like to create one now? (yes/no): yes <- HERE YOU NEED TO ANSWER YES
Username (leave blank to use 'root'): <- IT WILL TAKE USERNAME AUTOMATICALLY, FOLLOW INSTRUCTION
Email address: root@localhost <- YOU NEED TO SPECIFY EMAIL
Password: <- ADD A PASSWORD HERE
Password (again): <- CONFIRM PASSWORD AGAIN
Superuser created successfully.
Installing custom SQL ...
Installing indexes ...
Installed 0 object(s) from 0 fixture(s)
Now, we need start and enable some services, and change permission to graphite-web directory:
Note: checking out 'cb2a94397529f5a4b73d423fe89fabf2b0f064a6'.
You are in'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make inthis
state without impacting any branches by performing another checkout.
If you want to create a new branch to retain commits you create, you may
doso(now or later) by using -b with the checkout command again. Example:
git checkout -b new_branch_name
+ ICINGAWEB_MODULEPATH=/usr/share/icingaweb2/modules
+ REPO_URL=https://github.com/icinga/icingaweb2-module-graphite
+ TARGET_DIR=/usr/share/icingaweb2/modules/graphite
+ MODULE_VERSION=1.1.0
+ git clone https://github.com/icinga/icingaweb2-module-graphite /usr/share/icingaweb2/modules/graphite --branch v1.1.0
Cloning into '/usr/share/icingaweb2/modules/graphite'...
remote: Enumerating objects: 23, done.
remote: Counting objects: 100% (23/23), done.
remote: Compressing objects: 100% (21/21), done.
remote: Total 2772 (delta 5), reused 7 (delta 2), pack-reused 2749
Receiving objects: 100% (2772/2772), 834.80 KiB | 739.00 KiB/s, done.
Resolving deltas: 100% (1400/1400), done.
Note: checking out 'cb2a94397529f5a4b73d423fe89fabf2b0f064a6'.
You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by performing another checkout.
If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -b with the checkout command again. Example:
git checkout -b new_branch_name
+ ICINGAWEB_MODULEPATH=/usr/share/icingaweb2/modules
+ REPO_URL=https://github.com/icinga/icingaweb2-module-graphite
+ TARGET_DIR=/usr/share/icingaweb2/modules/graphite
+ MODULE_VERSION=1.1.0
+ git clone https://github.com/icinga/icingaweb2-module-graphite /usr/share/icingaweb2/modules/graphite --branch v1.1.0
Cloning into '/usr/share/icingaweb2/modules/graphite'...
remote: Enumerating objects: 23, done.
remote: Counting objects: 100% (23/23), done.
remote: Compressing objects: 100% (21/21), done.
remote: Total 2772 (delta 5), reused 7 (delta 2), pack-reused 2749
Receiving objects: 100% (2772/2772), 834.80 KiB | 739.00 KiB/s, done.
Resolving deltas: 100% (1400/1400), done.
Note: checking out 'cb2a94397529f5a4b73d423fe89fabf2b0f064a6'.
You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by performing another checkout.
If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -b with the checkout command again. Example:
git checkout -b new_branch_name
Now, let’s enable graphite module and restart icinga2 service:
Go to Icinga Web interface, then go to Configuration -> Modules -> graphite -> and then select Backend Tab, at the Graphite Web URL textbox, you need to put Graphite IP or Hostname and then click on Save Changes button.
Now, let’s come back to Graphite Server and let’s edit the file /etc/carbon/storage-schemas.conf, and you will have a content similar to this: