{"id":194,"date":"2021-03-22T10:28:44","date_gmt":"2021-03-22T17:28:44","guid":{"rendered":"https:\/\/my.apolonio.tech\/?p=194"},"modified":"2021-03-24T12:50:56","modified_gmt":"2021-03-24T19:50:56","slug":"grafana-nagios-and-stuff","status":"publish","type":"post","link":"https:\/\/my.apolonio.tech\/?p=194","title":{"rendered":"Grafana, Nagios and Stuff"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">In this article, I am going to walk through installing some monitoring software on a CentOS 7 box.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Start with the the base install of CentOS is described here<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><a href=\"https:\/\/my.apolonio.tech\/?p=78\">https:\/\/my.apolonio.tech\/?p=78<\/a> <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">but upgraded with yum update so you would end up with a CentOS 7.9.2009 &nbsp;instance.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">All commands are run with a user that has sudo permissions unless otherwise noted.<\/p>\n\n\n\n<h1 class=\"wp-block-heading\">Install Grafana<\/h1>\n\n\n\n<p class=\"wp-block-paragraph\">Add the Grafana repo in to your yum repo list<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code>cd \/etc\/yum.repos.d<\/code><br><code>sudo wget <a href=\"https:\/\/my.apolonio.tech\/linux\/grafana.repo\">https:\/\/my.apolonio.tech\/linux\/grafana.repo<\/a><\/code><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Install it<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code>sudo yum -y install grafana<\/code><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Enable it and start it up, this will make it available on reboot<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code>sudo systemctl enable --now grafana-server<\/code><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">At this point you should be able to log in to Grafana with a web browser using port 3000<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><a href=\"http:\/\/grafana.makernet.local:3000\/login\">http:\/\/grafana.makernet.local:3000\/login<\/a><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Username: admin Password: admin<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">You will be prompted to change it.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Note: If you ever forget the admin password for Grafana use the following command to reset the password to newpassword<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code>grafana-cli admin reset-admin-password newpassword<\/code><\/p>\n\n\n\n<h1 class=\"wp-block-heading\">Install InfluxDB<\/h1>\n\n\n\n<p class=\"wp-block-paragraph\">Add the InfluxDB repo to your yum repo list<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code>cd \/etc\/yum.repos.d<br>sudo wget <a href=\"https:\/\/my.apolonio.tech\/linux\/influxdb.repo\">https:\/\/my.apolonio.tech\/linux\/influxdb.repo<\/a><\/code><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Install it<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code>sudo yum install influxdb<\/code><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Start it up<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code>sudo systemctl enable --now influxdb<\/code><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Next run the influx command<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code>influx<\/code><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">And create a the telegraf database with the appropriate usernames, passwords, and permissions<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code>CREATE DATABASE \"telegraf\"<br>CREATE USER \"admin\" WITH PASSWORD 'supersecretpassword'<br>CREATE USER \"telegraf\" WITH PASSWORD 'secretpassword'<br>GRANT ALL ON \"telegraf\" TO \"admin\"<br>GRANT READ ON \"telegraf\" TO \"telegraf\"<br>GRANT WRITE ON \"telegraf\" TO \"telegraf\"<\/code><br><code>EXIT<\/code><\/p>\n\n\n\n<h1 class=\"wp-block-heading\">Install Prometheus<\/h1>\n\n\n\n<p class=\"wp-block-paragraph\">Go to your home directory and download the Prometheus package.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code>cd<br>wget <a href=\"https:\/\/github.com\/prometheus\/prometheus\/releases\/download\/v2.22.1\/prometheus-2.22.1.linux-amd64.tar.gz\">https:\/\/github.com\/prometheus\/prometheus\/releases\/download\/v2.22.1\/prometheus-2.22.1.linux-amd64.tar.gz<\/a><\/code><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Go to opt and unroll the package, rename to prometheus<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code>cd \/opt<br>sudo tar zxpvf ~\/prometheus-2.22.1.linux-amd64.tar.gz<br>sudo mv prometheus-2.22.1.linux-amd64 prometheus<\/code><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Create a user account for Prometheus to run as and give it ownership of the Prometheus install<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code>sudo mkdir -p \/opt\/prometheus\/var\/lib\/<br>sudo useradd -rs \/bin\/false prometheus<br>sudo chown -R prometheus:prometheus \/opt\/prometheus<\/code><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Create a system service<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code>sudo vi \/etc\/systemd\/system\/prometheus.service<\/code><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">With the following contents<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code>[Unit]<br>Description=Prometheus<br>After=network.target<br><\/code><br><code>[Service]<br>User=prometheus<br>Group=prometheus<br>Type=simple<br>ExecStart=\/opt\/prometheus\/prometheus \\<br>&nbsp;&nbsp;&nbsp; --config.file \/opt\/prometheus\/prometheus.yml \\<br>&nbsp;&nbsp;&nbsp; --storage.tsdb.path \/opt\/prometheus\/var\/lib\/ \\<br>&nbsp;&nbsp;&nbsp; --web.console.templates=\/opt\/prometheus\/console \\<br>&nbsp;&nbsp;&nbsp; --web.console.libraries=\/opt\/prometheus\/console_libraries<\/code><br><code><br>[Install]<br>WantedBy=multi-user.target<\/code><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">And reload the daemon, enable and start Prometheus<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code>sudo systemctl daemon-reload<br>sudo systemctl enable --now prometheus<\/code><\/p>\n\n\n\n<h1 class=\"wp-block-heading\">Install Loki<\/h1>\n\n\n\n<p class=\"wp-block-paragraph\">Go back to your home directory and download the Loki package<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code>cd<br>wget <a href=\"https:\/\/github.com\/grafana\/loki\/releases\/download\/v1.6.1\/loki-linux-amd64.zip\">https:\/\/github.com\/grafana\/loki\/releases\/download\/v1.6.1\/loki-linux-amd64.zip<\/a><\/code><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Go to opt, create the loki folder and unzip the package in to it<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code>sudo mkdir -p \/opt\/loki<br>cd \/opt\/loki<br>sudo unzip ~\/loki-linux-amd64.zip<\/code><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">While you are in the \/opt\/loki folder, create a loki config file<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code>sudo vi \/opt\/loki\/config-loki.yml<\/code>&nbsp;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">With the following<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code>auth_enabled: false<\/code><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code>server:<br>&nbsp; http_listen_port: 3100<\/code><br><code><br>ingester:<br>&nbsp; lifecycler:<br>&nbsp;&nbsp;&nbsp; address: 127.0.0.1<br>&nbsp;&nbsp;&nbsp; ring:<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; kvstore:<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; store: inmemory<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; replication_factor: 1<br>&nbsp;&nbsp;&nbsp; final_sleep: 0s<br>&nbsp; chunk_idle_period: 5m<br>&nbsp; chunk_retain_period: 30s<br>&nbsp; max_transfer_retries: 0<\/code><br><code><br>schema_config:<br>&nbsp; configs:<br>&nbsp;&nbsp;&nbsp; - from: 2018-04-15<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; store: boltdb<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; object_store: filesystem<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; schema: v11<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; index:<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; prefix: index_<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; period: 168h<\/code><br><code><br>storage_config:<br>&nbsp; boltdb:<br>&nbsp;&nbsp;&nbsp; directory: \/tmp\/loki\/index<\/code><br><code><br>&nbsp; filesystem:<br>&nbsp;&nbsp;&nbsp; directory: \/tmp\/loki\/chunks<\/code><br><code><br>limits_config:<br>&nbsp; enforce_metric_name: false<br>&nbsp; reject_old_samples: true<br>&nbsp; reject_old_samples_max_age: 168h<\/code><br><code><br>chunk_store_config:<br>&nbsp; max_look_back_period: 0s<\/code><br><code><br>table_manager:<br>&nbsp; retention_deletes_enabled: false<br>&nbsp; retention_period: 0s<\/code><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Create a user account for loki and give it ownership of the loki directory<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code>sudo useradd -rs \/bin\/false loki<br>sudo chown -R loki.loki \/opt\/loki<\/code><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Create a systemd service<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code>sudo vi \/etc\/systemd\/system\/loki.service<\/code><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">With the following content<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code>[Unit]<br>Description=Loki service<br>After=network.target<\/code><br><code><br>[Service]<br>Type=simple<br>User=loki<br>Group=loki<br>ExecStart=\/opt\/loki\/loki-linux-amd64 -config.file \/opt\/loki\/config-loki.yml<\/code><br><code><br>[Install]<br>WantedBy=multi-user.target<\/code><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><br>And reload the daemon, enable and start Prometheus<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code>sudo systemctl daemon-reload<br>sudo systemctl enable --now loki<\/code><\/p>\n\n\n\n<h1 class=\"wp-block-heading\">Install Nagios<\/h1>\n\n\n\n<p class=\"wp-block-paragraph\">Nagios is in the epel repo, install the repo first then install nagios and plugins<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code>sudo yum -y install epel-release<br>sudo yum -y install nagios nagios-plugins-all<\/code><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Nagios uses basic auth for authentication, create password file and users, the first command creates the password file and adds the user larry, the second, simply adds the user standard to that same file.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code>sudo htpasswd -c \/etc\/nagios\/passwd larry<br>sudo htpasswd \/etc\/nagios\/passwd <\/code>standard<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Create a file in the root of web server so there are no errors then restart apache<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code>sudo touch \/var\/www\/html\/index.html<br>sudo systemctl restart httpd<\/code><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Add the users as contacts in the contacts&nbsp; file<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code>sudo vi \/etc\/nagios\/objects\/contacts.cfg<\/code><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Here is a sample of how the users look<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code>define contact {<br>&nbsp;&nbsp;&nbsp; contact_name&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; larry&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br>&nbsp;&nbsp;&nbsp; use&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; generic-contact&nbsp;&nbsp;<br>&nbsp;&nbsp;&nbsp; alias&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Larry Apolonio&nbsp;&nbsp;&nbsp;<br>&nbsp;&nbsp;&nbsp; email&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; larry@makernet.local<br>}<\/code><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code>define contact {<br>&nbsp;&nbsp;&nbsp; contact_name&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; standard<br>&nbsp;&nbsp;&nbsp; use&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; generic-contact&nbsp;&nbsp;<br>&nbsp;&nbsp;&nbsp; alias&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Standard Account&nbsp;&nbsp;&nbsp;<br>&nbsp;&nbsp;&nbsp; email&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; standard@makernet.local<br>}<\/code><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Then add modify the group to add new users as administrators<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code>define contactgroup {<br>&nbsp;&nbsp;&nbsp; contactgroup_name&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; admins<br>&nbsp;&nbsp;&nbsp; alias&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Nagios Administrators<br>&nbsp;&nbsp;&nbsp; members&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; nagiosadmin,larry,standard<br>}<\/code><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Verify that the nagios config file is correct, you should always verify after you make some configuration changes.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code>sudo nagios -v \/etc\/nagios\/nagios.cfg<\/code><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Enable nagios and start the daemon<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code>sudo systemctl enable --now nagios<\/code><\/p>\n\n\n\n<h1 class=\"wp-block-heading\">Validation<\/h1>\n\n\n\n<p class=\"wp-block-paragraph\">At this point run the following commands to check if all the services are running correctly<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code>sudo systemctl status nagios<br>sudo systemctl status loki<br>sudo systemctl status influxdb<br>sudo systemctl status prometheus<br>sudo systemctl status grafana-server<br>sudo systemctl status httpd<\/code><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Furthermore use a browser to check that these services are OK<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Grafana <a href=\"http:\/\/grafana.makernet.local:3000\">http:\/\/grafana.makernet.local:3000<\/a><\/li><li>Prometheus <a href=\"http:\/\/grafana.makernet.local:9090\">http:\/\/grafana.makernet.local:9090<\/a><\/li><li>Nagios <a href=\"http:\/\/grafana.makernet.local\/nagios\">http:\/\/grafana.makernet.local\/nagios<\/a><\/li><\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">The following two services should give you a 404 error which is OK, it means something is reponding on those ports, it is a problem if you get The site can\u2019t be reached and\/or refused to connect.<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Loki <a href=\"http:\/\/grafana.makernet.local:3100\">http:\/\/grafana.makernet.local:3100<\/a><\/li><li>InfluxDB <a href=\"http:\/\/grafana.makernet.local:8086\">http:\/\/grafana.makernet.local:8086<\/a><\/li><\/ul>\n\n\n\n<h1 class=\"wp-block-heading\">Protect Service with SSL<\/h1>\n\n\n\n<p class=\"wp-block-paragraph\">It is highly recommended you protect your services with SSL\/TLS encryption.&nbsp; Since there are a variety of ways that an SSL certificate gets created, the steps in creating a certificate and key pair will not be outlined here.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">It is assumed the reader know about certificates and keys and if there is an intermediate, how to add them as a chain file or combine them.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Certs here are PEM encoded and the examples used do not have an intermediate.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Apache<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Apache is the web server used by nagios and will serve as a proxy for loki and Prometheus.&nbsp; So make sure mod ssl is installed, and the auto generated cert and keys are replaced with signed ones.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code>sudo yum -y install mod_ssl<\/code><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Use cat to paste the cert and keys in to the locations below, or scp\/sftp to those locations.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code>sudo su -<br>cat &gt; \/etc\/pki\/tls\/certs\/localhost.crt<br>cat &gt; \/etc\/pki\/tls\/private\/localhost.key<br>exit<\/code><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Copy the certs the locations used by Grafana and influxdb which will use the cert and keys directly<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code>sudo cp -p \/etc\/pki\/tls\/certs\/localhost.crt \/etc\/grafana\/server.crt<br>sudo cp -p \/etc\/pki\/tls\/private\/localhost.key \/etc\/grafana\/server.key<br>sudo chown grafana:root \/etc\/grafana\/server.crt<br>sudo chown grafana:root \/etc\/grafana\/server.key<br>sudo cp -p \/etc\/pki\/tls\/certs\/localhost.crt \/etc\/influxdb\/server.crt<br>sudo cp -p \/etc\/pki\/tls\/private\/localhost.key \/etc\/influxdb\/server.key<br>sudo chown influxdb:root \/etc\/influxdb\/server.crt<br>sudo chown influxdb:root \/etc\/influxdb\/server.key<\/code><\/p>\n\n\n\n<h1 class=\"wp-block-heading\">Grafana<\/h1>\n\n\n\n<p class=\"wp-block-paragraph\">Edit the Grafana config file<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code>sudo vi \/etc\/grafana\/grafana.ini<\/code><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Look for the server section, change the protocol to https and point the cert_file and cert_key parameters to the appropriate location<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code>[server]<br># Protocol (http, https, h2, socket)<br>protocol = https<br>cert_file = \/etc\/grafana\/server.crt<br>cert_key = \/etc\/grafana\/server.key<\/code><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Restart Grafana<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code>sudo systemctl restart grafana-server<\/code><\/p>\n\n\n\n<h1 class=\"wp-block-heading\">InfluxDB<\/h1>\n\n\n\n<p class=\"wp-block-paragraph\">Edit the InfluxDB File<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code>sudo vi \/etc\/influxdb\/influxdb.conf<\/code><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">In the http section, enable https and point to the appropriate cert and key files<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code>[http]<br>&nbsp; https-enabled = true<br>&nbsp; https-certificate = \"\/etc\/influxdb\/server.crt\"<br>&nbsp; https-private-key = \"\/etc\/influxdb\/server.key\"<\/code><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Restart InfluxDB<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code>sudo systemctl restart influxdb<\/code><\/p>\n\n\n\n<h1 class=\"wp-block-heading\">Nagios<\/h1>\n\n\n\n<p class=\"wp-block-paragraph\"><code>sudo vi \/etc\/httpd\/conf.d\/nagios.conf<\/code><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">uncomment out the SSLRequireSSL (Remove the # from 2 locations)<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Restart the web service<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code>sudo systemctl restart httpd<\/code><\/p>\n\n\n\n<h1 class=\"wp-block-heading\">Prometheus<\/h1>\n\n\n\n<p class=\"wp-block-paragraph\">Create a Prometheus apache config file<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code>sudo vi \/etc\/httpd\/conf.d\/prometheus.conf<\/code><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Here are the contents<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code>Listen 9443<br>NameVirtualHost *:9443<br>&lt;VirtualHost *:9443&gt;<br>&nbsp;&nbsp;&nbsp; SSLEngine on<br>&nbsp;&nbsp;&nbsp; SSLProxyEngine On<br>&nbsp;&nbsp;&nbsp; ProxyRequests Off<br>&nbsp;&nbsp;&nbsp; ProxyPreserveHost On<br>&nbsp;&nbsp;&nbsp; SSLCertificateFile \/etc\/pki\/tls\/certs\/localhost.crt<br>&nbsp;&nbsp;&nbsp; SSLCertificateKeyFile \/etc\/pki\/tls\/private\/localhost.key<br>&nbsp;&nbsp;&nbsp; ProxyPass \/ http:\/\/grafana.makernet.local:9090\/<br>&nbsp;&nbsp;&nbsp; ProxyPassReverse \/ http:\/\/grafana.makernet.local:9090\/<br>&lt;\/VirtualHost&gt;<\/code><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Restart the web service<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code>sudo systemctl restart httpd<\/code><\/p>\n\n\n\n<h1 class=\"wp-block-heading\">Loki<\/h1>\n\n\n\n<p class=\"wp-block-paragraph\">Create a loki apache config file<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code>sudo vi \/etc\/httpd\/conf.d\/loki.conf<\/code><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Here are the contents<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code>Listen 9100<br>NameVirtualHost *:9100<br>&lt;VirtualHost *:9100&gt;<br>&nbsp;&nbsp;&nbsp; SSLEngine on<br>&nbsp;&nbsp;&nbsp; SSLProxyEngine On<br>&nbsp;&nbsp;&nbsp; ProxyRequests Off<br>&nbsp;&nbsp;&nbsp; ProxyPreserveHost On<br>&nbsp;&nbsp;&nbsp; SSLCertificateFile \/etc\/pki\/tls\/certs\/localhost.crt<br>&nbsp;&nbsp;&nbsp; SSLCertificateKeyFile \/etc\/pki\/tls\/private\/localhost.key<br>&nbsp;&nbsp;&nbsp; ProxyPass \/ http:\/\/localhost:3100\/<br>&nbsp;&nbsp;&nbsp; ProxyPassReverse \/ http:\/\/localhost:3100\/<br>&lt;\/VirtualHost&gt;<\/code><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Restart the web service<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code>sudo systemctl restart httpd<\/code><\/p>\n\n\n\n<h1 class=\"wp-block-heading\">SSL Validation<\/h1>\n\n\n\n<p class=\"wp-block-paragraph\">Here are example URLs to test<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Loki <a href=\"https:\/\/grafana.makernet.local:9100\">https:\/\/grafana.makernet.local:9100<\/a><\/li><li>Prometheus <a href=\"https:\/\/grafana.makernet.local:9443\">https:\/\/grafana.makernet.local:9443<\/a><\/li><li>InfluxDB <a href=\"https:\/\/grafana.makernet.local:8086\">https:\/\/grafana.makernet.local:8086<\/a><\/li><li>Grafana <a href=\"https:\/\/grafana.makernet.local:3000\">https:\/\/grafana.makernet.local:3000<\/a><\/li><li>Nagios <a href=\"https:\/\/grafana.makernet.local\/nagios\">https:\/\/grafana.makernet.local\/nagios<\/a><\/li><\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">Note that the unencrypted ports for Loki and Prometheus are still accessible.&nbsp; You can either block those ports with firewalld or change the config to only listen to localhost<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this article, I am going to walk through installing some monitoring software on a CentOS 7 box. Start with the the base install of CentOS is described here https:\/\/my.apolonio.tech\/?p=78 but upgraded with yum&#46;&#46;&#46;<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_crdt_document":"","footnotes":""},"categories":[6],"tags":[],"class_list":["post-194","post","type-post","status-publish","format-standard","hentry","category-linux-server"],"_links":{"self":[{"href":"https:\/\/my.apolonio.tech\/index.php?rest_route=\/wp\/v2\/posts\/194","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/my.apolonio.tech\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/my.apolonio.tech\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/my.apolonio.tech\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/my.apolonio.tech\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=194"}],"version-history":[{"count":3,"href":"https:\/\/my.apolonio.tech\/index.php?rest_route=\/wp\/v2\/posts\/194\/revisions"}],"predecessor-version":[{"id":197,"href":"https:\/\/my.apolonio.tech\/index.php?rest_route=\/wp\/v2\/posts\/194\/revisions\/197"}],"wp:attachment":[{"href":"https:\/\/my.apolonio.tech\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=194"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/my.apolonio.tech\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=194"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/my.apolonio.tech\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=194"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}