VictorRobellini / pfSense-Dashboard

A functional and useful dashboard for pfSense that utilizes influxdb, grafana and telegraf
669 stars 184 forks source link

Installation / Upgrade #38

Closed wrightsonm closed 2 years ago

wrightsonm commented 3 years ago

I've been thinking about how to make it easier to install updates to plugins.

Whilst this is not a script at this time, it might be a starting point, or an improvement to the instructions on the readme. One of the main problems is CRLF vs \n Windows v linux. This is how I have avoided it:

Assumption 1. pfsense firewall does not and should not have git installed. Assumption 2. plugins are placed in a separate folder to make it easier to add/remove them

Open a linux shell to avoid windows vs linux line endings issue

git clone https://github.com/VictorRobellini/pfSense-Dashboard.git rsync -a -e ssh /home/user/pfSense-Dashboard/ root@firewall.domain.lan:/tmp/pfSense-Dashboard/

Switch to pfsense ssh session

rm -rf /usr/local/bin/telegraf_plugins/ cp -R /tmp/pfSense-Dashboard/plugins/ /usr/local/bin/telegraf_plugins/ chmod -R 555 /usr/local/bin/telegraf_plugins/

Might be useful to someone :)

VictorRobellini commented 3 years ago

I have a section in the plugin troubleshooting section showing how to detect and fix CRLF issues. rsync would work great, but it would require the user to be running an OS with rsync (most likely not Windows).

Maybe we can start a new Plugin-Install.md in the plugins directory with more details.

wrightsonm commented 3 years ago

I have also found this:

https://docs.github.com/en/github/getting-started-with-github/configuring-git-to-handle-line-endings

Add a .gitattributes file containing:

text eol=lf

This should largely eliminate the CRLF problem.

faandg commented 3 years ago

I'm a bit late to the party but you can also use a couple of packages which exist for this purpose, like dos2unix.

dos2unix is a tool to convert text files from DOS line endings (carriage return + line feed) to Unix line endings (line feed). It is also capable of conversion between UTF-16 to UTF-8. Invoking the unix2dos command can be used to convert from Unix to DOS.

Most distro's have this package either installed or available via the base repositories. I use it often for convenience's sake because the syntax 'dos2unix file' is easy to remember :D

sbeeche commented 2 years ago

A little part of documentation is missing, and is the Grafana part. After you made all the installation using all the steps that Victor wrote, you must create a New Data Source on Grafana using the data previously used on influx to create the database and the user + password. Then in the Dashboard, in the upper left corner, select the right Datasource (the name of the database you created) and you are ready.