Hi,
Netdata is awesome, and I think it's a nice add-on for OMV.
I'm able to get Netdata running on Nginx.
If I'm write out the steps, will anybody in here want to write a script or a plugin for the community?
http://netdata.firehol.org/
--------------------------------------------------------------------------------------------------------------------------
Before installing Netdata, please backup your OMV!
Note: I assume you're login as 'root', if you feel uncomfortable with root, then you can create a user call 'netdata', and do some adjustment on your own accordingly.
Part 1:
1. Install the following libraries:
apt-get install zlib1g-dev uuid-dev libmnl-dev gcc make git autoconf autogen automake pkg-config
apt-get install curl jq nodejs
2. Go to /opt/ dir
cd /opt/
3. Download Netdata: git clone https://github.com/firehol/netdata.git --depth=1
4. ./netdata-installer.sh
Press 'Enter' key when it prompts to start the installation.
5.
For OMV2:
# copy the netdata startup file to /etc/init.d
cp system/netdata-lsb /etc/init.d/netdata
# make sure it is executable
chmod +x /etc/init.d/netdata
# enable it
update-rc.d netdata defaults
add this /usr/sbin/netdata to your /etc/rc.local for auto startup when OMV boot.
For OMV3:
# stop netdata
killall netdata
# copy netdata.service to systemd
cp system/netdata.service /etc/systemd/system/
# let systemd know there is a new service
systemctl daemon-reload
# enable netdata at boot
systemctl enable netdata
# start netdata
service netdata start
6. Double check your above settings..
7. cd /etc/nginx/sites-enabled/
8. create a file name 'netdata': nano netdata
note: ensure its ownership is root:www-data
9. copy & paste the following into 'netdata' file:
10. Assume you already have a domain name, if not, sign up for a free one such as No-IP or Dyn.
Otherwise, you would use your WAN IP in Part 2.
11. Example: http://akuma.win.com:7443
Port forwarding your 7443 in your router.
12. You can try out your Netdata before proceed further; start your Netdata.
/usr/sbin/netdata
13. Enter this into your browser: i.e: http://localhost:19999 or your OMV IP http://192.168.1.10:19999
14. At this moment, your Netdata is running alone without Nginx.
15. You can stop/start Netdata anytime you want.
Part 2:
1. Create a SSL certificate for Netdata if you don't have one, or use your existing one such as Let's Encrypt.
2. This is optional. If you want to create an authentication for your Netdata site, then do continue, else skip this.
3. create a username and a password for your file call '.httpasswd':
sudo htpasswd /etc/nginx/.htpasswd username password
i.e. username: akuma
password: hadouken!
sudo htpasswd /etc/nginx/.htpasswd akuma hadouken!
Note: the password is encrypted in the file.
If you wish to use your existence/current user, then add the -c parameter.
sudo htpasswd -c /etc/nginx/.htpasswd akuma hadouken!
4. chown www-data:www-data .htpasswd
Write down your username & password.
5. Create a Netdata server in Nginx.
Change the server_name to your hostname and paste the following codes in:
With authentication:
server_name akuma.win.com;
auth_basic "Protected";
auth_basic_user_file /etc/nginx/.htpasswd;
location / {
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Server $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://netdata;
proxy_redirect http://127.0.0.1:19999/ https://$server_name/;
proxy_http_version 1.1;
proxy_pass_request_headers on;
keepalive 64;
proxy_set_header Connection "keep-alive";
proxy_store off;
}
Without authentication:
server_name akuma.win.com;
location / {proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Server $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://netdata;
proxy_redirect http://127.0.0.1:19999/ https://$server_name/;
proxy_http_version 1.1;proxy_pass_request_headers on;
keepalive 64;
proxy_set_header Connection "keep-alive";
proxy_store off;
6. stop netdata: killall netdata
7. restart Nginx service: service nginx restart
8. Restart your Netdata: /usr/sbin/netdata
9. Login to your Netdata via domain or localIP with your credentials: i.e: https://akuma.win.com:7443
10. You can change your Netdata server hostname in the /etc/netdata/netdata.conf
Un-comment hostname in the [global] section, and enter the new name.
11. Reboot your OMV, and you should see your Netdata and other services are started properly.
12. prevent the double access.log
nano /etc/netdata/netdata.conf
==============================================================================================================================================
Any time , you want to update Netdata, run the following commands: