Skip to content

Commit 1dec8ca

Browse files
committed
Added RHEL9 install script and config examples.
1 parent d7d952c commit 1dec8ca

File tree

6 files changed

+188
-0
lines changed

6 files changed

+188
-0
lines changed
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
#cd
2+
#git clone https://github.com/riclolsen/json-scada --config core.autocrlf=input
3+
#cd json-scada/platform-rhel9
4+
5+
sudo dnf -y update
6+
sudo dnf -y install epel-release
7+
sudo dnf -y install tar nodejs golang nginx wget chkconfig
8+
sudo update-crypto-policies --set LEGACY
9+
sudo tee /etc/yum.repos.d/mongodb-org-6.0.repo <<EOF
10+
[mongodb-org-6.0]
11+
name=MongoDB Repository
12+
baseurl=https://repo.mongodb.org/yum/redhat/8/mongodb-org/6.0/\$basearch/
13+
gpgcheck=1
14+
enabled=1
15+
gpgkey=https://www.mongodb.org/static/pgp/server-6.0.asc
16+
EOF
17+
sudo tee /etc/yum.repos.d/influxdb.repo <<EOF
18+
[influxdb]
19+
name = InfluxDB Repository - RHEL
20+
baseurl = https://repos.influxdata.com/rhel/\$releasever/\$basearch/stable/
21+
enabled = 1
22+
gpgcheck = 1
23+
gpgkey = https://repos.influxdata.com/influxdb.key
24+
EOF
25+
sudo tee /etc/yum.repos.d/grafana.repo <<EOF
26+
[grafana]
27+
name=grafana
28+
baseurl=https://packages.grafana.com/oss/rpm
29+
repo_gpgcheck=1
30+
enabled=1
31+
gpgcheck=1
32+
gpgkey=https://packages.grafana.com/gpg.key
33+
sslverify=1
34+
sslcacert=/etc/pki/tls/certs/ca-bundle.crt
35+
EOF
36+
sudo dnf -y install mongodb-org
37+
sudo cp mongod.conf /etc/
38+
sudo dnf -y install telegraf
39+
sudo dnf -y install grafana
40+
sudo dnf -y group install "Development Tools" ".NET Development"
41+
42+
sudo systemctl daemon-reload
43+
sudo systemctl enable supervisor
44+
sudo systemctl enable mongod
45+
sudo systemctl enable telegraf
46+
sudo systemctl start mongod
47+
#sudo systemctl start supervisor
48+
#sudo systemctl start telegraf
49+
50+

platform-rhel9/mongod.conf

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# mongod.conf
2+
3+
# for documentation of all options, see:
4+
# http://docs.mongodb.org/manual/reference/configuration-options/
5+
6+
# where to write logging data.
7+
systemLog:
8+
destination: syslog
9+
10+
# Where and how to store data.
11+
storage:
12+
dbPath: /var/lib/mongo
13+
journal:
14+
enabled: true
15+
# engine:
16+
# wiredTiger:
17+
18+
# how the process runs
19+
processManagement:
20+
fork: true # fork and run in background
21+
pidFilePath: /var/run/mongodb/mongod.pid # location of pidfile
22+
timeZoneInfo: /usr/share/zoneinfo
23+
24+
# network interfaces
25+
net:
26+
port: 27017
27+
bindIp: 127.0.0.1 # Enter 0.0.0.0,:: to bind to all IPv4 and IPv6 addresses or, alternatively, use the net.bindIpAll setting.
28+
29+
30+
#security:
31+
32+
#operationProfiling:
33+
34+
replication:
35+
replSetName: rs1
36+
37+
#sharding:
38+
39+
## Enterprise-Only Options
40+
41+
#auditLog:
42+
43+
#snmp:
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# MongoDB metrics
2+
3+
[[inputs.mongodb]]
4+
name_override = "_SysMongoDB"
5+
## An array of URLs of the form:
6+
## "mongodb://" [user ":" pass "@"] host [ ":" port]
7+
## For example:
8+
## mongodb://user:[email protected]:27017,
9+
## mongodb://10.10.3.33:18832,
10+
servers = ["mongodb://127.0.0.1:27017"]
11+
gather_cluster_status = false
12+
gather_perdb_stats = false
13+
gather_col_stats = false
14+
#gather_top_stat = false
15+
col_stats_dbs = ["json_scada"]
16+
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# MQTT Examples
2+
3+
4+
[[inputs.mqtt_consumer]]
5+
# this willl be JSON-SCADA group1
6+
name_override = "TelegrafMQTT"
7+
## Broker URLs for the MQTT server or cluster. To connect to multiple
8+
## clusters or standalone servers, use a seperate plugin instance.
9+
## example: servers = ["tcp://localhost:1883"]
10+
## servers = ["ssl://localhost:1883"]
11+
## servers = ["ws://localhost:1883"]
12+
servers = ["tcp://test.mosquitto.org:1883"]
13+
14+
## Topics that will be subscribed to.
15+
topics = [
16+
"$SYS/broker/messages/#",
17+
]
18+
data_format = "value"
19+
data_type = "integer"
20+
# convert topic to group2
21+
#topic_tag = "group2"
22+
23+
24+
[[inputs.mqtt_consumer]]
25+
# this willl be JSON-SCADA group1
26+
name_override = "TelegrafMQTT"
27+
## Broker URLs for the MQTT server or cluster. To connect to multiple
28+
## clusters or standalone servers, use a seperate plugin instance.
29+
## example: servers = ["tcp://localhost:1883"]
30+
## servers = ["ssl://localhost:1883"]
31+
## servers = ["ws://localhost:1883"]
32+
servers = ["tcp://test.mosquitto.org:1883"]
33+
34+
## Topics that will be subscribed to.
35+
topics = [
36+
"$SYS/broker/uptime",
37+
"$SYS/broker/version",
38+
]
39+
data_format = "value"
40+
data_type = "string"
41+
# convert topic to group2
42+
#topic_tag = "group2"
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# OPC-UA Examaple
2+
3+
[[inputs.opcua]]
4+
## Metric name
5+
name = "TelegrafOPC-UA"
6+
endpoint = "opc.tcp://opcua.demo-this.com:51210/UA/SampleServer"
7+
security_policy = "None"
8+
security_mode = "None"
9+
auth_method = "Anonymous"
10+
certificate = "" # "/etc/telegraf/cert.pem"
11+
12+
[[inputs.opcua.group]]
13+
#name = "group1_name"
14+
namespace = "2"
15+
identifier_type = "i"
16+
#tags=[["group1_tag", "val1"]]
17+
tags=[["group2", "demo"]]
18+
nodes = [
19+
{name="float_value", identifier="10853"},
20+
{name="string_value", identifier="10855"},
21+
{name="date_value", identifier="10856"},
22+
{name="byte_value", identifier="10846"}
23+
]
24+
#{name="date_value", identifier="10856"}, # date values doesn't work
25+
#{name="array_of_double", identifier="10938"} # array values doesn't work
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# USE THIS TO SEND DATA TO JSON-SCADA VIA UDP
2+
# Generic socket writer capable of handling multiple socket types.
3+
[[outputs.socket_writer]]
4+
## URL to connect to
5+
address = "udp://127.0.0.1:51920"
6+
7+
## Data format to generate.
8+
## Each data format has its own unique set of configuration options, read
9+
## more about them here:
10+
## https://github.com/influxdata/telegraf/blob/master/docs/DATA_FORMATS_INPUT.md
11+
data_format = "json"
12+

0 commit comments

Comments
 (0)