-
Notifications
You must be signed in to change notification settings - Fork 24
/
030_ressources_init.sh
executable file
·51 lines (43 loc) · 1.13 KB
/
030_ressources_init.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
#!/bin/bash
# Add default ressources to icingaweb2 config
# file: resources.ini
#Define Variables
# ARG1: ICINGA2_CONF_HOME_DIR="/neteye/shared/icingaweb2/conf"
FILE_RESSOURCES="$1/resources.ini"
# Check if a demo Ressource for LDAP exists
grep "ldap" $FILE_RESSOURCES > /dev/null 2>&1
RES=$?
if [ $RES -ne 0 ]
then
echo "[i] 030: Adding LDAP configuration sample to Icinga2 Ressources."
cat >>$FILE_RESSOURCES <<EOM
[ldap_bind.sample (change also auth.>user and auth.>groups)]
type = "ldap"
hostname = "mydomain.lan"
port = "389"
encryption = "none"
root_dn = "dc=mydomain,dc=local"
bind_dn = "[email protected]"
bind_pw = "password"
[ldap_multiple_DCs]
type = "ldap"
hostname = "ldap://dc1.mydomain.local:389 ldap://dc2.mydomain.local:389"
port = "389"
encryption = "none"
root_dn = "dc=mydomain,dc=local"
bind_dn = "[email protected]"
bind_pw = "password"
[Sample remote MYSQL ressource]
type = "db"
db = "mysql"
host = "192.168.200.200"
port = "3306"
dbname = "dbname"
username = "username"
password = "password"
charset = "utf8"
use_ssl = "0"
EOM
else
echo "[ ] 030: LDAP configuration in Icinga2 Ressources already exists."
fi