{"id":424,"date":"2020-08-04T09:01:43","date_gmt":"2020-08-04T09:01:43","guid":{"rendered":"https:\/\/silviamarin.ro\/?p=424"},"modified":"2020-08-04T09:01:43","modified_gmt":"2020-08-04T09:01:43","slug":"instalare-grafana","status":"publish","type":"post","link":"https:\/\/marinelvis.xyz\/index.php\/2020\/08\/04\/instalare-grafana\/","title":{"rendered":"INSTALARE GRAFANA"},"content":{"rendered":"<p>Ca root:<\/p>\n<pre>wget -q -O - https:\/\/packages.grafana.com\/gpg.key | apt-key add -\necho \"deb https:\/\/packages.grafana.com\/oss\/deb stable main\" | sudo tee \/etc\/apt\/sources.list\napt update\napt install -y grafana<\/pre>\n<p>Se activeaza serviciul <em>grafana-server<\/em>:<\/p>\n<pre>systemctl unmask grafana-server.service\nsystemctl enable grafana-server.service\nsystemctl start grafana-server<\/pre>\n<p><strong>Securizare Grafana<\/strong><br \/>\nSe activeaza urmatoarele module in Apache2:<\/p>\n<pre>a2enmod proxy\na2enmod proxy_http\na2enmod proxy_html\na2enmod headers\na2enmod rewrite<\/pre>\n<p>In <a href=\"https:\/\/freedns.afraid.org\/subdomain\/\"><em>https:\/\/freedns.afraid.org\/subdomain\/<\/em><\/a> se adauga subdomeniul <em>grafana.silviamarin.ro<\/em><\/p>\n<pre>mkdir -p \/var\/www\/<span style=\"color: #ff0000;\">silviamarin.ro<\/span>\/grafana \ncp \/var\/www\/html\/index.html \/var\/www\/<span style=\"color: #ff0000;\">silviamarin.ro<\/span>\/grafana \nchown -R www-data:www-data \/var\/www<\/pre>\n<p>Se genereaza fisierul de configurare <em>grafana.<span style=\"color: #ff0000;\">silviamarin.ro<\/span>.conf<\/em>:<\/p>\n<pre>nano \/etc\/apache2\/sites-available\/grafana.<span style=\"color: #ff0000;\">silviamarin.ro<\/span>.conf<\/pre>\n<p>si se introduce urmatorul continut (de preferat in Webmin):<\/p>\n<blockquote><p><em>&lt;VirtualHost *:80&gt;<\/em><br \/>\n<em>ServerName grafana.<span style=\"color: #ff0000;\">silviamarin.ro<\/span><\/em><br \/>\n<em>ServerAdmin spetru32@yahoo.com<\/em><br \/>\n<em>RewriteEngine On<\/em><br \/>\n<em>RewriteRule ^(.*)$ https:\/\/%{HTTP_HOST}$1 [redirect=301]<\/em><br \/>\n<em>&lt;\/VirtualHost&gt;<\/em><\/p>\n<p><em>&lt;IfModule mod_ssl.c&gt;<\/em><br \/>\n<em>&lt;VirtualHost *:443&gt;<\/em><br \/>\n<em>ServerName grafana.<span style=\"color: #ff0000;\">silviamarin.ro<\/span><\/em><br \/>\n<em>ServerAdmin spetru32@yahoo.com<\/em><br \/>\n<em># Use HTTP Strict Transport Security to force client to use secure connections only.<\/em><br \/>\n<em>Header always set Strict-Transport-Security &#8222;max-age=31536000; includeSubDomains; preload&#8221;<\/em><br \/>\n<em># Referer logging is used to allow websites and web servers to identify where people are visiting them from, for promotional or statistical purposes.<\/em><br \/>\n<em>Header always set Referrer-Policy &#8222;no-referrer&#8221; <\/em><\/p>\n<p><em>SSLCertificateFile \/etc\/letsencrypt\/live\/<span style=\"color: #ff0000;\">silviamarin.ro<\/span>\/fullchain.pem<\/em><br \/>\n<em>SSLCertificateKeyFile \/etc\/letsencrypt\/live\/<span style=\"color: #ff0000;\">silviamarin.ro<\/span>\/privkey.pem<\/em><\/p>\n<p><em>SSLEngine on<\/em><br \/>\n<em>SSLProtocol all -TLSv1 -TLSv1.1 -SSLv2 -SSLv3<\/em><br \/>\n<em>SSLHonorCipherOrder on<\/em><br \/>\n<em>SSLCompression off<\/em><br \/>\n<em>SSLOptions +StrictRequire<\/em><br \/>\n<em>SSLCipherSuite ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256<\/em><\/p>\n<p><em>ProxyPreserveHost On <\/em><br \/>\n<em>ProxyPass \/ http:\/\/127.0.0.1:3000\/<\/em><br \/>\n<em>ProxyPassReverse \/ http:\/\/127.0.0.1:3000\/<\/em><br \/>\n<em>&lt;\/VirtualHost&gt;<\/em><br \/>\n<em>&lt;\/IfModule&gt;<\/em><\/p><\/blockquote>\n<p>Se activeaza site-ul:<\/p>\n<pre>a2ensite grafana.<span style=\"color: #ff0000;\">silviamarin.ro<\/span>.conf\nsystemctl restart apache2.service<\/pre>\n<p>Accesul se face la adresa <em>https:\/\/grafana.<span style=\"color: #ff0000;\">silviamarin.ro <\/span><\/em>cu admin\/admin.<\/p>\n<p>Setari Grafana:<br \/>\nLa prima logare se solicita modificarea parolei. Apoi se selecteaza <strong>Configurations<\/strong>:<br \/>\nPreferences -&gt; Timezone -&gt; <em>Europe\/Bucharest<\/em><br \/>\nDatasource -&gt; Add Datasources -&gt; <em>InfluxDB<\/em><br \/>\nName: InfluxDB_ambiental<br \/>\nURL: <em>http:\/\/localhost:8086<\/em> (sau <em>http:\/\/marinmihai.go.ro:8086)<\/em><br \/>\ndatabase: <em>ambiental<\/em><br \/>\nUser: <em>elvis<\/em><br \/>\nPassword:<em> <span style=\"color: #ff0000;\">parola<\/span><\/em><br \/>\nSe salveaza si se testeaza baza de date. Similar se adauga si bazele de date <em>ambiental<\/em> si <em>telegraf<\/em><br \/>\nSe selecteaza <strong>Dashboard<\/strong> -&gt; Manage -&gt; Add dashboard -&gt; DORMITOR -&gt; Save<br \/>\nSe selecteaza <strong>Panel title<\/strong> -&gt; Edit<br \/>\nLa <em>Query 1<\/em> se selecteaza <em>InfluxDB_ambiental<\/em><br \/>\nLa A:<br \/>\nFROM -&gt; select measurement -&gt; DORMITOR<br \/>\nSELECT -&gt; field(value) -&gt; temperatura<br \/>\nGROUP BY -&gt; time(value) -&gt; 15 min<br \/>\nGROUP BY -&gt; fill -&gt;(linear)<br \/>\nALIAS BY -&gt; TEMPERATURA DORMITOR<br \/>\nSe poate adauga inca un grafic adaugand un nou query.<br \/>\nIn dreapta<br \/>\n<strong>Settings<\/strong><br \/>\nPanel -&gt; Panel title -&gt; TEMPERATURA<br \/>\n<strong>Visualization<\/strong> -&gt; Graph<br \/>\n<strong>Display<\/strong><br \/>\nLines -&gt; Activ<br \/>\nLine width -&gt; 2<br \/>\nArea fill -&gt; 3<br \/>\nFill gradient -&gt; 10<br \/>\n<strong>Axes<\/strong><br \/>\nLeft Y<br \/>\nShow -&gt; Activ<br \/>\n<strong>Legend<\/strong><br \/>\nValues<br \/>\nMin -&gt; Activ<br \/>\nMax -&gt; Activ<br \/>\nCurrent -&gt; Activ<br \/>\nSus se seteaza data de cand incepe graficul apoi Apply.<\/p>\n<p><strong>SQLite in Grafana<\/strong><\/p>\n<pre>grafana-cli plugins install frser-sqlite-datasource\nsystemctl stop grafana\nsystemctl start grafana\nsystemctl status grafana<\/pre>\n<p>In Grafana: <em>Configuration -&gt; Add datasource &#8211; SQLite<\/em><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Ca root: wget -q -O &#8211; https:\/\/packages.grafana.com\/gpg.key | apt-key add &#8211; echo &#8222;deb https:\/\/packages.grafana.com\/oss\/deb stable main&#8221; | sudo tee \/etc\/apt\/sources.list apt update apt install -y grafana Se activeaza serviciul grafana-server: systemctl unmask grafana-server.service systemctl enable grafana-server.service systemctl start grafana-server Securizare Grafana Se activeaza urmatoarele module in Apache2: a2enmod proxy a2enmod proxy_http a2enmod proxy_html a2enmod headers [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-424","post","type-post","status-publish","format-standard","hentry","category-fara-categorie"],"_links":{"self":[{"href":"https:\/\/marinelvis.xyz\/index.php\/wp-json\/wp\/v2\/posts\/424","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/marinelvis.xyz\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/marinelvis.xyz\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/marinelvis.xyz\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/marinelvis.xyz\/index.php\/wp-json\/wp\/v2\/comments?post=424"}],"version-history":[{"count":0,"href":"https:\/\/marinelvis.xyz\/index.php\/wp-json\/wp\/v2\/posts\/424\/revisions"}],"wp:attachment":[{"href":"https:\/\/marinelvis.xyz\/index.php\/wp-json\/wp\/v2\/media?parent=424"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/marinelvis.xyz\/index.php\/wp-json\/wp\/v2\/categories?post=424"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/marinelvis.xyz\/index.php\/wp-json\/wp\/v2\/tags?post=424"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}