-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathstart.sh
38 lines (30 loc) · 839 Bytes
/
start.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
#!/bin/bash
#Install OMS Agent
/omsagent-1.6.0-42.universal.x64.sh --upgrade -w ${WSID} -s ${SECRET}
#Create config file to read JSON endpoint
serverdetails_conf="/etc/opt/microsoft/omsagent/${WSID}/conf/omsagent.d/serverdetails.conf"
cat > ${serverdetails_conf} << EOF
<source>
type exec
command 'curl ${URL}'
format json
tag oms.api.${NAME}
run_interval 30s
</source>
<match oms.api.${NAME}>
type out_oms_api
log_level info
buffer_chunk_limit 5m
buffer_type file
buffer_path /var/opt/microsoft/omsagent/${WSID}/state/out_oms_api_${NAME}*.buffer
buffer_queue_limit 10
flush_interval 20s
retry_limit 10
retry_wait 30s
</match>
EOF
#Give permission to OMS Agent to access the config file
chown omsagent:omiusers ${serverdetails_conf}
#Restart the OMS Agent
service omsagent-${WSID} restart
sleep infinity