After MySql tables creation
Sensors Monitoring – MySql Configuration
we have to create a database on InfluxDB.
The first step is to activate an administrative user on the system, as described in the link
Authentication and Authorization
InfluxDB is accessed from the local client by running the influx command from a shell
1 |
influx |
Run
1 2 |
create user admin with password 'password' with all privileges exit |
In the file /etc/infuxdb/influxdb.conf, using the root user or the sudo command, the auth-enabled parameter is set from false to true
1 |
auth-enabled = true |
Restart influxdb
1 |
sudo systemctl restart influxdb |
Using a command shell on Debian create the database DATAESP with the following commands
1 2 |
influx auth |
Enter the admin credentials to the auth command and proceed to create the database
1 2 |
create database DATAESP exit |
Below is the result of the commands listed above
For the management of the Influxdb database, it is possible to use Chronograph
The Chronograph download is available at the link
Installation can be performed in two ways.
Application start
Log in with the monitor user and in a command shell
1 2 3 |
cd wget https://dl.influxdata.com/chronograf/releases/chronograf-1.7.10_linux_armhf.tar.gz tar xvfz chronograf-1.7.10_linux_armhf.tar.gz mv chronograf-1.7.10-1 chronograf |
Start the chronograf application
1 |
./chronograf/usr/bin/chronograf |
Start as a Service
Log in with the monitor user; use a command shell to execute
1 2 3 4 5 |
cd wget https://dl.influxdata.com/chronograf/releases/chronograf-1.7.10_linux_armhf.tar.gz tar xvfz chronograf-1.7.10_linux_armhf.tar.gz sudo cp -R chronograf-1.7.10-1 /opt/chronograf sudo chown -R monitor.monitor /opt/chronograf |
In the /opt/chronograf/usr/lib/chronograf/scripts folder there are scripts for the automatic start of chronograf.
Here are the operations performed in our system:
- Copy /opt/chronograf/usr/lib/chronograf/scripts/init.sh into /etc/init.d/chronograf and assign execution permissions
1 2 |
sudo cp /opt/chronograf/usr/lib/chronograf/scripts/init.sh /etc/init.d/chronograf sudo chmod +x /etc/init.d/chronograf |
- Copy /opt/chronograf/usr/lib/chronograf/scripts/chronogaf.service into /etc/systemd/system/chronograf.service
1 |
sudo cp /opt/chronograf/usr/lib/chronograf/scripts/chronograf.service /etc/systemd/system/chronograf.service |
Change in both files the user and path of the various chronograf components, i.e. change the user to monitor and the paths that point to /opt/chronograf
Below is the link to the modified files
After the modifications run
1 |
sudo update-rc.d chronograf defaults |
To enable it at startup and start it run
1 2 |
sudo systemctl enable chronograf sudo systemctl start chronograf |
After starting chronograf in one of the ways described above, it can be accessed via browser and port 8888
http://dashboardora.local:8888
Press Get Started and set the connection and the credentials of the admin user with relative password defined before
Do not set the Kapacitor component
Complete the configuration and by clicking on View All Connections
we access to the newly created connection
This component can be useful later to manage and monitor InfluxDB.
In the next article, we ‘ll define the rules on Nodered to populate MySql and InfluxDB databases with the data sent by the sensors
Sensors Monitoring – Nodered Configuration