Compare commits

...

17 Commits

Author SHA1 Message Date
kongfei605
71944c64b4 Merge pull request #65 from flashcatcloud/kongfei_develop
fix redis mode compare problem
2022-08-11 15:52:09 +08:00
kongfei
219beae857 fix redis mode compare problem 2022-08-11 15:35:37 +08:00
kongfei605
180552c1cb Merge pull request #63 from flashcatcloud/kongfei_develop
update to 5.10.3
2022-08-11 14:15:25 +08:00
kongfei
436a216b38 update to 5.10.3 2022-08-11 14:10:46 +08:00
kongfei605
005a673cfa Merge pull request #62 from LinkMaq/bugfix-61
fixed(categraf): Empty docker_socket when kubernetes runtime is not d…
2022-08-10 07:10:24 +08:00
kongfei605
055ffb3002 Merge pull request #60 from LinkMaq/bugfix-54
fixed(database): add subPath for my.cnf  #54
2022-08-10 07:05:17 +08:00
LinkMaq
584a00f668 fixed(categraf): Empty docker_socket when kubernetes runtime is not docker 2022-08-10 00:53:16 +08:00
LinkMaq
c697ffa2dc fixed(database): add subPath for my.cnf #54 2022-08-09 23:41:54 +08:00
kongfei605
6e09f7b074 Merge pull request #59 from flashcatcloud/kongfei_develop
v5.10.2
2022-08-08 10:35:42 +08:00
kongfei
b3cc4112db update to v5.10.2 2022-08-08 10:33:34 +08:00
kongfei
67f43473d7 v5.10.2 2022-08-08 10:32:36 +08:00
kongfei605
36588e5e3d Merge pull request #58 from xiaoziv/fix-nserver-hostname
Update deployment.yaml
2022-08-06 20:40:39 +08:00
xiaoziv
93740aa23f Update deployment.yaml
nserver设置多副本时候,指定hostname会导致多副本的hostname相同,导致规则的分配出现问题
2022-08-05 14:34:10 +08:00
kongfei605
6872d2e5fe Merge pull request #57 from flashcatcloud/kongfei_develop
upgrade v5.10.1
2022-08-03 20:39:27 +08:00
kongfei
fa2abf8f33 upgrade v5.10.1 2022-08-03 20:39:02 +08:00
kongfei605
6ddb9be9a0 Merge pull request #55 from flashcatcloud/kongfei_develop
v5.9.8
2022-07-29 06:26:30 +08:00
kongfei
8fe0978add v5.9.8 2022-07-29 06:25:57 +08:00
10 changed files with 1623 additions and 1529 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -402,6 +402,7 @@ CREATE TABLE `alert_cur_event` (
`notify_cur_number` int not null default 0 comment '',
`target_ident` varchar(191) not null default '' comment 'target ident, also in tags',
`target_note` varchar(191) not null default '' comment 'target note',
`first_trigger_time` bigint,
`trigger_time` bigint not null,
`trigger_value` varchar(255) not null,
`tags` varchar(1024) not null default '' comment 'merge data_tags rule_tags, split by ,,',
@@ -436,6 +437,7 @@ CREATE TABLE `alert_his_event` (
`notify_cur_number` int not null default 0 comment '',
`target_ident` varchar(191) not null default '' comment 'target ident, also in tags',
`target_note` varchar(191) not null default '' comment 'target note',
`first_trigger_time` bigint,
`trigger_time` bigint not null,
`trigger_value` varchar(255) not null,
`recover_time` bigint not null default 0,

View File

@@ -241,11 +241,9 @@ app: "{{ template "nightingale.name" . }}"
{{- end -}}
{{- define "nightingale.redis.mode" -}}
{{- if eq .Values.redis.type "internal" -}}
{{- printf "%s" "standalone" -}}
{{- else -}}
{{- .Values.redis.external.mode -}}
{{- end -}}
{{- with .Values.redis }}
{{- ternary "standalone" .external.mode (eq .type "internal") }}
{{- end }}
{{- end -}}
/*scheme://[redis:password@]host:port[/master_set]*/

View File

@@ -96,8 +96,10 @@ spec:
name: input-net
- mountPath: /etc/categraf/conf/input.netstat
name: input-netstat
{{- if and ( eq .Values.categraf.type "internal") ( .Values.categraf.internal.docker_socket) }}
- mountPath: /etc/categraf/conf/input.docker
name: input-docker
{{- end }}
- mountPath: /etc/categraf/conf/input.kubernetes
name: input-kubernetes
- mountPath: /etc/categraf/conf/input.prometheus
@@ -118,8 +120,10 @@ spec:
- mountPath: /hostfs
name: hostrofs
readOnly: true
{{- if and ( eq .Values.categraf.type "internal") ( .Values.categraf.internal.docker_socket) }}
- name: docker-socket
mountPath: {{ trimPrefix "unix://" .Values.categraf.internal.docker_socket }}
{{- end }}
volumes:
- name: categraf-config
configMap:
@@ -147,9 +151,11 @@ spec:
- name: input-netstat
configMap:
name: input-netstat
{{- if and ( eq .Values.categraf.type "internal") ( .Values.categraf.internal.docker_socket) }}
- name: input-docker
configMap:
name: input-docker
{{- end }}
- name: input-kubernetes
configMap:
name: input-kubernetes
@@ -177,8 +183,10 @@ spec:
- name: hostroutmp
hostPath:
path: /var/run/utmp
{{- if and ( eq .Values.categraf.type "internal") ( .Values.categraf.internal.docker_socket) }}
- name: docker-socket
hostPath:
path: {{ trimPrefix "unix://" .Values.categraf.internal.docker_socket }}
type: Socket
{{- end }}
{{- end -}}

View File

@@ -15,6 +15,7 @@
#
*/}}
{{- if eq .Values.categraf.type "internal" -}}
{{- if .Values.categraf.internal.docker_socket -}}
apiVersion: v1
kind: ConfigMap
metadata:
@@ -22,4 +23,5 @@ metadata:
data:
{{ (.Files.Glob "categraf/conf/input.docker/*.toml").AsConfig | indent 2 }}
{{- end -}}
{{- end -}}

View File

@@ -73,6 +73,7 @@ spec:
- mountPath: /var/lib/mysql/
name: database-data
- mountPath: /etc/my.cnf
subPath: my.cnf
name: database-config
- mountPath: /docker-entrypoint-initdb.d
name: database-initdb-config

View File

@@ -66,7 +66,7 @@ spec:
name: nserver-template
- mountPath: /app/etc/script
name: nserver-script
hostname: nserver
# hostname: nserver
restartPolicy: Always
volumes:
- name: nserver-config

View File

@@ -71,6 +71,10 @@ data:
AccessExpired = 1500
RefreshExpired = 10080
RedisKeyPrefix = "/jwt/"
[ProxyAuth]
Enable = false
HeaderUserNameKey = "X-User-Name"
DefaultRoles = ["Standard"]
[BasicAuth]
user001 = "ccc26da7b9aba533cbb263a36c07dcc5"
[AnonymousAccess]
@@ -129,4 +133,8 @@ data:
BasicAuthUser = "ibex"
BasicAuthPass = "ibex"
Timeout = 3000
[TargetMetrics]
TargetUp = '''max(max_over_time(target_up{ident=~"(%s)"}[%dm])) by (ident)'''
LoadPerCore = '''max(max_over_time(system_load_norm_1{ident=~"(%s)"}[%dm])) by (ident)'''
MemUtil = '''100-max(max_over_time(mem_available_percent{ident=~"(%s)"}[%dm])) by (ident)'''
{{- end -}}

26
tpl/README.md Normal file
View File

@@ -0,0 +1,26 @@
# 告警消息模版文件
模版中可以使用的变量参考`AlertCurEvent`对象
模版语法如何使用可以参考[html/template](https://pkg.go.dev/html/template)
## 如何在告警模版中添加监控详情url
假设web的地址是http://127.0.0.1:18000/, 实际使用时用web地址替换该地址
在监控模版中添加以下行:
* dingtalk / wecom / feishu
```markdown
[监控详情](http://127.0.0.1:18000/metric/explorer?promql={{ .PromQl | escape }})
```
* mailbody
```html
<tr>
<th>监控详情:</th>
<td>
<a href="http://127.0.0.1:18000/metric/explorer?promql={{ .PromQl | escape }}" target="_blank">点击查看</a>
</td>
</tr>
```

View File

@@ -198,6 +198,9 @@ categraf:
tolerations: []
affinity: {}
priorityClassName:
## Parm: categraf.internal.docker_socket Desc: the path of docker socket on kubelet node.
## "unix:///var/run/docker.sock" is default, if your kubernetes runtime is container or others, empty this variable.
## docker_socket: ""
docker_socket: unix:///var/run/docker.sock
external:
host: "192.168.0.3"
@@ -213,7 +216,7 @@ nwebapi:
automountServiceAccountToken: false
image:
repository: flashcatcloud/nightingale
tag: 5.9.7
tag: 5.10.3
nodeSelector: {}
tolerations: []
affinity: {}
@@ -231,7 +234,7 @@ nserver:
automountServiceAccountToken: false
image:
repository: flashcatcloud/nightingale
tag: 5.9.7
tag: 5.10.3
nodeSelector: {}
tolerations: []
affinity: {}