Add Nagios Elasticsearch Query Command

Change-Id: I74a965a5397101793cae71228a6a5bd442bf9f5a
This commit is contained in:
Huang, Scott (sh2725) 2018-11-19 13:39:49 -05:00
parent 5d356f9265
commit bd05126309
3 changed files with 14 additions and 3 deletions

View File

@ -34,6 +34,7 @@ type: Opaque
data:
cgi.cfg: {{ include "nagios.utils.to_nagios_conf" .Values.conf.nagios.cgi | b64enc }}
nagios.cfg: {{ include "nagios.utils.to_nagios_conf" .Values.conf.nagios.nagios | b64enc }}
query_es_clauses.json: {{ .Values.conf.nagios.query_es_clauses | toJson | b64enc }}
nagios_objects.cfg: {{ include "configmap_etc._nagios_objects" $ | b64enc }}
#NOTE(portdirect): this must be last, to work round helm ~2.7 bug.
{{- include "helm-toolkit.snippets.values_template_renderer" (dict "envAll" $envAll "template" .Values.conf.httpd "key" "httpd.conf" "format" "Secret") | indent 2 }}

View File

@ -190,6 +190,12 @@ spec:
mountPath: /opt/nagios/etc/nagios_objects.cfg
subPath: nagios_objects.cfg
readOnly: true
{{- if .Values.conf.es_query_clauses }}
- name: nagios-etc
mountPath: /opt/nagios/etc/objects/query_es_clauses.json
subPath: query_es_clauses.json
readOnly: true
{{ end }}
- name: pod-var-log
mountPath: /opt/nagios/var/log
readOnly: false

View File

@ -401,9 +401,6 @@ conf:
- check_prom_alert:
command_name: check_prom_alert
command_line: "$USER1$/query_prometheus_alerts.py --prometheus_api $USER2$ --alertname '$ARG1$' --msg_format '$ARG2$' --ok_message '$ARG3$'"
- check_es_alert:
command_name: check_es_alert
command_line: "$USER1$/check_elasticsearch_query.py --es_url $USER9$ --logger '$ARG1$' --range_mins '$ARG2$' --alert_level '$ARG3$' --critical '$ARG4$' --es_type '$ARG5$'"
- check_filespace_mounts-usage-rate-fullin4hrs:
command_name: check_filespace_mounts-usage-rate-fullin4hrs
command_line: $USER1$/query_prometheus_alerts.py --prometheus_api $USER2$ --alertname 'node_filesystem_full_in_4h' --labels_csv 'instance=~"$HOSTADDRESS$.*"' --msg_format 'CRITICAL- Mountpoint {mountpoint} will be full in four hours' --ok_message 'OK- All mountpoints usage rate is normal'
@ -470,6 +467,12 @@ conf:
- check_prometheus_hosts:
command_name: check_prometheus_hosts
command_line: $USER1$/check_update_prometheus_hosts.py --prometheus_api $USER2$ --object_file_loc /opt/nagios/etc/objects/prometheus_discovery_objects.cfg
- check_es_query:
command_name: check_es_query
command_line: $USER1$/query_elasticsearch.py $USER9$ '$ARG1$' '$ARG2$' '$ARG3$' '$ARG4$' '$ARG5$' --simple_query '$ARG6$' --simple_query_fields '$ARG7$' --match '$ARG8$' --range '$ARG9$'
- check_es_query_w_file:
command_name: check_es_query_w_file
command_line: $USER1$/query_elasticsearch.py $USER9$ '$ARG1$' '$ARG2$' '$ARG3$' '$ARG4$' '$ARG5$' --simple_query '$ARG6$' --simple_query_fields '$ARG7$' --query_file '/opt/nagios/etc/objects/query_es_clauses.json' --query_clause '$ARG8$' --match '$ARG9$' --range '$ARG10$'
services:
- notifying_service:
name: notifying_service
@ -1187,3 +1190,4 @@ conf:
http:
primary_target: 127.0.0.1:3904/events
secondary_target: 127.0.0.1:3904/events
query_es_clauses: "null"