diff --git a/lab02/README.md b/lab02/README.md index 8792d57efe674d7bc9e186d0c33083d014d3ed9c..766b834406c1d33d20985e4fd492fbd9549401f1 100644 --- a/lab02/README.md +++ b/lab02/README.md @@ -128,6 +128,11 @@ docker ps  + By stworzyÄ nowe wykresy w grafanie naleĹźy siÄ zalogowaÄ (przycisk w lewym dolnym rogu). + Wybieramy Nowy->Dashboard i wstawiamy nowy panel. Nowe query tworzymy wybierajÄ c nazwÄ tablicy w "select measurement", oraz nazwÄ pomiaru z "field". + +  + ### Zadania (2pkt.): - Konfiguracja Grafany w celu wyĹwietlenia danych pomiarowych (1pkt.): - Skonfiguruj poĹÄ czenie z bazÄ influx diff --git a/lab02/img/query.png b/lab02/img/query.png new file mode 100644 index 0000000000000000000000000000000000000000..74349f5e2e2e4521b7dc07119a11b2a9f97cd961 Binary files /dev/null and b/lab02/img/query.png differ diff --git a/lab02/telegraf.conf b/lab02/telegraf.conf index e9494328db55d45322183c46aaed140e35b0d9df..827553b1dc118c6787dd7b252136670e34ce5054 100644 --- a/lab02/telegraf.conf +++ b/lab02/telegraf.conf @@ -102,7 +102,7 @@ # Configuration for sending metrics to InfluxDB -[[outputs.influxdb]] +[[outputs.influxdb_v2]] ## The full HTTP or UDP URL for your InfluxDB instance. ## ## Multiple URLs can be specified for a single cluster, only ONE of the @@ -113,7 +113,11 @@ urls = ["http://172.17.0.1:8086"] ## The target database for metrics; will be created as needed. ## For UDP url endpoint database needs to be configured on server side. -database = "sensors" +#database = "sensors" +organization = "gut" + + ## Destination bucket to write into. +bucket = "sensors" ## The value of this tag will be used to determine the database. If this ## tag is not set the 'database' option is used as the default. @@ -125,7 +129,7 @@ database = "sensors" ## If true, no CREATE DATABASE queries will be sent. Set to true when using ## Telegraf with a user without permissions to create databases or when the ## database already exists. -skip_database_creation = true +#skip_database_creation = true ## Name of existing retention policy to write to. Empty string writes to ## the default retention policy. Only takes effect when using HTTP. @@ -139,9 +143,9 @@ skip_database_creation = true # timeout = "5s" ## HTTP Basic Auth -username = "telegraf" -password = "telegraf" - +#username = "telegraf" +#password = "telegraf" +token= "-Ukwi22XhqPYvXJQibqyOZhT4CDwwg5P3q874lAXTHG7BfOPnomUAFOf66mSTf6r5iaozF2d0SZ6AblTpNK8ZQ==" ############################################################################### # INPUT PLUGINS # @@ -171,61 +175,47 @@ password = "telegraf" dest = "humidityrelative" conversion = "float(3)" -# # Read metrics from MQTT topic(s) -# [[inputs.mqtt_consumer]] -# # ## MQTT broker URLs to be used. The format should be scheme://host:port, -# # ## schema can be tcp, ssl, or ws. -# #servers = ["tcp://172.17.0.1:1883"] -# # -# # ## Topics that will be subscribed to. -# topics = [ -# "sensors/" -# ] -# # -# # ## The message topic will be stored in a tag specified by this value. If set -# # ## to the empty string no topic tag will be created. -# # # topic_tag = "topic" -# # -# # ## QoS policy for messages -# # ## 0 = at most once -# # ## 1 = at least once -# # ## 2 = exactly once -# # ## -# # ## When using a QoS of 1 or 2, you should enable persistent_session to allow -# # ## resuming unacknowledged messages. -# # # qos = 0 -# # -# # ## Connection timeout for initial connection in seconds -# connection_timeout = "30s" -# # -# # ## Maximum messages to read from the broker that have not been written by an -# # ## output. For best throughput set based on the number of metrics within -# # ## each message and the size of the output's metric_batch_size. -# # ## -# # ## For example, if each message from the queue contains 10 metrics and the -# # ## output metric_batch_size is 1000, setting this to 100 will ensure that a -# # ## full batch is collected and the write is triggered immediately without -# # ## waiting until the next flush_interval. -# # # max_undelivered_messages = 1000 -# # -# # ## Persistent session disables clearing of the client session on connection. -# # ## In order for this option to work you must also set client_id to identify -# # ## the client. To receive messages that arrived while the client is offline, -# # ## also set the qos option to 1 or 2 and don't forget to also set the QoS when -# # ## publishing. -# # # persistent_session = false -# # -# # ## If unset, a random client ID will be generated. -# # # client_id = "" -# # - -# # ## Data format to consume. -# # ## Each data format has its own unique set of configuration options, read -# # ## more about them here: -# # ## https://github.com/influxdata/telegraf/blob/master/docs/DATA_FORMATS_INPUT.md -# #data_format = "influx" -# #temp,site=room1 value=25.6532912641 -# #name_override = "temp" + +[[inputs.mqtt_consumer]] +# MQTT broker URLs to be used. The format should be scheme://host:port, +# schema can be tcp, ssl, or ws. +servers = ["tcp://172.17.0.1:1883"] + +# Topics that will be subscribed to. +topics = [ + "sensors/#" +] +## The message topic will be stored in a tag specified by this value. If set +## to the empty string no topic tag will be created. +topic_tag = "topic" +## QoS policy for messages +## 0 = at most once +## 1 = at least once +## 2 = exactly once +## +qos = 0 +## Connection timeout for initial connection in seconds +connection_timeout = "30s" +## Maximum messages to read from the broker that have not been written by an +## output. For best throughput set based on the number of metrics within +## each message and the size of the output's metric_batch_size. +## +## For example, if each message from the queue contains 10 metrics and the +## output metric_batch_size is 1000, setting this to 100 will ensure that a +## full batch is collected and the write is triggered immediately without +## waiting until the next flush_interval. +max_undelivered_messages = 1000 +## Persistent session disables clearing of the client session on connection. +## In order for this option to work you must also set client_id to identify +## the client. To receive messages that arrived while the client is offline, +## also set the qos option to 1 or 2 and don't forget to also set the QoS when +## publishing. +persistent_session = false +## Data format to consume. +## Each data format has its own unique set of configuration options, read +## more about them here: +## https://github.com/influxdata/telegraf/blob/master/docs/DATA_FORMATS_INPUT.md +data_format = "value" # Print all metrics that pass through this filter. -[[processors.printer]] \ No newline at end of file +[[processors.printer]]