Nagios Core 4 on CentOS 7: Part 3 – Installation and Configuration of Grafana over HTTPS

Install Dependencies.

yum install initscripts fontconfig freetype* urw-fonts -y

Download or FTP, then install Grafana. (I used grafana-5.0.3-1.x86_64.rpm.)

cd ~
yum install grafana-5.0.3-1.x86_64.rpm –y

Start the Grafana Server and configure the service.

sudo service grafana-server start
sudo /sbin/chkconfig --add grafana-server
systemctl daemon-reload
systemctl start grafana-server
systemctl status grafana-server
systemctl enable grafana-server.service

Add firewall rule and restart the service.

firewall-cmd --zone=public --add-port=3000/tcp –permanent
service firewalld restart

Create a Grafana certificate.

cd /etc/grafana/
sudo openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout grafana.key -out grafana.crt

Modify the Grafana Config file to set HTTPS as the standard.

vi grafana.ini

Press the I key to begin editing, remove the “;” comment characters and update the protocol and cert information as seen in the two pieces below.

[server]
# Protocol (http, https, socket)
protocol = https
# https certs & key file
cert_file = /etc/grafana/grafana.crt
cert_key = /etc/grafana/grafana.key

Press the Escape key and then type “:wq!” without the quotes to save and exit.

:wq!

Restart the Grafana Service and the web service.

service grafana-server restart
service httpd restart

Navigate to the Grafana web interface.

https://serverip:3000/

If this worked, you’ve successfully installed Grafana and can start configuring the rest.

Now, we’ll remove the Grafana installer.

cd ~
rm -rf grafana-5.0.3-1.x86_64.rpm

This post is only one part of a series of Nagios documentation I am be preparing.

Nagios Core 4 on CentOS 7: Part 1 – Installation

Nagios Core 4 on CentOS 7: Part 2 – Installation and Configuration of PNP4Nagios

Nagios Core 4 on CentOS 7: Part 3 – Installation and Configuration of Grafana over HTTPS

Nagios Core 4 on CentOS 7: Part 4 – Installation of V-Shell 2