-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathcentreon_central_1810_uninstall.sh
executable file
·622 lines (509 loc) · 18.7 KB
/
centreon_central_1810_uninstall.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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
#!/bin/bash
# uninstall script Centreon for Debian Stretch
# v 1.00
# 23/09/2019
#
#
export DEBIAN_FRONTEND=noninteractive
# Variables
## Versions
VERSION_BATCH="v 1.00"
CLIB_VER="18.10.0"
CONNECTOR_VER="18.10.0"
ENGINE_VER="18.10.0"
PLUGIN_VER="2.2"
PLUGIN_CENTREON_VER="20190704"
BROKER_VER="18.10.1"
CENTREON_VER="18.10.7"
# MariaDB Series
MARIADB_VER='10.0'
## Sources URL
BASE_URL="http://files.download.centreon.com/public"
CLIB_URL="${BASE_URL}/centreon-clib/centreon-clib-${CLIB_VER}.tar.gz"
CONNECTOR_URL="${BASE_URL}/centreon-connectors/centreon-connectors-${CONNECTOR_VER}.tar.gz"
ENGINE_URL="${BASE_URL}/centreon-engine/centreon-engine-${ENGINE_VER}.tar.gz"
PLUGIN_URL="https://www.monitoring-plugins.org/download/monitoring-plugins-${PLUGIN_VER}.tar.gz"
PLUGIN_CENTREON_URL="${BASE_URL}/centreon-plugins/centreon-plugins-${PLUGIN_CENTREON_VER}.tar.gz"
BROKER_URL="${BASE_URL}/centreon-broker/centreon-broker-${BROKER_VER}.tar.gz"
CENTREON_URL="${BASE_URL}/centreon/centreon-web-${CENTREON_VER}.tar.gz"
CLAPI_URL="${BASE_URL}/Modules/CLAPI/centreon-clapi-${CLAPI_VER}.tar.gz"
## Sources widgetsMonitoring engine init.d script
WIDGET_HOST_VER="18.10.1"
WIDGET_HOSTGROUP_VER="18.10.0"
WIDGET_SERVICE_VER="18.10.2"
WIDGET_SERVICEGROUP_VER="18.10.0"
WIDGET_GRID_MAP_VER="18.10.0"
WIDGET_TOP_CPU_VER="18.10.0"
WIDGET_TOP_MEMORY_VER="18.10.0"
WIDGET_TACTICAL_OVERVIEW_VER="18.10.0"
WIDGET_HTTP_LOADER_VER="18.10.0"
WIDGET_ENGINE_STATUS_VER="18.10.0"
WIDGET_GRAPH_VER="18.10.0"
WIDGET_BASE="http://files.download.centreon.com/public/centreon-widgets"
WIDGET_HOST="${WIDGET_BASE}/centreon-widget-host-monitoring/centreon-widget-host-monitoring-${WIDGET_HOST_VER}.tar.gz"
WIDGET_HOSTGROUP="${WIDGET_BASE}/centreon-widget-hostgroup-monitoring/centreon-widget-hostgroup-monitoring-${WIDGET_HOSTGROUP_VER}.tar.gz"
WIDGET_SERVICE="${WIDGET_BASE}/centreon-widget-service-monitoring/centreon-widget-service-monitoring-${WIDGET_SERVICE_VER}.tar.gz"
WIDGET_SERVICEGROUP="${WIDGET_BASE}/centreon-widget-servicegroup-monitoring/centreon-widget-servicegroup-monitoring-${WIDGET_SERVICEGROUP_VER}.tar.gz"
WIDGET_GRID_MAP="${WIDGET_BASE}/centreon-widget-grid-map/centreon-widget-grid-map-${WIDGET_GRID_MAP_VER}.tar.gz"
WIDGET_TOP_CPU="https://github.com/centreon/centreon-widget-live-top10-cpu-usage.git"
WIDGET_TOP_MEMORY="https://github.com/centreon/centreon-widget-live-top10-memory-usage.git"
WIDGET_TACTICAL_OVERVIEW="${WIDGET_BASE}/centreon-widget-tactical-overview/centreon-widget-tactical-overview-${WIDGET_TACTICAL_OVERVIEW_VER}.tar.gz"
WIDGET_HTTP_LOADER="${WIDGET_BASE}/centreon-widget-httploader/centreon-widget-httploader-${WIDGET_HTTP_LOADER_VER}.tar.gz"
WIDGET_ENGINE_STATUS="${WIDGET_BASE}/centreon-widget-engine-status/centreon-widget-engine-status-${WIDGET_ENGINE_STATUS_VER}.tar.gz"
WIDGET_GRAPH="${WIDGET_BASE}/centreon-widget-graph-monitoring/centreon-widget-graph-monitoring-${WIDGET_GRAPH_VER}.tar.gz"
## nrpe
NRPE_VERSION="3.2.1"
NRPE_URL="https://github.com/NagiosEnterprises/nrpe/archive/nrpe-3.2.1.tar.gz"
## source script
DIR_SCRIPT=$(cd $( dirname ${BASH_SOURCE[0]}) && pwd )
## Temp install dir
DL_DIR="/usr/local/src"
## Install dir
INSTALL_DIR="/usr/share"
## Log install file
INSTALL_LOG=${DL_DIR}"/centreon-install.log"
## Set mysql-server root password
MYSQL_PASSWORD="password"
## Users and groups
ENGINE_USER="centreon-engine"
ENGINE_GROUP="centreon-engine"
BROKER_USER="centreon-broker"
BROKER_GROUP="centreon-broker"
CENTREON_USER="centreon"
CENTREON_GROUP="centreon"
## TMPL file (template install file for Centreon)
CENTREON_TMPL="centreon_engine.tmpl"
ETH0_IP=`/sbin/ip route get 8.8.8.8 | /usr/bin/awk 'NR==1 {print $NF}'`
## TimeZone php
VARTIMEZONE="Europe/Paris"
## verbose script
SCRIPT_VERBOSE=false
# Usage info
show_help() {
cat << EOF
Usage: ${0##*/} -n=[yes|no] -v
This program create Central Centreon
-n|--nrpe : add check_nrpe
-v|--verbose : add messages
-h|--help : help
EOF
}
function text_params () {
ESC_SEQ="\x1b["
bold=`tput bold`
normal=`tput sgr0`
COL_RESET=$ESC_SEQ"39;49;00m"
COL_GREEN=$ESC_SEQ"32;01m"
COL_RED=$ESC_SEQ"31;01m"
STATUS_FAIL="[$COL_RED${bold}FAIL${normal}$COL_RESET]"
STATUS_OK="[$COL_GREEN${bold} OK ${normal}$COL_RESET]"
}
function nonfree_uninstall () {
[ "$SCRIPT_VERBOSE" = true ] && echo "
======================================================================
Add Stretch repo for non-free
======================================================================
" | tee -a ${INSTALL_LOG}
rm /etc/apt/sources.list.d/stretch-nonfree.list
}
function mariadb_uninstall() {
[ "$SCRIPT_VERBOSE" = true ] && echo "
======================================================================
Uninstall BDD Centreon
======================================================================
" | tee -a ${INSTALL_LOG}
/usr/bin/mysql <<EOF
drop database centreon;
drop database centreon_storage;
use mysql;
drop user 'centreon'@'localhost';
EOF
}
function clib_uninstall () {
[ "$SCRIPT_VERBOSE" = true ] && echo "
======================================================================
uninstall Clib
======================================================================
" | tee -a ${INSTALL_LOG}
cd ${DL_DIR}
if [[ -e centreon-clib-${CLIB_VER}.tar.gz ]] ;
then
rm centreon-clib-${CLIB_VER}.tar.gz
rm -rf centreon-clib-${CLIB_VER}/
fi
[ "$SCRIPT_VERBOSE" = true ] && echo "====> Delete files" | tee -a ${INSTALL_LOG}
rm /usr/lib/pkgconfig/centreon-clib.pc
rm /usr/lib/libcentreon_clib.so
rm -rf /usr/include/com/centreon/
}
function centreon_connectors_uninstall () {
[ "$SCRIPT_VERBOSE" = true ] && echo "
======================================================================
Uninstall Centreon connectors
======================================================================
" | tee -a ${INSTALL_LOG}
cd ${DL_DIR}
if [[ -e centreon-connectors-${CONNECTOR_VER}.tar.gz ]]
then
rm centreon-connectors-${CONNECTOR_VER}.tar.gz
rm -rf centreon-connector-${CONNECTOR_VER}/
fi
[ "$SCRIPT_VERBOSE" = true ] && echo "====> Delete files" | tee -a ${INSTALL_LOG}
rm /usr/lib/centreon-connector/centreon_connector_perl
rm /usr/lib/centreon-connector/centreon_connector_ssh
}
function centreon_engine_uninstall () {
[ "$SCRIPT_VERBOSE" = true ] && echo "
======================================================================
Uninstall Centreon Engine
======================================================================
" | tee -a ${INSTALL_LOG}
systemctl stop centengine.service >> ${INSTALL_LOG}
systemctl disable centengine.service >> ${INSTALL_LOG}
systemctl daemon-reload >> ${INSTALL_LOG}
cd ${DL_DIR}
if [[ -e centreon-engine-${ENGINE_VER}.tar.gz ]]
then
rm centreon-engine-${ENGINE_VER}.tar.gz
rm -rf centreon-engine-${ENGINE_VER}/
fi
[ "$SCRIPT_VERBOSE" = true ] && echo "====> Delete Files" | tee -a ${INSTALL_LOG}
rm /usr/lib/pkgconfig/centengine.pc
rm /lib/systemd/system/centengine.service
rm /etc/logrotate.d/centengine
rm /usr/sbin/centengine
rm /usr/sbin/centenginestats
rm -rf /usr/include/centreon-engine/
rm -rf /etc/centreon-engine/
rm -rf /var/log/centreon-engine/
rm /usr/lib/centreon-engine/externalcmd.so
groupdel ${ENGINE_GROUP}
userdel -r ${ENGINE_GROUP}
}
function monitoring_plugin_uninstall () {
[ "$SCRIPT_VERBOSE" = true ] && echo "
======================================================================
Uninstall Monitoring Plugins
======================================================================
" | tee -a ${INSTALL_LOG}
cd ${DL_DIR}
if [[ -e monitoring-plugins-${PLUGIN_VER}.tar.gz ]]
then
rm monitoring-plugins-${PLUGIN_VER}.tar.gz
rm -rf monitoring-plugins-${PLUGIN_VER}/
fi
[ "$SCRIPT_VERBOSE" = true ] && echo "====> Delete files" | tee -a ${INSTALL_LOG}
rm -rf /usr/lib/nagios/
}
function centreon_plugins_uninstall() {
[ "$SCRIPT_VERBOSE" = true ] && echo "
=======================================================================
Uninstall Centreon Plugins
=======================================================================
" | tee -a ${INSTALL_LOG}
cd ${DL_DIR}
if [[ -e centreon-plugins-${PLUGIN_CENTREON_VER}.tar.gz ]]
then
rm centreon-plugins-${PLUGIN_CENTREON_VER}.tar.gz
rm -rf centreon-plugins-${PLUGIN_CENTREON_VER}/
fi
rm -rf /usr/lib/centreon/plugins/
}
function centreon_broker_uninstall() {
[ "$SCRIPT_VERBOSE" = true ] && echo "
======================================================================
Uninstall Centreon Broker
======================================================================
" | tee -a ${INSTALL_LOG}
[ "$SCRIPT_VERBOSE" = true ] && echo "
================== Uninstall rrdtools 1.4.7 =====================
" | tee -a ${INSTALL_LOG}
cd ${DL_DIR}
rm rrdtool-1.4.7.tar.gz
rm -rf rrdtool-1.4.7/
[ "$SCRIPT_VERBOSE" = true ] && echo "====> Delete files" | tee -a ${INSTALL_LOG}
rm /usr/lib/pkgconfig/librrd.pc
rm /etc/ld.so.conf.d/rrdtool-broker.conf
rm -rf /opt/
cd ${DL_DIR}
if [[ -e centreon-broker-${BROKER_VER}.tar.gz ]]
then
rm centreon-broker-${BROKER_VER}.tar.gz
rm -rf centreon-broker-${BROKER_VER}/
fi
[ "$SCRIPT_VERBOSE" = true ] && echo "====> Delete files" | tee -a ${INSTALL_LOG}
systemctl stop cbd.service >> ${INSTALL_LOG}
systemctl disable cbd.service >> ${INSTALL_LOG}
systemctl daemon-reload >> ${INSTALL_LOG}
rm -rf /var/log/centreon-broker/
rm -rf /var/lib/centreon-broker/
rm /lib/systemd/system/cbd.service
rm -rf /etc/centreon-broker/
rm /usr/sbin/cbd
rm -rf /usr/include/centreon-broker/
rm /usr/sbin/cbwd
rm -rf /usr/share/centreon/lib/centreon-broker/
rm -rf /usr/lib/centreon-broker/
rm -rf /var/log/centreon-broker/
groupdel ${BROKER_GROUP}
userdel -r ${BROKER_GROUP}
}
function php_fpm_uninstall() {
[ "$SCRIPT_VERBOSE" = true ] && echo "
======================================================================
Uninstall Php-fpm
======================================================================
" | tee -a ${INSTALL_LOG}
rm /etc/apt/sources.list.d/php.list
}
function uninstall_centreon_tmpl() {
[ "$SCRIPT_VERBOSE" = true ] && echo "
======================================================================
Centreon template generation
======================================================================
" | tee -a ${INSTALL_LOG}
rm ${DL_DIR}/${CENTREON_TMPL}
}
function centreon_uninstall () {
[ "$SCRIPT_VERBOSE" = true ] && echo "
======================================================================
Uninstall Centreon Web Interface
======================================================================
" | tee -a ${INSTALL_LOG}
cd ${DL_DIR}
if [[ -e centreon-web-${CENTREON_VER}.tar.gz ]]
then
rm centreon-web-${CENTREON_VER}.tar.gz
rm -rf centreon-web-${CENTREON_VER}/
fi
groupdel ${CENTREON_GROUP}
userdel -r ${CENTREON_GROUP}
}
function post_uninstall () {
[ "$SCRIPT_VERBOSE" = true ] && echo "
=====================================================================
Post install
=====================================================================
" | tee -a ${INSTALL_LOG}
#delete files
rm -rf ${INSTALL_DIR}/centreon/
rm /etc/mysql/conf.d/centreon.cnf
rm -rf /var/log/centreon/
rm -rf /usr/share/perl5/centreon/
rm /var/lib/apache2/conf/disabled_by_admin/centreon
rm /etc/sudoers.d/centreon
rm /etc/php/7.1/fpm/pool.d/centreon.conf
rm /etc/cron.d/centreon
rm /etc/cron.d/centstorage
rm -rf /etc/centreon/
rm /etc/rc0.d/K01centreontrapd
rm /etc/rc1.d/K01centreontrapd
rm /etc/rc2.d/S01centreontrapd
rm /etc/rc3.d/S01centreontrapd
rm /etc/rc4.d/S01centreontrapd
rm /etc/rc5.d/S01centreontrapd
rm /etc/rc6.d/K01centreontrapd
rm -rf /etc/snmp/centreon_traps/
rm /etc/default/centreontrapd
rm /etc/init.d/centreontrapd
rm /etc/logrotate.d/centreon
rm /etc/logrotate.d/centreontrapd
a2disconf centreon.conf >> ${INSTALL_LOG}
systemctl restart apache2 php7.1-fpm >> ${INSTALL_LOG}
rm /etc/apache2/conf-available/centreon.conf
rm -rf /var/lib/centreon/
}
##ADDONS
function widget_uninstall() {
[ "$SCRIPT_VERBOSE" = true ] && echo "
=======================================================================
Uninstall WIDGETS
=======================================================================
" | tee -a ${INSTALL_LOG}
cd ${DL_DIR}
rm -rf centreon-widget-live-top10-cpu-usage/
rm -rf centreon-widget-live-top10-memory-usage/
}
function add_check_nrpe() {
[ "$SCRIPT_VERBOSE" = true ] && echo "
=======================================================================
Install check_nrpe3
=======================================================================
" | tee -a ${INSTALL_LOG}
cd ${DL_DIR}
if [[ -e nrpe.tar.gz ]] ;
then
rm nrpe.tar.gz
rm -rf nrpe-nrpe-${NRPE_VERSION}/
fi
[ "$SCRIPT_VERBOSE" = true ] && echo "====> Delete Files" | tee -a ${INSTALL_LOG}
}
function main () {
if [ "$ADD_NRPE" == "yes" ]
then
echo "
================| Centreon Central Uninstall details $VERSION_BATCH |============
MariaDB : ${MARIADB_VER}
Clib : ${CLIB_VER}
Connector : ${CONNECTOR_VER}
Engine : ${ENGINE_VER}
Plugins : ${PLUGIN_VER} & ${PLUGIN_CENTREON_VER}
Broker : ${BROKER_VER}
Centreon : ${CENTREON_VER}
NRPE : ${NRPE_VERSION}
Install dir: ${INSTALL_DIR}
Source dir : ${DL_DIR}
======================================================================
"
else
echo "
================| Centreon Central Uninstall details $VERSION_BATCH |============
MariaDB : ${MARIADB_VER}
Clib : ${CLIB_VER}
Connector : ${CONNECTOR_VER}
Engine : ${ENGINE_VER}
Plugins : ${PLUGIN_VER} & ${PLUGIN_CENTREON_VER}
Broker : ${BROKER_VER}
Centreon : ${CENTREON_VER}
Install dir: ${INSTALL_DIR}
Source dir : ${DL_DIR}
======================================================================
"
fi
text_params
nonfree_uninstall 2>> ${INSTALL_LOG}
if [[ $? -ne 0 ]];
then
echo -e "${bold}Step1${normal} => repo non-free on Stretch Uninstall ${STATUS_FAIL}"
else
echo -e "${bold}Step1${normal} => repo non-free on Stretch Uninstall ${STATUS_OK}"
fi
mariadb_uninstall 2>>${INSTALL_LOG}
if [[ $? -ne 0 ]];
then
echo -e "${bold}Step2${normal} => Uninstall BDD Centreon ${STATUS_FAIL}"
else
echo -e "${bold}Step2${normal} => Uninstall BDD Centreon ${STATUS_OK}"
fi
clib_uninstall 2>>${INSTALL_LOG}
if [[ $? -ne 0 ]];
then
echo -e "${bold}Step3${normal} => Clib uninstall ${STATUS_FAIL}"
else
echo -e "${bold}Step3${normal} => Clib uninstall ${STATUS_OK}"
fi
centreon_connectors_uninstall 2>>${INSTALL_LOG}
if [[ $? -ne 0 ]];
then
echo -e "${bold}Step4${normal} => Centreon Perl and SSH connectors uninstall ${STATUS_FAIL}"
else
echo -e "${bold}Step4${normal} => Centreon Perl and SSH connectors uninstall ${STATUS_OK}"
fi
centreon_engine_uninstall 2>>${INSTALL_LOG}
if [[ $? -ne 0 ]];
then
echo -e "${bold}Step5${normal} => Centreon Engine uninstall ${STATUS_FAIL}"
else
echo -e "${bold}Step5${normal} => Centreon Engine uninstall ${STATUS_OK}"
fi
monitoring_plugin_uninstall 2>>${INSTALL_LOG}
if [[ $? -ne 0 ]];
then
echo -e "${bold}Step6${normal} => Monitoring plugins uninstall ${STATUS_FAIL}"
else
echo -e "${bold}Step6${normal} => Monitoring plugins uninstall ${STATUS_OK}"
fi
centreon_plugins_uninstall 2>>${INSTALL_LOG}
if [[ $? -ne 0 ]];
then
echo -e "${bold}Step7${normal} => Centreon plugins uninstall ${STATUS_FAIL}"
else
echo -e "${bold}Step7${normal} => Centreon plugins uninstall ${STATUS_OK}"
fi
centreon_broker_uninstall 2>>${INSTALL_LOG}
if [[ $? -ne 0 ]];
then
echo -e "${bold}Step8${normal} => Centreon Broker uninstall ${STATUS_FAIL}"
else
echo -e "${bold}Step8${normal} => Centreon Broker uninstall ${STATUS_OK}"
fi
php_fpm_uninstall 2>>${INSTALL_LOG}
if [[ $? -ne 0 ]];
then
echo -e "${bold}Step9${normal} => Php-fpm uninstall ${STATUS_FAIL}"
else
echo -e "${bold}Step9${normal} => Php-fpm uninstall ${STATUS_OK}"
fi
uninstall_centreon_tmpl 2>>${INSTALL_LOG}
if [[ $? -ne 0 ]];
then
echo -e "${bold}Step10${normal} => Uninstall Centreon template ${STATUS_FAIL}"
else
echo -e "${bold}Step10${normal} => Uninstall Centreon template ${STATUS_OK}"
fi
centreon_uninstall 2>>${INSTALL_LOG}
if [[ $? -ne 0 ]];
then
echo -e "${bold}Step11${normal} => Centreon web interface uninstall ${STATUS_FAIL}"
else
echo -e "${bold}Step11${normal} => Centreon web interface uninstall ${STATUS_OK}"
fi
post_uninstall 2>>${INSTALL_LOG}
if [[ $? -ne 0 ]];
then
echo -e "${bold}Step12${normal} => Post uninstall ${STATUS_FAIL}"
else
echo -e "${bold}Step12${normal} => Post uninstall ${STATUS_OK}"
fi
widget_uninstall 2>>${INSTALL_LOG}
if [[ $? -ne 0 ]];
then
echo -e "${bold}Step13${normal} => Widgets uninstall ${STATUS_FAIL}"
else
echo -e "${bold}Step13${normal} => Widgets uninstall ${STATUS_OK}"
fi
if [ "$ADD_NRPE" == "yes" ]
then
add_check_nrpe 2>>${INSTALL_LOG}
if [[ $? -ne 0 ]];
then
echo -e "${bold}Step14${normal} => Nrpe install ${STATUS_FAIL}"
else
echo -e "${bold}Step14${normal} => Nrpe install ${STATUS_OK}"
fi
fi
echo ""
echo "##### Install completed #####" | tee -a ${INSTALL_LOG}
}
#check menu
for i in "$@"
do
case $i in
-n=*|--nrpe=*)
ADD_NRPE="${i#*=}"
shift # past argument=value
;;
-v|--verbose)
SCRIPT_VERBOSE=true
shift # past argument=value
;;
-h|--help)
show_help
exit 2
;;
*)
# unknown option
;;
esac
done
# Check NRPE yes/no
if [[ $ADD_NRPE =~ ^[yY][eE][sS]|[yY]$ ]]; then
ADD_NRPE="yes"
else
ADD_NRPE="no"
fi
# Exec main function
main
echo -e ""
echo -e "${bold}Go to http://${ETH0_IP}/centreon to complete the setup${normal} "
echo -e ""