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_ogLogIp || true
|
||||||
db_input high opengnsys/oglog_subdomain || true
|
db_input high opengnsys/oglog_subdomain || true
|
||||||
db_input high opengnsys/oglog_certificateAltNames || true
|
db_input high opengnsys/oglog_certificateAltNames || true
|
||||||
|
db_input high opengnsys/oglog_nodeExporterTargets || true
|
||||||
|
|
||||||
# Lanzar el diálogo con el usuario
|
# Lanzar el diálogo con el usuario
|
||||||
db_go
|
db_go
|
|
@ -15,6 +15,8 @@ db_get opengnsys/oglog_subdomain
|
||||||
SUBDOMAIN="$RET"
|
SUBDOMAIN="$RET"
|
||||||
db_get opengnsys/oglog_certificateAltNames
|
db_get opengnsys/oglog_certificateAltNames
|
||||||
CERT_ALT_NAMES="$RET"
|
CERT_ALT_NAMES="$RET"
|
||||||
|
db_get opengnsys/oglog_nodeExporterTargets
|
||||||
|
NODE_EXPORTER_TARGETS="$RET"
|
||||||
|
|
||||||
export OGCORE_SERVER
|
export OGCORE_SERVER
|
||||||
export OGLOG_SERVER
|
export OGLOG_SERVER
|
||||||
|
@ -246,6 +248,27 @@ create_opensearch_index() {
|
||||||
done
|
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() {
|
restart_services() {
|
||||||
echo "Restarting services..."
|
echo "Restarting services..."
|
||||||
systemctl daemon-reload
|
systemctl daemon-reload
|
||||||
|
@ -282,6 +305,7 @@ case $1 in
|
||||||
configure_opensearch_dashboards_certificates
|
configure_opensearch_dashboards_certificates
|
||||||
configure_journalbeat_certificates
|
configure_journalbeat_certificates
|
||||||
configure_grafana
|
configure_grafana
|
||||||
|
configure_prometheus
|
||||||
restart_services
|
restart_services
|
||||||
sleep 5
|
sleep 5
|
||||||
echo "Creating OpenSearch index patterns and initial index..."
|
echo "Creating OpenSearch index patterns and initial index..."
|
||||||
|
|
|
@ -23,3 +23,8 @@ Type: string
|
||||||
Default: opengnsys
|
Default: opengnsys
|
||||||
Description: Introduzca el subdominio para OpenGNSys Log
|
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
|
- name: Prometheus
|
||||||
type: prometheus
|
type: prometheus
|
||||||
access: proxy
|
access: proxy
|
||||||
url: https://${OGLOG_SERVER}:9090
|
url: http://${OGLOG_SERVER}:9090
|
||||||
isDefault: true
|
isDefault: true
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue