forked from zampat/icinga2-monitoring-templates
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path4001a-st_linux_agent-OS-Basic.sh
62 lines (56 loc) · 1.33 KB
/
4001a-st_linux_agent-OS-Basic.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
#
#Services (as template)
# HowTo Export:
# # icingacli director service show Agent_Win_Service --json
#
######
## Services for Linux monitoring with Icinga Agent
######
# Service Template for Service Set
RES=`icingacli director service exists "Agent_Linux_Diskspace"`
if [[ $RES =~ "does not exist" ]]
then
echo "Service 'Agent_Linux_Diskspace' does not exists"
icingacli director service create --json '
{
"check_command": "disk",
"imports": [
"generic_agent"
],
"object_name": "Agent_Linux_Diskspace",
"object_type": "template"
}
'
fi
# Service Template for Service Set
RES=`icingacli director service exists "Agent_Linux_Memory"`
if [[ $RES =~ "does not exist" ]]
then
echo "Service 'Agent_Linux_Memory' does not exists"
icingacli director service create --json '
{
"check_command": "mem",
"imports": [
"generic_agent"
],
"object_name": "Agent_Linux_Memory",
"object_type": "template"
}
'
fi
# Service Template for Service Set
RES=`icingacli director service exists "Agent_Linux_Load"`
if [[ $RES =~ "does not exist" ]]
then
echo "Service 'Agent_Linux_Load' does not exists"
icingacli director service create --json '
{
"check_command": "load",
"imports": [
"generic_agent"
],
"object_name": "Agent_Linux_Load",
"object_type": "template"
}
'
fi