-
Notifications
You must be signed in to change notification settings - Fork 1
/
test3.sh
executable file
·87 lines (76 loc) · 2.36 KB
/
test3.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
#!/bin/bash
DETAILS_BAD='An alert **is** ringing.
Failure time: 20xx-xx-xx xx:37:41
Last task time: 20xx-xx-xx xx:37:41
Class(es): xxxx
Failed condition was: TEST_FAILED == 1
Values:
- TEST_FAILED: 1
All values for this run (1.112404368s):
- mail.quiris.com certificate validity (47.999909ms):
--- CERT_WILL_EXPIRE_MAIL_QUIRIS: 0
- CPU temperature (13.682033ms):
--- CPU0_TEMP: 25
- disk free (30.178959ms):
--- DISK_FULLEST_PERC: 22
--- DF_ROOT_PERC: 22
--- DF_BOOT_PERC: 18
--- DF_BOOT_EFI_PERC: 5
--- DF_HOME_PERC: 15
- system load (18.514627ms):
--- LOAD: 0.12
--- CPU_COUNT: 4
--- LOAD_PROG_DETECTED: 1
- Linux md-raid states (12.201576ms):
--- MDRAID_ERR_ARRAYS: 0
- ping to Google (875.044679ms):
--- PING_LOSS_PERC: 0
--- PING_AVG_MS: 19.346
- devel test (25.31626ms):
--- TEST_FAILED: 1
Unique failure ID: xxxxxxxxxx
'
DETAILS_GOOD='This alert is **no more** ringing.
Failure time: 2017-06-08 18:16:10
Last task time: 2017-06-08 18:20:09
Class(es): warning
Failed condition was: LOAD > (CPU_COUNT + overload_allowed) && LOAD_PROG_DETECTED == 0
Values:
- LOAD: 0.46
- CPU_COUNT: 2
- overload_allowed: 0
- LOAD_PROG_DETECTED: 0
All values for this run (952.401685ms):
- CPU temperature (25.446911ms):
--- CPU0_TEMP: 29.8
- system load (31.724819ms):
--- LOAD_PROG_DETECTED: 0
--- LOAD: 0.46
--- CPU_COUNT: 2
- ping to router (831.168606ms):
--- PING_LOSS_PERC: 0
--- PING_AVG_MS: 0.506
- port 80 testing (14.806384ms):
--- PORT80_OPEN: 1
Unique failure ID: xxxxxxxxxx
'
curl -w "%{http_code}\n" -XPOST \
--form-string 'type=BAD' \
--form-string 'subject=[GOOD] QClone: heavy system load (system load)' \
--form-string "details=$DETAILS_BAD" \
--form-string 'classes=general' \
--form-string 'hostname=Julien-XPS13' \
--form-string 'nosee_srv=Devel' \
--form-string 'uniqueid=96f5018e-9376-4d18-9052-6c4bf42e36d6' \
--form-string 'datetime=2017-06-08T05:10:55+02:00' \
'http://localhost:8080/alerts'
curl -w "%{http_code}\n" -XPOST \
--form-string 'type=GOOD' \
--form-string 'subject=[GOOD] QClone: heavy system load (system load)' \
--form-string "details=$DETAILS_GOOD" \
--form-string 'classes=general' \
--form-string 'hostname=Julien-XPS13' \
--form-string 'nosee_srv=Devel' \
--form-string 'uniqueid=96f5018e-9376-4d18-9052-6c4bf42e36d6' \
--form-string 'datetime=2017-06-08T05:18:55+02:00' \
'http://localhost:8080/alerts'