Minor changes
parent
0361323aed
commit
0e139d1042
|
@ -7,6 +7,7 @@ db_input high opengnsys/oglog_ogCoreIp || true
|
|||
db_input high opengnsys/oglog_ogLogIp || true
|
||||
db_input high opengnsys/oglog_subdomain || true
|
||||
db_input high opengnsys/oglog_certificateAltNames || true
|
||||
db_input high opengnsys/oglog_nodeExporterTargets || true
|
||||
|
||||
# Lanzar el diálogo con el usuario
|
||||
db_go
|
|
@ -15,6 +15,8 @@ db_get opengnsys/oglog_subdomain
|
|||
SUBDOMAIN="$RET"
|
||||
db_get opengnsys/oglog_certificateAltNames
|
||||
CERT_ALT_NAMES="$RET"
|
||||
db_get opengnsys/oglog_nodeExporterTargets
|
||||
NODE_EXPORTER_TARGETS="$RET"
|
||||
|
||||
export OGCORE_SERVER
|
||||
export OGLOG_SERVER
|
||||
|
@ -246,6 +248,27 @@ create_opensearch_index() {
|
|||
done
|
||||
}
|
||||
|
||||
|
||||
configure_prometheus() {
|
||||
local PROMETHEUS_CONFIG="/etc/prometheus/prometheus.yml"
|
||||
IFS=',' read -r -a HOST_ARRAY <<< "$NODE_EXPORTER_TARGETS"
|
||||
|
||||
# Configurar Prometheus para monitorear OpenSearch y OpenSearch Dashboards
|
||||
echo "Configuring Prometheus with OpenSearch and OpenSearch Dashboards targets..."
|
||||
cat > "$PROMETHEUS_CONFIG" <<EOF
|
||||
global:
|
||||
scrape_interval: 15s
|
||||
evaluation_interval: 15s
|
||||
scrape_configs:
|
||||
- job_name: 'node_exporter'
|
||||
static_configs:
|
||||
- targets:
|
||||
EOF
|
||||
for HOST in "${HOST_ARRAY[@]}"; do
|
||||
echo " - $HOST:9100" >> "$PROMETHEUS_CONFIG"
|
||||
done
|
||||
}
|
||||
|
||||
restart_services() {
|
||||
echo "Restarting services..."
|
||||
systemctl daemon-reload
|
||||
|
@ -282,6 +305,7 @@ case $1 in
|
|||
configure_opensearch_dashboards_certificates
|
||||
configure_journalbeat_certificates
|
||||
configure_grafana
|
||||
configure_prometheus
|
||||
restart_services
|
||||
sleep 5
|
||||
echo "Creating OpenSearch index patterns and initial index..."
|
||||
|
|
|
@ -23,3 +23,8 @@ Type: string
|
|||
Default: opengnsys
|
||||
Description: Introduzca el subdominio para OpenGNSys Log
|
||||
|
||||
Template: opengnsys/oglog_nodeExporterTargets
|
||||
Type: string
|
||||
Default: localhost
|
||||
Description: Introduzca los targets de Node Exporter separados por comas
|
||||
|
||||
|
|
|
@ -3,6 +3,6 @@ datasources:
|
|||
- name: Prometheus
|
||||
type: prometheus
|
||||
access: proxy
|
||||
url: https://${OGLOG_SERVER}:9090
|
||||
url: http://${OGLOG_SERVER}:9090
|
||||
isDefault: true
|
||||
|
||||
|
|
Loading…
Reference in New Issue