├── README.md
├── alertscripts
└── alerta_telegram.py
├── apache
├── apache.sh
└── zbx_template_apache.xml
├── conf
├── userparameters_mysql.conf
└── zabbix.conf
├── install-zabbix-glpi
└── integraGZ.sh
├── port-scan
├── tcp-port-scan-lld.sh
└── zbx_template_tcp_port_scan_lld.xml
└── templates
└── os-android.xml
/README.md:
--------------------------------------------------------------------------------
1 | # Script Zabbix
2 | Scripts para utilização de monitoramento diversos com o NMS Zabbix
3 |
4 |
5 | Monitoramento Apache
6 | Necessário habilitar server-status do Apache.
7 |
8 | Monitoramento de portas TCP com LLD
9 | Necessário instalar pacote nmap
10 | Copiar script .sh para diretório externalscripts do Zabbix
11 | Importar o template e associar aos hosts desejados
12 |
13 | Instalação automática do Zabbix com GLPI
14 | O script integraGZ.sh faz a instalação automática do Zabbix e do GLPI e prepara a integração entre os dois sitemas, bastando apenas configurar a ação necessária para abrir o chamado no GLPI após a ocorrência de um incidente no Zabbix.
15 |
--------------------------------------------------------------------------------
/alertscripts/alerta_telegram.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/python
2 | # -*- coding: utf-8 -*-
3 | import telebot as tb
4 | import sys
5 | API_TOKEN=''
6 | DESTINATARIO=sys.argv[1]
7 | ASSUNTO=sys.argv[2]
8 | MENSAGEM=sys.argv[3].replace('/n','\n')
9 | alerta = tb.TeleBot(API_TOKEN)
10 | alerta.send_message(DESTINATARIO, ASSUNTO + '\n' + MENSAGEM, disable_web_page_preview=True, parse_mode='HTML')
11 |
--------------------------------------------------------------------------------
/apache/apache.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | #######################################################################################################
3 | # Autor: Janssen dos Reis Lima #
4 | # Data atualizacao: 01/09/2016 #
5 | # Changelog: #
6 | # - Alteração da variável 'tmp' #
7 | # - Inclusão de CPULoad após atualização do Apache ter adicionado essa métrica no server-status #
8 | # - Inclusão de verificação da versão do Apache em execução no servidor #
9 | #######################################################################################################
10 | host="localhost"
11 | resposta=0
12 | tmp="/tmp/apache_status"
13 | pega_status=`wget --quiet -O $tmp http://$host/server-status?auto`
14 | case $1 in
15 | TotalAccesses)
16 | $pega_status
17 | fgrep "Total Accesses:" $tmp | awk '{print $3}'
18 | resposta=$?;;
19 | TotalKBytes)
20 | $pega_status
21 | fgrep "Total kBytes:" $tmp | awk '{print $3}'
22 | resposta=$?;;
23 | CPULoad)
24 | $pega_status
25 | fgrep "CPULoad:" $tmp | awk '{print $2}'
26 | resposta=$?;;
27 | Uptime)
28 | $pega_status
29 | fgrep "Uptime:" $tmp | awk '{print $2}'
30 | resposta=$?;;
31 | ReqPerSec)
32 | $pega_status
33 | fgrep "ReqPerSec:" $tmp | awk '{print $2}'
34 | resposta=$?;;
35 | BytesPerSec)
36 | $pega_status
37 | fgrep "BytesPerSec:" $tmp | awk '{print $2}'
38 | resposta=$?;;
39 | BytesPerReq)
40 | $pega_status
41 | fgrep "BytesPerReq:" $tmp | awk '{print $2}'
42 | resposta=$?;;
43 | BusyWorkers)
44 | $pega_status
45 | fgrep "BusyWorkers:" $tmp | awk '{print $2}'
46 | resposta=$?;;
47 | IdleWorkers)
48 | $pega_status
49 | fgrep "IdleWorkers:" $tmp | awk '{print $2}'
50 | resposta=$?;;
51 | WaitingForConnection)
52 | $pega_status
53 | fgrep "Scoreboard:" $tmp | awk '{print $2}'| awk 'BEGIN { FS = "_" } ; { print NF-1 }'
54 | resposta=$?;;
55 | StartingUp)
56 | $pega_status
57 | fgrep "Scoreboard:" $tmp | awk '{print $2}'| awk 'BEGIN { FS = "S" } ; { print NF-1 }'
58 | resposta=$?;;
59 | ReadingRequest)
60 | $pega_status
61 | fgrep "Scoreboard:" $tmp| awk '{print $2}'| awk 'BEGIN { FS = "R" } ; { print NF-1 }'
62 | resposta=$?;;
63 | SendingReply)
64 | $pega_status
65 | fgrep "Scoreboard:" $tmp | awk '{print $2}'| awk 'BEGIN { FS = "W" } ; { print NF-1 }'
66 | resposta=$?;;
67 | KeepAlive)
68 | $pega_status
69 | fgrep "Scoreboard:" $tmp | awk '{print $2}'| awk 'BEGIN { FS = "K" } ; { print NF-1 }'
70 | resposta=$?;;
71 | DNSLookup)
72 | $pega_status
73 | fgrep "Scoreboard:" $tmp | awk '{print $2}'| awk 'BEGIN { FS = "D" } ; { print NF-1 }'
74 | resposta=$?;;
75 | ClosingConnection)
76 | $pega_status
77 | fgrep "Scoreboard:" $tmp | awk '{print $2}'| awk 'BEGIN { FS = "C" } ; { print NF-1 }'
78 | resposta=$?;;
79 | Logging)
80 | $pega_status
81 | fgrep "Scoreboard:" $tmp | awk '{print $2}'| awk 'BEGIN { FS = "L" } ; { print NF-1 }'
82 | resposta=$?;;
83 | GracefullyFinishing)
84 | $pega_status
85 | fgrep "Scoreboard:" $tmp | awk '{print $2}'| awk 'BEGIN { FS = "G" } ; { print NF-1 }'
86 | resposta=$?;;
87 | IdleCleanupOfWorker)
88 | $pega_status
89 | fgrep "Scoreboard:" $tmp | awk '{print $2}'| awk 'BEGIN { FS = "I" } ; { print NF-1 }'
90 | resposta=$?;;
91 | OpenSlotWithNoCurrentProcess)
92 | $pega_status
93 | fgrep "Scoreboard:" $tmp | awk '{print $2}'| awk 'BEGIN { FS = "." } ; { print NF-1 }'
94 | resposta=$?;;
95 | version)
96 | /usr/sbin/apachectl -v | grep "version" | cut -f2 -d "/" | awk '{print $1}'
97 | resposta=$?;;
98 | *)
99 | echo "ZBX_NOTSUPPORTED"
100 | esac
101 | if [ "$resposta" -ne 0 ]; then
102 | echo "ZBX_NOTSUPPORTED"
103 | fi
104 | exit $resposta
105 |
--------------------------------------------------------------------------------
/apache/zbx_template_apache.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | 2.0
4 | 2015-10-26T13:11:06Z
5 |
6 |
7 | Templates
8 |
9 |
10 |
11 |
12 | Template Apache Server Status
13 | Template Apache Server Status
14 |
15 |
16 |
17 | Templates
18 |
19 |
20 |
21 |
22 | Apache Server
23 |
24 |
25 |
26 | -
27 | Apache/BytesPerReq.
28 | 0
29 |
30 | 0
31 |
32 | apache[BytesPerReq]
33 | 60
34 | 7
35 | 365
36 | 0
37 | 0
38 |
39 |
40 | 0
41 |
42 |
43 | 0
44 | 0
45 |
46 | 0
47 |
48 | 0
49 |
50 |
51 |
52 | 0
53 | 0
54 |
55 |
56 |
57 |
58 |
59 |
60 | 0
61 |
62 |
63 | Apache Server
64 |
65 |
66 |
67 |
68 |
69 | -
70 | Apache/BytesPerSec.
71 | 0
72 |
73 | 0
74 |
75 | apache[BytesPerSec]
76 | 60
77 | 7
78 | 365
79 | 0
80 | 0
81 |
82 |
83 | 0
84 |
85 |
86 | 0
87 | 0
88 |
89 | 0
90 |
91 | 0
92 |
93 |
94 |
95 | 0
96 | 0
97 |
98 |
99 |
100 |
101 |
102 |
103 | 0
104 |
105 |
106 | Apache Server
107 |
108 |
109 |
110 |
111 |
112 | -
113 | Apache/ClosingConnection.
114 | 0
115 |
116 | 0
117 |
118 | apache[ClosingConnection]
119 | 60
120 | 7
121 | 365
122 | 0
123 | 0
124 |
125 |
126 | 0
127 |
128 |
129 | 0
130 | 0
131 |
132 | 0
133 |
134 | 0
135 |
136 |
137 |
138 | 0
139 | 0
140 |
141 |
142 |
143 |
144 |
145 |
146 | 0
147 |
148 |
149 | Apache Server
150 |
151 |
152 |
153 |
154 |
155 | -
156 | Apache/CPULoad
157 | 0
158 |
159 | 0
160 |
161 | apache[CPULoad]
162 | 60
163 | 7
164 | 365
165 | 0
166 | 0
167 |
168 |
169 | 0
170 |
171 |
172 | 0
173 | 0
174 |
175 | 0
176 |
177 | 1
178 |
179 |
180 |
181 | 0
182 | 0
183 |
184 |
185 |
186 |
187 |
188 |
189 | 0
190 |
191 |
192 | Apache Server
193 |
194 |
195 |
196 |
197 |
198 | -
199 | Apache/DNSLookup.
200 | 0
201 |
202 | 0
203 |
204 | apache[DNSLookup]
205 | 60
206 | 7
207 | 365
208 | 0
209 | 0
210 |
211 |
212 | 0
213 |
214 |
215 | 0
216 | 0
217 |
218 | 0
219 |
220 | 0
221 |
222 |
223 |
224 | 0
225 | 0
226 |
227 |
228 |
229 |
230 |
231 |
232 | 0
233 |
234 |
235 | Apache Server
236 |
237 |
238 |
239 |
240 |
241 | -
242 | Apache/GracefullyFinishing.
243 | 0
244 |
245 | 0
246 |
247 | apache[GracefullyFinishing]
248 | 60
249 | 7
250 | 365
251 | 0
252 | 3
253 |
254 |
255 | 0
256 |
257 |
258 | 0
259 | 0
260 |
261 | 0
262 |
263 | 0
264 |
265 |
266 |
267 | 0
268 | 0
269 |
270 |
271 |
272 |
273 |
274 |
275 | 0
276 |
277 |
278 | Apache Server
279 |
280 |
281 |
282 |
283 |
284 | -
285 | Apache/IdleCleanupOfWorker.
286 | 0
287 |
288 | 0
289 |
290 | apache[IdleCleanupOfWorker]
291 | 60
292 | 7
293 | 365
294 | 0
295 | 0
296 |
297 |
298 | 0
299 |
300 |
301 | 0
302 | 0
303 |
304 | 0
305 |
306 | 0
307 |
308 |
309 |
310 | 0
311 | 0
312 |
313 |
314 |
315 |
316 |
317 |
318 | 0
319 |
320 |
321 | Apache Server
322 |
323 |
324 |
325 |
326 |
327 | -
328 | Apache/IdleWorkers.
329 | 0
330 |
331 | 0
332 |
333 | apache[IdleWorkers]
334 | 60
335 | 7
336 | 365
337 | 0
338 | 3
339 |
340 |
341 | 0
342 |
343 |
344 | 0
345 | 0
346 |
347 | 0
348 |
349 | 0
350 |
351 |
352 |
353 | 0
354 | 0
355 |
356 |
357 |
358 |
359 |
360 |
361 | 0
362 |
363 |
364 | Apache Server
365 |
366 |
367 |
368 |
369 |
370 | -
371 | Apache/KeepAlive.
372 | 0
373 |
374 | 0
375 |
376 | apache[KeepAlive]
377 | 60
378 | 7
379 | 365
380 | 0
381 | 0
382 |
383 |
384 | 0
385 |
386 |
387 | 0
388 | 0
389 |
390 | 0
391 |
392 | 0
393 |
394 |
395 |
396 | 0
397 | 0
398 |
399 |
400 |
401 |
402 |
403 |
404 | 0
405 |
406 |
407 | Apache Server
408 |
409 |
410 |
411 |
412 |
413 | -
414 | Apache/Logging.
415 | 0
416 |
417 | 0
418 |
419 | apache[Logging]
420 | 60
421 | 7
422 | 365
423 | 0
424 | 0
425 |
426 |
427 | 0
428 |
429 |
430 | 0
431 | 0
432 |
433 | 0
434 |
435 | 0
436 |
437 |
438 |
439 | 0
440 | 0
441 |
442 |
443 |
444 |
445 |
446 |
447 | 0
448 |
449 |
450 | Apache Server
451 |
452 |
453 |
454 |
455 |
456 | -
457 | Apache/OpenSlotWithNoCurrentProcess.
458 | 0
459 |
460 | 0
461 |
462 | apache[OpenSlotWithNoCurrentProcess]
463 | 60
464 | 7
465 | 365
466 | 0
467 | 0
468 |
469 |
470 | 0
471 |
472 |
473 | 0
474 | 0
475 |
476 | 0
477 |
478 | 0
479 |
480 |
481 |
482 | 0
483 | 0
484 |
485 |
486 |
487 |
488 |
489 |
490 | 0
491 |
492 |
493 | Apache Server
494 |
495 |
496 |
497 |
498 |
499 | -
500 | Apache/ReadingRequest.
501 | 0
502 |
503 | 0
504 |
505 | apache[ReadingRequest]
506 | 60
507 | 7
508 | 365
509 | 0
510 | 0
511 |
512 |
513 | 0
514 |
515 |
516 | 0
517 | 0
518 |
519 | 0
520 |
521 | 0
522 |
523 |
524 |
525 | 0
526 | 0
527 |
528 |
529 |
530 |
531 |
532 |
533 | 0
534 |
535 |
536 | Apache Server
537 |
538 |
539 |
540 |
541 |
542 | -
543 | Apache/ReqPerSec.
544 | 0
545 |
546 | 0
547 |
548 | apache[ReqPerSec]
549 | 60
550 | 7
551 | 365
552 | 0
553 | 0
554 |
555 |
556 | 0
557 |
558 |
559 | 0
560 | 0
561 |
562 | 0
563 |
564 | 0
565 |
566 |
567 |
568 | 0
569 | 0
570 |
571 |
572 |
573 |
574 |
575 |
576 | 0
577 |
578 |
579 | Apache Server
580 |
581 |
582 |
583 |
584 |
585 | -
586 | Apache/SendingReply.
587 | 0
588 |
589 | 0
590 |
591 | apache[SendingReply]
592 | 60
593 | 7
594 | 365
595 | 0
596 | 0
597 |
598 |
599 | 0
600 |
601 |
602 | 0
603 | 0
604 |
605 | 0
606 |
607 | 0
608 |
609 |
610 |
611 | 0
612 | 0
613 |
614 |
615 |
616 |
617 |
618 |
619 | 0
620 |
621 |
622 | Apache Server
623 |
624 |
625 |
626 |
627 |
628 | -
629 | Apache/StartingUp.
630 | 0
631 |
632 | 0
633 |
634 | apache[StartingUp]
635 | 60
636 | 7
637 | 365
638 | 0
639 | 0
640 |
641 |
642 | 0
643 |
644 |
645 | 0
646 | 0
647 |
648 | 0
649 |
650 | 0
651 |
652 |
653 |
654 | 0
655 | 0
656 |
657 |
658 |
659 |
660 |
661 |
662 | 0
663 |
664 |
665 | Apache Server
666 |
667 |
668 |
669 |
670 |
671 | -
672 | Apache/TotalAccesses.
673 | 0
674 |
675 | 0
676 |
677 | apache[TotalAccesses]
678 | 60
679 | 7
680 | 365
681 | 0
682 | 3
683 |
684 |
685 | 0
686 |
687 |
688 | 0
689 | 0
690 |
691 | 0
692 |
693 | 0
694 |
695 |
696 |
697 | 0
698 | 0
699 |
700 |
701 |
702 |
703 |
704 |
705 | 0
706 |
707 |
708 | Apache Server
709 |
710 |
711 |
712 |
713 |
714 | -
715 | Apache/TotalKBytes.
716 | 0
717 |
718 | 0
719 |
720 | apache[TotalKBytes]
721 | 60
722 | 7
723 | 365
724 | 0
725 | 0
726 |
727 |
728 | 0
729 |
730 |
731 | 0
732 | 0
733 |
734 | 0
735 |
736 | 0
737 |
738 |
739 |
740 | 0
741 | 0
742 |
743 |
744 |
745 |
746 |
747 |
748 | 0
749 |
750 |
751 | Apache Server
752 |
753 |
754 |
755 |
756 |
757 | -
758 | Apache/Uptime.
759 | 0
760 |
761 | 0
762 |
763 | apache[Uptime]
764 | 60
765 | 7
766 | 365
767 | 0
768 | 0
769 |
770 |
771 | 0
772 |
773 |
774 | 0
775 | 0
776 |
777 | 0
778 |
779 | 0
780 |
781 |
782 |
783 | 0
784 | 0
785 |
786 |
787 |
788 |
789 |
790 |
791 | 0
792 |
793 |
794 | Apache Server
795 |
796 |
797 |
798 |
799 |
800 | -
801 | Apache/version.
802 | 0
803 |
804 | 0
805 |
806 | apache[version]
807 | 60
808 | 7
809 | 0
810 | 0
811 | 4
812 |
813 |
814 | 0
815 |
816 |
817 | 0
818 | 0
819 |
820 | 0
821 |
822 | 1
823 |
824 |
825 |
826 | 0
827 | 0
828 |
829 |
830 |
831 |
832 |
833 |
834 | 0
835 |
836 |
837 | Apache Server
838 |
839 |
840 |
841 |
842 |
843 | -
844 | Apache/WaitingForConnection.
845 | 0
846 |
847 | 0
848 |
849 | apache[WaitingForConnection]
850 | 60
851 | 7
852 | 365
853 | 0
854 | 0
855 |
856 |
857 | 0
858 |
859 |
860 | 0
861 | 0
862 |
863 | 0
864 |
865 | 0
866 |
867 |
868 |
869 | 0
870 | 0
871 |
872 |
873 |
874 |
875 |
876 |
877 | 0
878 |
879 |
880 | Apache Server
881 |
882 |
883 |
884 |
885 |
886 |
887 |
888 |
889 |
890 |
891 |
892 |
893 |
894 |
895 | Apache Thread Scoreboard
896 | 900
897 | 200
898 | 0.0000
899 | 100.0000
900 | 1
901 | 0
902 | 1
903 | 1
904 | 0
905 | 0.0000
906 | 0.0000
907 | 0
908 | 0
909 | 0
910 | 0
911 |
912 |
913 | 0
914 | 0
915 | 009900
916 | 0
917 | 2
918 | 0
919 | -
920 | Template Apache Server Status
921 | apache[WaitingForConnection]
922 |
923 |
924 |
925 | 1
926 | 0
927 | 00EE00
928 | 0
929 | 2
930 | 0
931 | -
932 | Template Apache Server Status
933 | apache[SendingReply]
934 |
935 |
936 |
937 | 2
938 | 0
939 | 0000EE
940 | 0
941 | 2
942 | 0
943 | -
944 | Template Apache Server Status
945 | apache[StartingUp]
946 |
947 |
948 |
949 | 3
950 | 0
951 | 888888
952 | 0
953 | 2
954 | 0
955 | -
956 | Template Apache Server Status
957 | apache[DNSLookup]
958 |
959 |
960 |
961 | 4
962 | 0
963 | BB00BB
964 | 0
965 | 2
966 | 0
967 | -
968 | Template Apache Server Status
969 | apache[GracefullyFinishing]
970 |
971 |
972 |
973 | 5
974 | 0
975 | 000000
976 | 0
977 | 2
978 | 0
979 | -
980 | Template Apache Server Status
981 | apache[IdleCleanupOfWorker]
982 |
983 |
984 |
985 | 6
986 | 0
987 | FF9999
988 | 0
989 | 2
990 | 0
991 | -
992 | Template Apache Server Status
993 | apache[ReadingRequest]
994 |
995 |
996 |
997 | 7
998 | 0
999 | 00DDDD
1000 | 0
1001 | 2
1002 | 0
1003 | -
1004 | Template Apache Server Status
1005 | apache[KeepAlive]
1006 |
1007 |
1008 |
1009 | 8
1010 | 0
1011 | 777700
1012 | 0
1013 | 2
1014 | 0
1015 | -
1016 | Template Apache Server Status
1017 | apache[ClosingConnection]
1018 |
1019 |
1020 |
1021 | 9
1022 | 0
1023 | CC3232
1024 | 0
1025 | 2
1026 | 0
1027 | -
1028 | Template Apache Server Status
1029 | apache[Logging]
1030 |
1031 |
1032 |
1033 |
1034 |
1035 |
1036 |
--------------------------------------------------------------------------------
/conf/userparameters_mysql.conf:
--------------------------------------------------------------------------------
1 | # Sintaxe: mysql.status[variavel] - ex.: mysql.status[Slow_queries]
2 | UserParameter=mysql.status[*],echo "show global status where Variable_name='$1';" | HOME=/etc/zabbix mysql -N | awk '{print $$2}'
3 |
4 | # Sintaxe: mysql.size[,,]
5 | # Database eh o nome da base de dados. O Padrao eh "all".
6 | # Tabela eh o nome da tabela. O padrao eh "all". Se a tabela for especificada, o database eh obrigatorio.
7 | # Tipo pode ser "data", "index", "free" ou "both". Both eh a soma de "data" e "index". O padrao eh "both"
8 | UserParameter=mysql.size[*],bash -c 'echo "select sum($(case "$3" in both|"") echo "data_length+index_length";; data|index) echo "$3_length";; free) echo "data_free";; esac)) from information_schema.tables$([[ "$1" = "all" || ! "$1" ]] || echo " where table_schema=\"$1\"")$([[ "$2" = "all" || ! "$2" ]] || echo " and table_name=\"$2\"");" | HOME=/etc/zabbix mysql -N'
9 |
10 | UserParameter=mysql.ping,HOME=/etc/zabbix mysqladmin ping | grep -c alive
11 | UserParameter=mysql.version,mysql -V
12 |
--------------------------------------------------------------------------------
/conf/zabbix.conf:
--------------------------------------------------------------------------------
1 | # Modelo do arquivo /etc/apache2/conf-enable/zabbix.conf (Debian)
2 |
3 | # Define /zabbix alias, this is the default
4 |
5 | Alias /zabbix /usr/share/zabbix
6 |
7 |
8 |
9 | Options FollowSymLinks
10 | AllowOverride None
11 | Order allow,deny
12 | Allow from all
13 |
14 |
15 | php_value max_execution_time 300
16 | php_value memory_limit 128M
17 | php_value post_max_size 16M
18 | php_value upload_max_filesize 2M
19 | php_value max_input_time 300
20 | php_value always_populate_raw_post_data -1
21 | php_value date.timezone America/Sao_Paulo
22 |
23 |
24 |
25 |
26 | Order deny,allow
27 | Deny from all
28 |
29 | Order deny,allow
30 | Deny from all
31 |
32 |
33 |
34 |
35 | Order deny,allow
36 | Deny from all
37 |
38 | Order deny,allow
39 | Deny from all
40 |
41 |
42 |
43 |
44 | Order deny,allow
45 | Deny from all
46 |
47 | Order deny,allow
48 | Deny from all
49 |
50 |
51 |
52 |
53 | Order deny,allow
54 | Deny from all
55 |
56 | Order deny,allow
57 | Deny from all
58 |
59 |
60 |
--------------------------------------------------------------------------------
/install-zabbix-glpi/integraGZ.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | # @Programa
4 | # @name: integraGZ.sh
5 | # @versao: 1.0 for CentOS
6 | # @Data 16 de Setembro de 2016
7 | # @Copyright: Verdanatech Soluções em TI, 2016
8 | # @Copyright: Pillares Consulting, 2016
9 | # @Copyright: Conectsys Tecnologia da Informacao, 2016
10 | # --------------------------------------------------------------------------
11 | # LICENSE
12 | #
13 | # integraGZ-CentOS.sh is free software; you can redistribute it and/or modify
14 | # it under the terms of the GNU General Public License as published by
15 | # the Free Software Foundation; either version 3 of the License, or
16 | # (at your option) any later version.
17 | #
18 | # integraGZ.sh is distributed in the hope that it will be useful,
19 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
20 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 | # GNU General Public License for more details.
22 | #
23 | # If not, see .
24 | # --------------------------------------------------------------------------
25 |
26 | # Variaveis
27 |
28 | versionDate="Setember 09, 2016"
29 | TITULO="integraGZ.sh - v.1.0 for CentOS"
30 | BANNER="http://www.verdanatech.com | http://www.conectsys.com.br"
31 |
32 | devMail=janssenreislima@gmail.com
33 | zabbixVersion=zabbix-3.2
34 | TMP_DIR=/tmp
35 | zabbixSource=$TMP_DIR/$zabbixVersion
36 | linkJanssen=https://github.com/janssenlima/zabbix-glpi.git
37 | externalScriptsDir=/usr/local/zabbix/share/zabbix/externalscripts/
38 | serverAddress=$(hostname -I | cut -d' ' -f1)
39 |
40 | clear
41 |
42 |
43 | reqsToUse ()
44 | {
45 | # Testa se o usuário é o root
46 | if [ $UID -ne 0 ]
47 | then
48 | whiptail --title "${TITULO}" --backtitle "${BANNER}" --msgbox "Step 1 - We apologize! You need root access to use this script." --fb 10 50
49 | kill $$
50 | fi
51 |
52 | # Testa a versão do sistema
53 | centosVersion=$(cat /etc/redhat-release | awk '{print $4}' | cut -d "." -f1)
54 |
55 | if [ $centosVersion -ne 7 ]
56 | then
57 | whiptail --title "${TITULO}" --backtitle "${BANNER}" --msgbox "Step 1 - We apologize! This script was developed for Debian 8.x I will close the running now." --fb 10 50
58 | kill $$
59 | fi
60 | }
61 |
62 | menuPrincipal ()
63 | {
64 |
65 | menu01Option=$(whiptail --title "${TITULO}" --backtitle "${BANNER}" --menu "Escolha uma opção na lista abaixo" --fb 15 50 4 \
66 | "1" "Install GLPI and Zabbix" \
67 | "2" "More Information" \
68 | "3" "Credits and License" \
69 | "4" "Exit" 3>&1 1>&2 2>&3)
70 |
71 | status=$?
72 |
73 | if [ $status != 0 ]; then
74 | echo "
75 | You have selected out. Bye!
76 | "
77 | exit;
78 | fi
79 |
80 | }
81 |
82 | showCredits ()
83 | {
84 | clear
85 |
86 | whiptail --title "${TITULO}" --backtitle "${BANNER}" --msgbox "
87 | Copyright:
88 | - Pillares Consulting, $versionDate
89 | - Conectsys Tecnologia da Informacao, $versionDate
90 |
91 | Licence:
92 | - GPL v3
93 |
94 | Project partners:
95 | - Gustavo Soares
96 | - Halexsandro Sales
97 | - Janssen Lima
98 |
99 | API Integration Script:
100 | - Janssen Lima
101 | " --fb 0 0 0
102 |
103 | }
104 |
105 |
106 | #
107 | # Garante que o usuário tenha o whiptail instalado no computador
108 |
109 | INSTALA_WHIPTAIL ()
110 | {
111 |
112 | yum install newt -y
113 |
114 | clear
115 |
116 | [ ! -e /usr/bin/whiptail ] && { echo -e "
117 |
118 | ###########################################################
119 | # WARNING!!! #
120 | -----------------------------------------------------------
121 | # #
122 | # #
123 | # There was an error installing the whiptail. #
124 | # - Check your internet connection. #
125 | # #
126 | # The whiptail package is required to run the integraGZ.sh #
127 | # Please contact us: $devMail #
128 | # #
129 | # #
130 | ----------------------------------------------------------
131 | Verdanatech Solucoes em TI - www.verdanatech.com
132 | ----------------------------------------------------------";
133 |
134 | exit 1; }
135 |
136 | }
137 |
138 |
139 | INFORMATION ()
140 | {
141 |
142 | whiptail --title "${TITULO}" --backtitle "${BANNER}" --msgbox "
143 | This script aims to perform the installation automated systems:
144 | - GLPI 0.90.3 [http://glpi-project.com]
145 | -- Webservice 1.6.0
146 | -- Racks 1.6.1
147 | -- DashBoard 0.7.3
148 | -- SimCard 1.4.1
149 | -- FusionInventory 0.90.1.3
150 | - Zabbix 3.2 [http://zabbix.com]
151 | -- zabbix-server
152 | -- zabbix-agent
153 | NOTE: After instalation, the API Scripts are at /usr/local/share/zabbix/externalscripts/
154 | " --fb 0 0 0
155 |
156 | }
157 |
158 |
159 |
160 | timeZone ()
161 |
162 | # Configura timezone do PHP para o servidor
163 | # Ref: http://php.net/manual/pt_BR/timezones.php
164 | #
165 |
166 | {
167 |
168 | whiptail --title "${TITULO}" --backtitle "${BANNER}" --msgbox "Now we configure the server's timezone. Select the timezone that best meets!." --fb 10 50
169 |
170 | while [ -z $timePart1 ]
171 | do
172 |
173 | timePart1=$(whiptail --title "${TITULO}" --backtitle "${BANNER}" --radiolist \
174 | "Select the timezone for your Server!" 20 60 10 \
175 | "Africa" "" OFF \
176 | "America" "" OFF \
177 | "Antarctica" "" OFF \
178 | "Arctic" "" OFF \
179 | "Asia" "" OFF \
180 | "Atlantic" "" OFF \
181 | "Australia" "" OFF \
182 | "Europe" "" OFF \
183 | "Indian" "" OFF \
184 | "Pacific" "" OFF 3>&1 1>&2 2>&3)
185 | done
186 |
187 | case $timePart1 in
188 |
189 | Africa)
190 | while [ -z $timePart2 ]
191 | do
192 | timePart2=$(whiptail --title "${TITULO}" --backtitle "${BANNER}" --radiolist \
193 | "Select the timezone for your Server!" 20 50 12 \
194 | "Abidjan" "" OFF \
195 | "Accra" "" OFF \
196 | "Addis_Ababa" "" OFF \
197 | "Algiers" "" OFF \
198 | "Asmara" "" OFF \
199 | "Asmera" "" OFF \
200 | "Bamako" "" OFF \
201 | "Bangui" "" OFF \
202 | "Banjul" "" OFF \
203 | "Bissau" "" OFF \
204 | "Blantyre" "" OFF \
205 | "Brazzaville" "" OFF \
206 | "Bujumbura" "" OFF \
207 | "Cairo" "" OFF \
208 | "Casablanca" "" OFF \
209 | "Ceuta" "" OFF \
210 | "Conakry" "" OFF \
211 | "Dakar" "" OFF \
212 | "Dar_es_Salaam" "" OFF \
213 | "Djibouti" "" OFF \
214 | "Douala" "" OFF \
215 | "El_Aaiun" "" OFF \
216 | "Freetown" "" OFF \
217 | "Gaborone" "" OFF \
218 | "Harare" "" OFF \
219 | "Johannesburg" "" OFF \
220 | "Juba" "" OFF \
221 | "Kampala" "" OFF \
222 | "Khartoum" "" OFF \
223 | "Kigali" "" OFF \
224 | "Kinshasa" "" OFF \
225 | "Lagos" "" OFF \
226 | "Libreville" "" OFF \
227 | "Lome" "" OFF \
228 | "Luanda" "" OFF \
229 | "Lubumbashi" "" OFF \
230 | "Lusaka" "" OFF \
231 | "Malabo" "" OFF \
232 | "Maputo" "" OFF \
233 | "Maseru" "" OFF \
234 | "Mbabane" "" OFF \
235 | "Mogadishu" "" OFF \
236 | "Monrovia" "" OFF \
237 | "Nairobi" "" OFF \
238 | "Ndjamena" "" OFF \
239 | "Niamey" "" OFF \
240 | "Nouakchott" "" OFF \
241 | "Ouagadougou" "" OFF \
242 | "Porto-Novo" "" OFF \
243 | "Sao_Tome" "" OFF \
244 | "Timbuktu" "" OFF \
245 | "Tripoli" "" OFF 3>&1 1>&2 2>&3)
246 | done
247 | ;;
248 |
249 | America)
250 | while [ -z $timePart2 ]
251 | do
252 | timePart2=$(whiptail --title "${TITULO}" --backtitle "${BANNER}" --radiolist \
253 | "Select the timezone for your Server!" 20 50 12 \
254 | "Adak" "" OFF \
255 | "Anchorage" "" OFF \
256 | "Anguilla" "" OFF \
257 | "Antigua" "" OFF \
258 | "Araguaina" "" OFF \
259 | "Argentina/Buenos_Aires" "" OFF \
260 | "Argentina/Catamarca" "" OFF \
261 | "Argentina/ComodRivadavia" "" OFF \
262 | "Argentina/Cordoba" "" OFF \
263 | "Argentina/Jujuy" "" OFF \
264 | "Argentina/La_Rioja" "" OFF \
265 | "Argentina/Mendoza" "" OFF \
266 | "Argentina/Rio_Gallegos" "" OFF \
267 | "Argentina/Salta" "" OFF \
268 | "Argentina/San_Juan" "" OFF \
269 | "Argentina/San_Luis" "" OFF \
270 | "Argentina/Tucuman" "" OFF \
271 | "Argentina/Ushuaia" "" OFF \
272 | "Aruba" "" OFF \
273 | "Asuncion" "" OFF \
274 | "Atikokan" "" OFF \
275 | "Atka" "" OFF \
276 | "Bahia" "" OFF \
277 | "Bahia_Banderas" "" OFF \
278 | "Barbados" "" OFF \
279 | "Belem" "" OFF \
280 | "Belize" "" OFF \
281 | "Blanc-Sablon" "" OFF \
282 | "Boa_Vista" "" OFF \
283 | "Bogota" "" OFF \
284 | "Boise" "" OFF \
285 | "Buenos_Aires" "" OFF \
286 | "Cambridge_Bay" "" OFF \
287 | "Campo_Grande" "" OFF \
288 | "Cancun" "" OFF \
289 | "Caracas" "" OFF \
290 | "Catamarca" "" OFF \
291 | "Cayenne" "" OFF \
292 | "Cayman" "" OFF \
293 | "Chicago" "" OFF \
294 | "Chihuahua" "" OFF \
295 | "Coral_Harbour" "" OFF \
296 | "Cordoba" "" OFF \
297 | "Costa_Rica" "" OFF \
298 | "Creston" "" OFF \
299 | "Cuiaba" "" OFF \
300 | "Curacao" "" OFF \
301 | "Danmarkshavn" "" OFF \
302 | "Dawson" "" OFF \
303 | "Dawson_Creek" "" OFF \
304 | "Denver" "" OFF \
305 | "Detroit" "" OFF \
306 | "Dominica" "" OFF \
307 | "Edmonton" "" OFF \
308 | "Eirunepe" "" OFF \
309 | "El_Salvador" "" OFF \
310 | "Ensenada" "" OFF \
311 | "Fort_Nelson" "" OFF \
312 | "Fort_Wayne" "" OFF \
313 | "Fortaleza" "" OFF \
314 | "Glace_Bay" "" OFF \
315 | "Godthab" "" OFF \
316 | "Goose_Bay" "" OFF \
317 | "Grand_Turk" "" OFF \
318 | "Grenada" "" OFF \
319 | "Guadeloupe" "" OFF \
320 | "Guatemala" "" OFF \
321 | "Guayaquil" "" OFF \
322 | "Guyana" "" OFF \
323 | "Halifax" "" OFF \
324 | "Havana" "" OFF \
325 | "Hermosillo" "" OFF \
326 | "Indiana/Indianapolis" "" OFF \
327 | "Indiana/Knox" "" OFF \
328 | "Indiana/Marengo" "" OFF \
329 | "Indiana/Petersburg" "" OFF \
330 | "Indiana/Tell_City" "" OFF \
331 | "Indiana/Vevay" "" OFF \
332 | "Indiana/Vincennes" "" OFF \
333 | "Indiana/Winamac" "" OFF \
334 | "Indianapolis" "" OFF \
335 | "Inuvik" "" OFF \
336 | "Iqaluit" "" OFF \
337 | "Jamaica" "" OFF \
338 | "Jujuy" "" OFF \
339 | "Juneau" "" OFF \
340 | "Kentucky/Louisville" "" OFF \
341 | "Kentucky/Monticello" "" OFF \
342 | "Knox_IN" "" OFF \
343 | "Kralendijk" "" OFF \
344 | "La_Paz" "" OFF \
345 | "Lima" "" OFF \
346 | "Los_Angeles" "" OFF \
347 | "Louisville" "" OFF \
348 | "Lower_Princes" "" OFF \
349 | "Maceio" "" OFF \
350 | "Managua" "" OFF \
351 | "Manaus" "" OFF \
352 | "Marigot" "" OFF \
353 | "Martinique" "" OFF \
354 | "Matamoros" "" OFF \
355 | "Mazatlan" "" OFF \
356 | "Mendoza" "" OFF \
357 | "Menominee" "" OFF \
358 | "Merida" "" OFF \
359 | "Metlakatla" "" OFF \
360 | "Mexico_City" "" OFF \
361 | "Miquelon" "" OFF \
362 | "Moncton" "" OFF \
363 | "Monterrey" "" OFF \
364 | "Montevideo" "" OFF \
365 | "Montreal" "" OFF \
366 | "Montserrat" "" OFF \
367 | "Nassau" "" OFF \
368 | "New_York" "" OFF \
369 | "Nipigon" "" OFF \
370 | "Nome" "" OFF \
371 | "Noronha" "" OFF \
372 | "North_Dakota/Beulah" "" OFF \
373 | "North_Dakota/Center" "" OFF \
374 | "North_Dakota/New_Salem" "" OFF \
375 | "Ojinaga" "" OFF \
376 | "Panama" "" OFF \
377 | "Pangnirtung" "" OFF \
378 | "Paramaribo" "" OFF \
379 | "Phoenix" "" OFF \
380 | "Port-au-Prince" "" OFF \
381 | "Port_of_Spain" "" OFF \
382 | "Porto_Acre" "" OFF \
383 | "Porto_Velho" "" OFF \
384 | "Puerto_Rico" "" OFF \
385 | "Rainy_River" "" OFF \
386 | "Rankin_Inlet" "" OFF \
387 | "Recife" "" OFF \
388 | "Regina" "" OFF \
389 | "Resolute" "" OFF \
390 | "Rio_Branco" "" OFF \
391 | "Rosario" "" OFF \
392 | "Santa_Isabel" "" OFF \
393 | "Santarem" "" OFF \
394 | "Santiago" "" OFF \
395 | "Santo_Domingo" "" OFF \
396 | "Sao_Paulo" "" OFF \
397 | "Scoresbysund" "" OFF \
398 | "Shiprock" "" OFF \
399 | "Sitka" "" OFF \
400 | "St_Barthelemy" "" OFF \
401 | "St_Johns" "" OFF \
402 | "St_Kitts" "" OFF \
403 | "St_Lucia" "" OFF \
404 | "St_Thomas" "" OFF \
405 | "St_Vincent" "" OFF \
406 | "Swift_Current" "" OFF \
407 | "Tegucigalpa" "" OFF \
408 | "Thule" "" OFF \
409 | "Thunder_Bay" "" OFF \
410 | "Tijuana" "" OFF \
411 | "Toronto" "" OFF \
412 | "Tortola" "" OFF \
413 | "Vancouver" "" OFF \
414 | "Virgin" "" OFF \
415 | "Whitehorse" "" OFF \
416 | "Winnipeg" "" OFF \
417 | "Yakutat" "" OFF 3>&1 1>&2 2>&3)
418 | done
419 | ;;
420 |
421 |
422 | Antarctica)
423 | while [ -z $timePart2 ]
424 | do
425 | timePart2=$(whiptail --title "${TITULO}" --backtitle "${BANNER}" --radiolist \
426 | "Select the timezone for your Server!" 20 50 12 \
427 | "Casey" "" OFF \
428 | "Davis" "" OFF \
429 | "DumontDUrville" "" OFF \
430 | "Macquarie" "" OFF \
431 | "Mawson" "" OFF \
432 | "McMurdo" "" OFF \
433 | "Palmer" "" OFF \
434 | "Rothera" "" OFF \
435 | "South_Pole" "" OFF \
436 | "Syowa" "" OFF \
437 | "Troll" "" OFF \
438 | "Vostok" "" OFF 3>&1 1>&2 2>&3)
439 | done
440 | ;;
441 |
442 | Arctic)
443 | while [ -z $timePart2 ]
444 | do
445 |
446 | timePart2=$(whiptail --title "${TITULO}" --backtitle "${BANNER}" --radiolist \
447 | "Select the timezone for your Server!" 20 50 12 \
448 | "Longyearbyen" "" OFF 3>&1 1>&2 2>&3)
449 | done
450 | ;;
451 |
452 | Asia)
453 | while [ -z $timePart2 ]
454 | do
455 | timePart2=$(whiptail --title "${TITULO}" --backtitle "${BANNER}" --radiolist \
456 | "Select the timezone for your Server!" 20 50 12 \
457 | "Aden" "" OFF \
458 | "Almaty" "" OFF \
459 | "Amman" "" OFF \
460 | "Anadyr" "" OFF \
461 | "Aqtau" "" OFF \
462 | "Aqtobe" "" OFF \
463 | "Ashgabat" "" OFF \
464 | "Ashkhabad" "" OFF \
465 | "Baghdad" "" OFF \
466 | "Bahrain" "" OFF \
467 | "Baku" "" OFF \
468 | "Bangkok" "" OFF \
469 | "Beirut" "" OFF \
470 | "Bishkek" "" OFF \
471 | "Brunei" "" OFF \
472 | "Calcutta" "" OFF \
473 | "Chita" "" OFF \
474 | "Choibalsan" "" OFF \
475 | "Chongqing" "" OFF \
476 | "Chungking" "" OFF \
477 | "Colombo" "" OFF \
478 | "Dacca" "" OFF \
479 | "Damascus" "" OFF \
480 | "Dhaka" "" OFF \
481 | "Dili" "" OFF \
482 | "Dubai" "" OFF \
483 | "Dushanbe" "" OFF \
484 | "Gaza" "" OFF \
485 | "Harbin" "" OFF \
486 | "Hebron" "" OFF \
487 | "Ho_Chi_Minh" "" OFF \
488 | "Hong_Kong" "" OFF \
489 | "Hovd" "" OFF \
490 | "Irkutsk" "" OFF \
491 | "Istanbul" "" OFF \
492 | "Jakarta" "" OFF \
493 | "Jayapura" "" OFF \
494 | "Jerusalem" "" OFF \
495 | "Kabul" "" OFF \
496 | "Kamchatka" "" OFF \
497 | "Karachi" "" OFF \
498 | "Kashgar" "" OFF \
499 | "Kathmandu" "" OFF \
500 | "Katmandu" "" OFF \
501 | "Khandyga" "" OFF \
502 | "Kolkata" "" OFF \
503 | "Krasnoyarsk" "" OFF \
504 | "Kuala_Lumpur" "" OFF \
505 | "Kuching" "" OFF \
506 | "Kuwait" "" OFF \
507 | "Macao" "" OFF \
508 | "Macau" "" OFF \
509 | "Magadan" "" OFF \
510 | "Makassar" "" OFF \
511 | "Manila" "" OFF \
512 | "Muscat" "" OFF \
513 | "Nicosia" "" OFF \
514 | "Novokuznetsk" "" OFF \
515 | "Novosibirsk" "" OFF \
516 | "Omsk" "" OFF \
517 | "Oral" "" OFF \
518 | "Phnom_Penh" "" OFF \
519 | "Pontianak" "" OFF \
520 | "Pyongyang" "" OFF \
521 | "Qatar" "" OFF \
522 | "Qyzylorda" "" OFF \
523 | "Rangoon" "" OFF \
524 | "Riyadh" "" OFF \
525 | "Saigon" "" OFF \
526 | "Sakhalin" "" OFF \
527 | "Samarkand" "" OFF \
528 | "Seoul" "" OFF \
529 | "Shanghai" "" OFF \
530 | "Singapore" "" OFF \
531 | "Srednekolymsk" "" OFF \
532 | "Taipei" "" OFF \
533 | "Tashkent" "" OFF \
534 | "Tbilisi" "" OFF \
535 | "Tehran" "" OFF \
536 | "Tel_Aviv" "" OFF \
537 | "Thimbu" "" OFF \
538 | "Thimphu" "" OFF \
539 | "Tokyo" "" OFF \
540 | "Ujung_Pandang" "" OFF \
541 | "Ulaanbaatar" "" OFF \
542 | "Ulan_Bator" "" OFF \
543 | "Urumqi" "" OFF \
544 | "Ust-Nera" "" OFF \
545 | "Vientiane" "" OFF \
546 | "Vladivostok" "" OFF \
547 | "Yakutsk" "" OFF \
548 | "Yekaterinburg" "" OFF 3>&1 1>&2 2>&3)
549 | done
550 | ;;
551 |
552 | Atlantic)
553 | while [ -z $timePart2 ]
554 | do
555 | timePart2=$(whiptail --title "${TITULO}" --backtitle "${BANNER}" --radiolist \
556 | "Select the timezone for your Server!" 20 50 12 \
557 | "Azores" "" OFF \
558 | "Bermuda" "" OFF \
559 | "Canary" "" OFF \
560 | "Cape_Verde" "" OFF \
561 | "Faeroe" "" OFF \
562 | "Faroe" "" OFF \
563 | "Jan_Mayen" "" OFF \
564 | "Madeira" "" OFF \
565 | "Reykjavik" "" OFF \
566 | "South_Georgia" "" OFF \
567 | "St_Helena" "" OFF \
568 | "Stanley" "" OFF 3>&1 1>&2 2>&3)
569 | done
570 | ;;
571 |
572 | Australia)
573 | while [ -z $timePart2 ]
574 | do
575 | timePart2=$(whiptail --title "${TITULO}" --backtitle "${BANNER}" --radiolist \
576 | "Select the timezone for your Server!" 20 50 12 \
577 | "ACT" "" OFF \
578 | "Adelaide" "" OFF \
579 | "Brisbane" "" OFF \
580 | "Broken_Hill" "" OFF \
581 | "Canberra" "" OFF \
582 | "Currie" "" OFF \
583 | "Darwin" "" OFF \
584 | "Eucla" "" OFF \
585 | "Hobart" "" OFF \
586 | "LHI" "" OFF \
587 | "Lindeman" "" OFF \
588 | "Lord_Howe" "" OFF \
589 | "Melbourne" "" OFF \
590 | "North" "" OFF \
591 | "NSW" "" OFF \
592 | "Perth" "" OFF \
593 | "Queensland" "" OFF \
594 | "South" "" OFF \
595 | "Sydney" "" OFF \
596 | "Tasmania" "" OFF \
597 | "Victoria" "" OFF \
598 | "West" "" OFF \
599 | "Yancowinna" "" OFF 3>&1 1>&2 2>&3)
600 | done
601 | ;;
602 |
603 | Europe)
604 | while [ -z $timePart2 ]
605 | do
606 | timePart2=$(whiptail --title "${TITULO}" --backtitle "${BANNER}" --radiolist \
607 | "Select the timezone for your Server!" 20 50 12 \
608 | "Amsterdam" "" OFF \
609 | "Andorra" "" OFF \
610 | "Athens" "" OFF \
611 | "Belfast" "" OFF \
612 | "Belgrade" "" OFF \
613 | "Berlin" "" OFF \
614 | "Bratislava" "" OFF \
615 | "Brussels" "" OFF \
616 | "Bucharest" "" OFF \
617 | "Budapest" "" OFF \
618 | "Busingen" "" OFF \
619 | "Chisinau" "" OFF \
620 | "Copenhagen" "" OFF \
621 | "Dublin" "" OFF \
622 | "Gibraltar" "" OFF \
623 | "Guernsey" "" OFF \
624 | "Helsinki" "" OFF \
625 | "Isle_of_Man" "" OFF \
626 | "Istanbul" "" OFF \
627 | "Jersey" "" OFF \
628 | "Kaliningrad" "" OFF \
629 | "Kiev" "" OFF \
630 | "Lisbon" "" OFF \
631 | "Ljubljana" "" OFF \
632 | "London" "" OFF \
633 | "Luxembourg" "" OFF \
634 | "Madrid" "" OFF \
635 | "Malta" "" OFF \
636 | "Mariehamn" "" OFF \
637 | "Minsk" "" OFF \
638 | "Monaco" "" OFF \
639 | "Moscow" "" OFF \
640 | "Nicosia" "" OFF \
641 | "Oslo" "" OFF \
642 | "Paris" "" OFF \
643 | "Podgorica" "" OFF \
644 | "Prague" "" OFF \
645 | "Riga" "" OFF \
646 | "Rome" "" OFF \
647 | "Samara" "" OFF \
648 | "San_Marino" "" OFF \
649 | "Sarajevo" "" OFF \
650 | "Simferopol" "" OFF \
651 | "Skopje" "" OFF \
652 | "Sofia" "" OFF \
653 | "Stockholm" "" OFF \
654 | "Tallinn" "" OFF \
655 | "Tirane" "" OFF \
656 | "Tiraspol" "" OFF \
657 | "Uzhgorod" "" OFF \
658 | "Vaduz" "" OFF \
659 | "Vatican" "" OFF \
660 | "Vienna" "" OFF \
661 | "Vilnius" "" OFF \
662 | "Volgograd" "" OFF \
663 | "Warsaw" "" OFF \
664 | "Zagreb" "" OFF \
665 | "Zaporozhye" "" OFF \
666 | "Zurich" "" OFF 3>&1 1>&2 2>&3)
667 | done
668 | ;;
669 |
670 | Indian)
671 | while [ -z $timePart2 ]
672 | do
673 | timePart2=$(whiptail --title "${TITULO}" --backtitle "${BANNER}" --radiolist \
674 | "Select the timezone for your Server!" 20 50 12 \
675 | "Antananarivo" "" OFF \
676 | "Chagos" "" OFF \
677 | "Christmas" "" OFF \
678 | "Cocos" "" OFF \
679 | "Comoro" "" OFF \
680 | "Kerguelen" "" OFF \
681 | "Mahe" "" OFF \
682 | "Maldives" "" OFF \
683 | "Mauritius" "" OFF \
684 | "Mayotte" "" OFF \
685 | "Reunion" "" OFF 3>&1 1>&2 2>&3)
686 | done
687 | ;;
688 |
689 | Pacific)
690 | while [ -z $timePart2 ]
691 | do
692 | timePart2=$(whiptail --title "${TITULO}" --backtitle "${BANNER}" --radiolist \
693 | "Select the timezone for your Server!" 20 50 12 \
694 | "Apia" "" OFF \
695 | "Auckland" "" OFF \
696 | "Bougainville" "" OFF \
697 | "Chatham" "" OFF \
698 | "Chuuk" "" OFF \
699 | "Easter" "" OFF \
700 | "Efate" "" OFF \
701 | "Enderbury" "" OFF \
702 | "Fakaofo" "" OFF \
703 | "Fiji" "" OFF \
704 | "Funafuti" "" OFF \
705 | "Galapagos" "" OFF \
706 | "Gambier" "" OFF \
707 | "Guadalcanal" "" OFF \
708 | "Guam" "" OFF \
709 | "Honolulu" "" OFF \
710 | "Johnston" "" OFF \
711 | "Kiritimati" "" OFF \
712 | "Kosrae" "" OFF \
713 | "Kwajalein" "" OFF \
714 | "Majuro" "" OFF \
715 | "Marquesas" "" OFF \
716 | "Midway" "" OFF \
717 | "Nauru" "" OFF \
718 | "Niue" "" OFF \
719 | "Norfolk" "" OFF \
720 | "Noumea" "" OFF \
721 | "Pago_Pago" "" OFF \
722 | "Palau" "" OFF \
723 | "Pitcairn" "" OFF \
724 | "Pohnpei" "" OFF \
725 | "Ponape" "" OFF \
726 | "Port_Moresby" "" OFF \
727 | "Rarotonga" "" OFF \
728 | "Saipan" "" OFF \
729 | "Samoa" "" OFF \
730 | "Tahiti" "" OFF \
731 | "Tarawa" "" OFF \
732 | "Tongatapu" "" OFF \
733 | "Truk" "" OFF \
734 | "Wake" "" OFF \
735 | "Wallis" "" OFF \
736 | "Yap" "" OFF 3>&1 1>&2 2>&3)
737 | done
738 | ;;
739 |
740 | esac
741 |
742 | }
743 |
744 | INSTALA_DEPENDENCIAS ()
745 | {
746 |
747 | clear
748 |
749 | echo "Exec Step 2..."
750 | sleep 1
751 |
752 | echo "Updatind and upgrading the system..."
753 |
754 | yum install epel-release -y
755 |
756 | yum update -y
757 |
758 | clear
759 |
760 | echo "Intalling CentOS packages..."
761 | sleep 1
762 |
763 | yum groupinstall "Development Tools" -y
764 |
765 | yum install iksemel-devel libcurl-devel net-snmp-devel mariadb-devel fping OpenIPMI-devel libssh2-devel java-1.8.0-openjdk-devel libxml2-devel unixODBC-devel openldap-devel gnutls-devel git python-pip curl net-snmp php-cli php-bcmath php-mbstring php php-mysql php-pdo php-common php-gd httpd php-xml php-ldap php-mcrypt php-xmlrpc mariadb-server php-imap php-soap php-snmp dejavu-fonts-common libtool-ltdl-devel wget -y
766 |
767 | pip install zabbix-api
768 |
769 | systemctl enable mariadb
770 | service mariadb start
771 | sleep 5
772 | mysql_secure_installation
773 |
774 | }
775 |
776 | INSTALL ()
777 | {
778 |
779 | clear
780 |
781 | echo "Exec Step 3..."
782 | sleep 1
783 |
784 |
785 | ## Processo de instalação do Zabbix 3.0
786 |
787 | # Criação de usuário e grupo do sistema
788 |
789 | groupadd zabbix
790 |
791 | useradd -g zabbix zabbix
792 |
793 | # Baixando e compilando o zabbix
794 |
795 | cd /tmp
796 |
797 | #wget http://ufpr.dl.sourceforge.net/project/zabbix/ZABBIX%20Latest%20Stable/3.0.4/zabbix-3.0.4.tar.gz
798 | #tar -zxvf zabbix-3.0.4.tar.gz
799 | #cd zabbix-3.0.4
800 |
801 | wget http://tenet.dl.sourceforge.net/project/zabbix/ZABBIX%20Latest%20Stable/3.2.0/zabbix-3.2.0.tar.gz
802 | tar -zxvf zabbix-3.2.0.tar.gz
803 | cd zabbix-3.2.0
804 |
805 | ./configure --enable-server --enable-agent --with-mysql --with-net-snmp --with-libcurl --with-libxml2 --with-ssh2 --with-ldap --with-iconv --with-gnutls --with-unixodbc --with-openipmi --with-jabber=/usr --enable-ipv6 --prefix=/usr/local/zabbix
806 |
807 | make install
808 |
809 | # Preparando scripts de serviço
810 |
811 | ln -s /usr/local/zabbix/etc /etc/zabbix
812 |
813 | mv misc/init.d/fedora/core5/zabbix* /etc/init.d/
814 |
815 | chmod 755 /etc/init.d/zabbix*
816 | sed -i 's/ZABBIX_BIN="\/usr\/local\/sbin\/zabbix_server"*/ZABBIX_BIN="\/usr\/local\/zabbix\/sbin\/zabbix_server"/' /etc/init.d/zabbix_server
817 | sed -i 's/ZABBIX_BIN="\/usr\/local\/sbin\/zabbix_agentd"*/ZABBIX_BIN="\/usr\/local\/zabbix\/sbin\/zabbix_agentd"/' /etc/init.d/zabbix_agentd
818 |
819 | systemctl enable zabbix_server
820 | systemctl enable zabbix_agentd
821 | systemctl daemon-reload
822 |
823 | # Adequando arquivos de log de zabbix-server e zabbix-agent
824 | mkdir /var/log/zabbix
825 | chown root:zabbix /var/log/zabbix
826 | chmod 775 /var/log/zabbix
827 |
828 | sed -i 's/LogFile=\/tmp\/zabbix_agentd.log*/LogFile=\/var\/log\/zabbix\/zabbix_agentd.log/' /etc/zabbix/zabbix_agentd.conf
829 | sed -i 's/LogFile=\/tmp\/zabbix_server.log*/LogFile=\/var\/log\/zabbix\/zabbix_server.log/' /etc/zabbix/zabbix_server.conf
830 |
831 | # Habilitando execução de comandos via Zabbix
832 | sed -i 's/# EnableRemoteCommands=0*/EnableRemoteCommands=1/' /etc/zabbix/zabbix_agentd.conf
833 |
834 | # Preparando o zabbix frontend
835 | mv frontends/php /var/www/html/zabbix
836 |
837 | timeZone
838 |
839 | echo -e "
840 |
841 | Alias /zabbix /var/www/html/zabbix
842 |
843 |
844 | Options FollowSymLinks
845 | AllowOverride None
846 | Require all granted
847 |
848 |
849 | php_value max_execution_time 300
850 | php_value memory_limit 128M
851 | php_value post_max_size 16M
852 | php_value upload_max_filesize 2M
853 | php_value max_input_time 300
854 | php_value always_populate_raw_post_data -1
855 | php_value date.timezone $timePart1/$timePart2
856 |
857 |
858 |
859 |
860 | Require all denied
861 |
862 |
863 |
864 | Require all denied
865 |
866 |
867 |
868 | Require all denied
869 |
870 |
871 |
872 | Require all denied
873 |
874 |
875 | " > /etc/httpd/conf.d/zabbix.conf
876 |
877 | # Reiniciando apache2
878 |
879 | chmod 775 /var/www/html/zabbix -Rf
880 | chown apache:apache /var/www/html/zabbix -Rf
881 | service httpd restart
882 |
883 |
884 | ## Processo de instalação do GLPI
885 | # Baixando o GLPI
886 | wget https://github.com/glpi-project/glpi/releases/download/0.90.5/glpi-0.90.5.tar.gz
887 | tar -zxvf glpi-0.90.5.tar.gz
888 | mv glpi /var/www/html/
889 |
890 | # Baixando o Webservice
891 | wget https://forge.glpi-project.org/attachments/download/2099/glpi-webservices-1.6.0.tar.gz
892 | tar -zxvf glpi-webservices-1.6.0.tar.gz
893 | mv webservices /var/www/html/glpi/plugins/
894 |
895 | # Baixando o Racks
896 | wget https://github.com/InfotelGLPI/racks/releases/download/1.6.2/glpi-racks-1.6.2.tar.gz
897 | tar -zxvf glpi-racks-1.6.2.tar.gz
898 | mv racks /var/www/html/glpi/plugins/
899 |
900 | # Baixando o DashBoard
901 | wget https://forge.glpi-project.org/attachments/download/2154/GLPI-dashboard_plugin-0.7.6.tar.gz
902 | tar -zxvf GLPI-dashboard_plugin-0.7.6.tar.gz
903 | mv dashboard /var/www/html/glpi/plugins/
904 |
905 | # Baixando o MyDashboard
906 | wget https://github.com/InfotelGLPI/mydashboard/releases/download/1.2.1/glpi-mydashboard-1.2.1.tar.gz
907 | tar -zxvf glpi-mydashboard-1.2.1.tar.gz
908 | mv mydashboard /var/www/html/glpi/plugins/mydashboard
909 |
910 | # Baixando Seasonality
911 | wget https://github.com/InfotelGLPI/seasonality/releases/download/1.1.0/glpi-seasonality-1.1.0.tar.gz
912 | tar glpi-seasonality-1.1.0.tar.gz
913 | mv seasonality /var/www/html/glpi/plugins/seasonality
914 |
915 | # Baixando More LDAP
916 | wget https://github.com/pluginsGLPI/moreldap/releases/download/0.90-0.2.2/glpi-moreldap-0.90-0.2.2.tar.gz
917 | tar -zxvf glpi-moreldap-0.90-0.2.2.tar.gz
918 | mv glpi /var/www/html/glpi/plugins/moreldap
919 |
920 | # Baixando SimCard Beta
921 | wget https://github.com/pluginsGLPI/simcard/archive/1.4.1.tar.gz
922 | tar -zxvf 1.4.1.tar.gz
923 | mv simcard-1.4.1 /var/www/html/glpi/plugins/simcard
924 |
925 | # Baixando Hidefields
926 | wget https://github.com/tomolimo/hidefields/archive/1.0.0.tar.gz
927 | tar -zxvf 1.0.0.tar.gz
928 | mv hidefields-1.0.0 /var/www/html/glpi/plugins/hidefields
929 |
930 | # Baixando Form Validation
931 | wget https://github.com/tomolimo/formvalidation/archive/0.1.2.tar.gz
932 | tar -zxvf 0.1.2.tar.gz
933 | mv formvalidation-0.1.2 /var/www/html/glpi/plugins/formvalidation
934 |
935 | # Baixando PDF
936 | wget https://forge.glpi-project.org/attachments/download/2139/glpi-pdf-1.0.2.tar.gz
937 | tar -zxvf glpi-pdf-1.0.2.tar.gz
938 | mv pdf /var/www/html/glpi/plugins/pdf
939 |
940 | # Baixando Data Injection
941 | wget https://github.com/pluginsGLPI/datainjection/releases/download/2.4.1/glpi-datainjection-2.4.1.tar.gz
942 | tar -zxvf glpi-datainjection-2.4.1.tar.gz
943 | mv datainjection /var/www/html/glpi/plugins/datainjection
944 |
945 | # Baixando IP Reports
946 | wget https://forge.glpi-project.org/attachments/download/2128/glpi-addressing-2.3.0.tar.gz
947 | tar -zxvf glpi-addressing-2.3.0.tar.gz
948 | mv addressing /var/www/html/glpi/plugins/addressing
949 |
950 | # Baixando Generic Objects Management
951 | wget https://github.com/pluginsGLPI/genericobject/archive/0.85-1.0.tar.gz
952 | tar -zxvf 0.85-1.0.tar.gz
953 | mv genericobject-0.85-1.0 /var/www/html/glpi/plugins/genericobject
954 |
955 | # Baixando Barscode
956 | wget https://forge.glpi-project.org/attachments/download/2153/glpi-barcode-0.90+1.0.tar.gz
957 | tar -zxvf glpi-barcode-0.90+1.0.tar.gz
958 | mv barcode /var/www/html/glpi/plugins/barcode
959 |
960 | # Baixando Timezones
961 | #wget https://github.com/tomolimo/timezones/archive/2.0.0.tar.gz
962 | #tar -zxvf 2.0.0.tar.gz
963 | #mv timezones-2.0.0 /var/www/html/glpi/plugins/timezones
964 |
965 | # Baixando Monitoring
966 | wget https://github.com/ddurieux/glpi_monitoring/releases/download/0.90%2B1.1/glpi_monitoring_0.90.1.1.tar.gz
967 | tar glpi_monitoring_0.90.1.1.tar.gz
968 | mv monitoring /var/www/html/glpi/plugins/monitoring
969 |
970 | # Baixando Applince
971 | wget https://forge.glpi-project.org/attachments/download/2147/glpi-appliances-2.1.tar.gz
972 | tar -zxvf glpi-appliances-2.1.tar.gz
973 | mv appliances /var/www/html/glpi/plugins/appliances
974 |
975 | # Baixando Certificates Inventory
976 | wget https://github.com/InfotelGLPI/certificates/releases/download/2.1.1/glpi-certificates-2.1.1.tar.gz
977 | tar -zxvf glpi-certificates-2.1.1.tar.gz
978 | mv certificates /var/www/html/glpi/plugins/certificates
979 |
980 | # Baixando Databases Inventory
981 | wget https://github.com/InfotelGLPI/databases/releases/download/1.8.1/glpi-databases-1.8.1.tar.gz
982 | tar -zxvf glpi-databases-1.8.1.tar.gz
983 | mv databases /var/www/html/glpi/plugins/databases
984 |
985 | # Baixando Domains
986 | wget https://github.com/InfotelGLPI/domains/releases/download/1.7.0/glpi-domains-1.7.0.tar.gz
987 | tar -zxvf glpi-domains-1.7.0.tar.gz
988 | mv domains /var/www/html/glpi/plugins/domains
989 |
990 | # Baixando Human Resources Management
991 | wget https://github.com/InfotelGLPI/resources/releases/download/2.2.1/glpi-resources-2.2.1.tar.gz
992 | tar -zxvf glpi-resources-2.2.1.tar.gz
993 | mv resources /var/www/html/glpi/plugins/resources
994 |
995 | # Baixando Web Applications Inventory
996 | wget https://github.com/InfotelGLPI/webapplications/releases/download/2.1.1/glpi-webapplications-2.1.1.tar.gz
997 | tar -zxvf glpi-webapplications-2.1.1.tar.gz
998 | mv webapplications /var/www/html/glpi/plugins/webapplications
999 |
1000 | # Baixando Order Management
1001 | wget https://github.com/pluginsGLPI/order/archive/0.85+1.1.tar.gz
1002 | tar -zxvf 0.85+1.1.tar.gz
1003 | mv order-0.85-1.1 /var/www/html/glpi/plugins/order
1004 |
1005 | # Baixando Inventory Number Generation
1006 | wget https://github.com/pluginsGLPI/geninventorynumber/releases/download/0.85%2B1.0/glpi-geninventorynumber-0.85.1.0.tar.gz
1007 | tar -zxvf glpi-geninventorynumber-0.85.1.0.tar.gz
1008 | mv geninventorynumber /var/www/html/glpi/plugins/geninventorynumber
1009 |
1010 | # Baixando GLPI Connections BETA4 0.90-1.7.3
1011 | wget https://github.com/pluginsGLPI/connections/releases/download/0.90-1.7.3/glpi-connections-0.90-1.7.3.tar.gz
1012 | tar -zxvf glpi-connections-0.90-1.7.3.tar.gz
1013 | mv connections /var/www/html/glpi/plugins/connections
1014 |
1015 | # Baixando GLPI Renamer 0.90-1.0
1016 | wget https://github.com/pluginsGLPI/renamer/releases/download/0.90-1.0/glpi-renamer-0.90-1.0.tar.gz
1017 | tar -zxvf glpi-renamer-0.90-1.0.tar.gz
1018 | mv renamer /var/www/html/glpi/plugins/renamer
1019 |
1020 | # Baixando Behaviors
1021 | wget https://forge.glpi-project.org/attachments/download/2124/glpi-behaviors-1.0.tar.gz
1022 | tar -zxvf glpi-behaviors-1.0.tar.gz
1023 | mv behaviors /var/www/html/glpi/plugins/behaviors
1024 |
1025 | # Baixando Ticket Cleaner
1026 | wget https://github.com/tomolimo/ticketcleaner/archive/2.0.4.tar.gz
1027 | tar -zxvf 2.0.4.tar.gz
1028 | mv ticketcleaner-2.0.4 /var/www/html/glpi/plugins/ticketcleaner
1029 |
1030 | # Baixando Escalation
1031 | wget https://forge.glpi-project.org/attachments/download/2150/glpi-escalation-0.90+1.0.tar.gz
1032 | tar -zxvf glpi-escalation-0.90+1.0.tar.gz
1033 | mv escalation /var/www/html/glpi/plugins/escalation
1034 |
1035 | # Baixando News
1036 | wget https://github.com/pluginsGLPI/news/releases/download/0.90-1.3/glpi-news-0.90-1.3.tar.gz
1037 | tar -zxvf glpi-news-0.90-1.3.tar.gz
1038 | mv news /var/www/html/glpi/plugins/news
1039 |
1040 | # Baixando Historical purge
1041 | wget https://github.com/pluginsGLPI/purgelogs/releases/download/0.85%2B1.1/glpi-purgelogs-0.85-1.1.tar.gz
1042 | tar -zxvf glpi-purgelogs-0.85-1.1.tar.gz
1043 | mv purgelogs-0.85-1.1 /var/www/html/glpi/plugins/purgelogs
1044 |
1045 | # Baixando Escalade
1046 | wget https://github.com/pluginsGLPI/escalade/releases/download/0.90-1.2/glpi-escalade-0.90-1.2.tar.gz
1047 | tar -zxvf glpi-escalade-0.90-1.2.tar.gz
1048 | mv escalade /var/www/html/glpi/plugins/escalade
1049 |
1050 | # Baixando ITIL Category Groups
1051 | wget https://github.com/pluginsGLPI/itilcategorygroups/releases/download/0.90%2B1.0.3/glpi-itilcategorygroups-0.90-1.0.3.tar.gz
1052 | tar -zxvf glpi-itilcategorygroups-0.90-1.0.3.tar.gz
1053 | mv itilcategorygroups /var/www/html/glpi/plugins/itilcategorygroups
1054 |
1055 | # Baixando Consumables
1056 | wget https://github.com/InfotelGLPI/consumables/releases/download/1.1.0/glpi-consumables-1.1.0.tar.gz
1057 | tar -zxvf glpi-consumables-1.1.0.tar.gz
1058 | mv consumables /var/www/html/glpi/plugins/consumables
1059 |
1060 | # Baixando PrinterCounters
1061 | wget https://github.com/InfotelGLPI/printercounters/releases/download/1.2.1/glpi-printercounters-1.2.1.tar.gz
1062 | tar -zxvf glpi-printercounters-1.2.1.tar.gz
1063 | mv printercounters /var/www/html/glpi/plugins/printercounters
1064 |
1065 | # Baixando Financial Reports
1066 | wget https://github.com/InfotelGLPI/financialreports/releases/download/2.2.1/glpi-financialreports-2.2.1.tar.gz
1067 | tar -zxvf glpi-financialreports-2.2.1.tar.gz
1068 | mv financialreports /var/www/html/glpi/plugins/financialreports
1069 |
1070 | # Baixando Timelineticket
1071 | wget https://github.com/pluginsGLPI/timelineticket/releases/download/0.90%2B1.0/glpi-timelineticket-0.90.1.0.tar.gz
1072 | tar -zxvf glpi-timelineticket-0.90.1.0.tar.gz
1073 | mv timelineticket /var/www/html/glpi/plugins/timelineticket
1074 |
1075 | # Baixando Accounts Inventory
1076 | wget https://github.com/InfotelGLPI/accounts/releases/download/2.1.1/glpi-accounts-2.1.1.tar.gz
1077 | tar -zxvf glpi-accounts-2.1.1.tar.gz
1078 | mv accounts /var/www/html/glpi/plugins/accounts
1079 |
1080 | # Baixando FusionInventory
1081 | wget "https://github.com/fusioninventory/fusioninventory-for-glpi/releases/download/glpi090%2B1.4/fusioninventory-for-glpi_0.90.1.4.tar.gz"
1082 | tar -zxvf "fusioninventory-for-glpi_0.90.1.4.tar.gz"
1083 | mv fusioninventory /var/www/html/glpi/plugins/fusioninventory
1084 |
1085 | # Adequando Apache
1086 |
1087 | echo -e "
1088 | AllowOverride All
1089 |
1090 |
1091 | " > /etc/httpd/conf.d/glpi.conf
1092 |
1093 | # Reiniciando apache2
1094 |
1095 | chmod 775 /var/www/html/glpi -Rf
1096 | chown apache:apache /var/www/html/glpi -Rf
1097 |
1098 | chcon -Rv --type=httpd_sys_content_t /var/www/html
1099 |
1100 | setsebool -P httpd_can_network_connect=1
1101 | setsebool -P httpd_can_network_connect_db=1
1102 | setsebool -P httpd_can_sendmail=1
1103 |
1104 | setsebool -P zabbix_can_network=1
1105 | setsebool -P httpd_unified=1
1106 |
1107 | chmod +x /var/www/html/zabbix/conf/
1108 |
1109 | service httpd restart
1110 |
1111 | }
1112 |
1113 | SQL ()
1114 | {
1115 |
1116 |
1117 | clear
1118 |
1119 | echo "Exec Step 4..."
1120 | echo "Creating Data Base for systems.."
1121 | sleep 1
1122 |
1123 |
1124 | test_connection=1
1125 |
1126 | while [ $test_connection != 0 ]
1127 | do
1128 |
1129 | rootPWD_SQL=$(whiptail --title "${TITULO}" --backtitle "${BANNER}" --passwordbox "Step 4 - Enter the root password for the MariaDB database" --fb 10 50 3>&1 1>&2 2>&3)
1130 |
1131 | mysql -uroot -p$rootPWD_SQL -e "" 2> /dev/null
1132 |
1133 | test_connection=$?
1134 |
1135 | if [ $test_connection != 0 ]
1136 | then
1137 | whiptail --title "${TITULO}" --backtitle "${BANNER}" --msgbox "
1138 |
1139 | Step 4 - Error! The root password entered is not valid. Try again!
1140 | " --fb 0 0 0
1141 | fi
1142 | done
1143 |
1144 | zabbixPWD_SQL1=0
1145 | zabbixPWD_SQL2=1
1146 |
1147 | while [ $zabbixPWD_SQL1 != $zabbixPWD_SQL2 ]
1148 | do
1149 |
1150 | zabbixPWD_SQL1=$(whiptail --title "${TITULO}" --backtitle "${BANNER}" --passwordbox "Step 4 - Enter the user's password zabbix to the Database." --fb 10 50 3>&1 1>&2 2>&3)
1151 |
1152 | zabbixPWD_SQL2=$(whiptail --title "${TITULO}" --backtitle "${BANNER}" --passwordbox "Step 4 - Confirm password zabbix user to the Database." --fb 10 50 3>&1 1>&2 2>&3)
1153 |
1154 | if [ $zabbixPWD_SQL1 != $zabbixPWD_SQL2 ]
1155 | then
1156 | whiptail --title "${TITULO}" --backtitle "${BANNER}" --msgbox "
1157 |
1158 | Step 4 - Error! Informed passwords do not match. Try again.
1159 | " --fb 0 0 0
1160 |
1161 | fi
1162 | done
1163 |
1164 | glpiPWD_SQL1=0
1165 | glpiPWD_SQL2=1
1166 |
1167 | while [ $glpiPWD_SQL1 != $glpiPWD_SQL2 ]
1168 | do
1169 |
1170 | glpiPWD_SQL1=$(whiptail --title "${TITULO}" --backtitle "${BANNER}" --passwordbox "Step 4 - Enter the user's password glpi to the Database." --fb 10 50 3>&1 1>&2 2>&3)
1171 |
1172 | glpiPWD_SQL2=$(whiptail --title "${TITULO}" --backtitle "${BANNER}" --passwordbox "Step 4 - Confirm password glpi user to the Database." --fb 10 50 3>&1 1>&2 2>&3)
1173 |
1174 | if [ $glpiPWD_SQL1 != $glpiPWD_SQL2 ]
1175 | then
1176 | whiptail --title "${TITULO}" --backtitle "${BANNER}" --msgbox "
1177 |
1178 | Step 4 - Error! Informed passwords do not match. Try again.
1179 | " --fb 0 0 0
1180 |
1181 | fi
1182 | done
1183 |
1184 | # Criando a base de dados glpi
1185 | echo "Creating glpi database..."
1186 | mysql -u root -p$rootPWD_SQL -e "create database glpi character set utf8";
1187 | echo "Creating glpi user at MariaDB Database..."
1188 | mysql -u root -p$rootPWD_SQL -e "create user 'glpi'@'localhost' identified by '$glpiPWD_SQL1'";
1189 | echo "Making glpi user the owner to glpi database..."
1190 | mysql -u root -p$rootPWD_SQL -e "grant all on glpi.* to glpi with grant option";
1191 | sleep 2
1192 |
1193 | # Criando a base de dados zabbix
1194 | echo "Creating zabbix database..."
1195 | mysql -u root -p$rootPWD_SQL -e "create database zabbix character set utf8";
1196 | echo "Creating zabbix user at MariaDB Database..."
1197 | mysql -u root -p$rootPWD_SQL -e "create user 'zabbix'@'localhost' identified by '$zabbixPWD_SQL1'";
1198 | echo "Making zabbix user the owner to glpi database..."
1199 | mysql -u root -p$rootPWD_SQL -e "grant all on zabbix.* to zabbix with grant option";
1200 | sleep 2
1201 |
1202 | # Configurando /etc/zabbix/zabbix_server.conf
1203 |
1204 | sed -i 's/# DBPassword=/DBPassword='$zabbixPWD_SQL1'/' /etc/zabbix/zabbix_server.conf
1205 | sed -i 's/# FpingLocation=\/usr\/sbin\/fping/FpingLocation=\/usr\/bin\/fping/' /etc/zabbix/zabbix_server.conf
1206 |
1207 | chmod +s /usr/bin/ping
1208 | chmod +s /usr/sbin/fping
1209 | chmod +s /usr/bin/ping6
1210 | chmod +s /usr/sbin/fping6
1211 |
1212 | # Avisar que a base está sendo populada....
1213 | # Popular base zabbix
1214 |
1215 | cd database/mysql/
1216 | echo "Creating Zabbix Schema at MariaDB..."
1217 | mysql -uroot -p$rootPWD_SQL zabbix < schema.sql
1218 | echo "Importing zabbix images to MariaDB..."
1219 | mysql -uroot -p$rootPWD_SQL zabbix < images.sql
1220 | echo "Importing all Zabbix datas to MariaDB..."
1221 | mysql -uroot -p$rootPWD_SQL zabbix < data.sql
1222 | sleep 1
1223 |
1224 | # Inicializando os serviços
1225 |
1226 | echo "Now re-initiate services Zabbix Server and Agent..."
1227 | service zabbix_agentd start
1228 | service zabbix_server start
1229 |
1230 | }
1231 |
1232 | INTEGRA ()
1233 | {
1234 |
1235 | clear
1236 |
1237 | echo "Exec Step 5..."
1238 | echo "Making Systems Integration..."
1239 | sleep 1
1240 |
1241 | git clone $linkJanssen
1242 | mv zabbix-glpi/*zabbix* $externalScriptsDir
1243 | chmod 775 $externalScriptsDir -Rf
1244 | chown zabbix:zabbix $externalScriptsDir -Rf
1245 |
1246 | }
1247 |
1248 | TextoFinal ()
1249 | {
1250 | clear
1251 |
1252 | whiptail --title "${TITULO}" --backtitle "${BANNER}" --msgbox "
1253 |
1254 | Copyright:
1255 | - Verdanatech Solucoes em TI, $versionDate
1256 | - Conectys Tecnologia da Informacao, $versionDate
1257 | Thank you for using our script. We are at your disposal to contact.
1258 | $devMail
1259 |
1260 | PATHS:
1261 | All Zabbix binary and configuration files have been installed in: /usr/local
1262 | The Zabbix FrontEnd and GLPI are in /var/www/html/
1263 | To access GLPI, try http://$serverAddress/glpi
1264 | To access Zabbix, try http://$serverAddress/zabbix
1265 |
1266 | " --fb 0 0 0
1267 |
1268 | }
1269 |
1270 |
1271 |
1272 | # Script start
1273 |
1274 | clear
1275 |
1276 | [ ! -e /usr/bin/whiptail ] && { INSTALA_WHIPTAIL; }
1277 |
1278 | menuPrincipal
1279 |
1280 | while true
1281 | do
1282 | case $menu01Option in
1283 |
1284 | 1)
1285 | reqsToUse
1286 | INSTALA_DEPENDENCIAS
1287 | INSTALL
1288 | SQL
1289 | INTEGRA
1290 | TextoFinal
1291 | kill $$
1292 |
1293 | ;;
1294 |
1295 | 2)
1296 | INFORMATION
1297 | menuPrincipal
1298 | ;;
1299 |
1300 |
1301 | 3)
1302 | showCredits
1303 | menuPrincipal
1304 | ;;
1305 |
1306 | 4)
1307 | TextoFinal
1308 | kill $$
1309 | ;;
1310 |
1311 | esac
1312 | done
1313 |
--------------------------------------------------------------------------------
/port-scan/tcp-port-scan-lld.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | usage() {
4 | echo Uso: $0 hostname
5 | echo "Exemplo: $0 localhost"
6 | }
7 |
8 |
9 | if [ -z $1 ]; then
10 | echo "Nenhum host especificado" > /dev/stderr
11 | usage
12 | exit 1
13 | fi
14 |
15 | Scan=$(nmap -Pn --open -n $1)
16 |
17 | OldIFS=$IFS
18 | IFS="
19 | "
20 | procurar=".*/tcp open .*"
21 |
22 | echo '{"data":['
23 |
24 | contador=0
25 |
26 | for linha in $Scan; do
27 | Tmp=$(echo $linha | sed -e 's/^[[:space:]]*//' | sed -r 's/ +/ /g' | grep $procurar)
28 | if [ $? -eq 0 ]; then
29 | porta=$(echo -n $Tmp | cut -d "/" -f 1 | tr -d "\n")
30 | servico=$(echo -n $Tmp | cut -d " " -f 3 | tr -d "\n")
31 |
32 | if [ "$servico" = "unknown" ]; then
33 | Name="port $Porta"
34 | fi
35 |
36 | if [ $contador -gt 0 ]; then
37 | printf ','
38 | echo
39 | fi
40 | printf '{"{#PORTA}":"%s", "{#SERVICO}":"%s"}' "$porta" "$servico"
41 |
42 | let contador++
43 |
44 | fi
45 | done
46 |
47 | echo
48 | echo ']}'
49 |
50 | IFS=$OldIFS
51 |
--------------------------------------------------------------------------------
/port-scan/zbx_template_tcp_port_scan_lld.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | 2.0
4 | 2015-10-27T18:02:33Z
5 |
6 |
7 | Templates
8 |
9 |
10 |
11 |
12 | TCP port scan LLD
13 | TCP port scan LLD
14 |
15 |
16 |
17 | Templates
18 |
19 |
20 |
21 |
22 | Services
23 |
24 |
25 |
26 |
27 |
28 | Discover network services
29 | 10
30 |
31 |
32 | tcp-port-scan-lld.sh[{HOST.CONN}]
33 | 30
34 | 0
35 |
36 |
37 |
38 | 0
39 | 0
40 |
41 | 0
42 |
43 |
44 |
45 |
46 | 0
47 |
48 |
49 |
50 |
51 |
52 |
53 | 0
54 |
55 |
56 |
57 | 30
58 |
59 |
60 |
61 | {#SERVICO} service is running
62 | 3
63 |
64 | 0
65 |
66 | net.tcp.service[tcp,,{#PORTA}]
67 | 60
68 | 7
69 | 365
70 | 0
71 | 3
72 |
73 |
74 | 0
75 |
76 |
77 | 0
78 | 0
79 |
80 | 0
81 |
82 | 1
83 |
84 |
85 |
86 | 0
87 | 0
88 |
89 |
90 |
91 |
92 |
93 |
94 | 0
95 |
96 |
97 | Services
98 |
99 |
100 |
101 | Service state
102 |
103 |
104 |
105 |
106 |
107 |
108 | {TCP port scan LLD:net.tcp.service[tcp,,{#PORTA}].last(0)}=0
109 | {#SERVICO} service is down
110 |
111 | 0
112 | 3
113 |
114 | 0
115 |
116 |
117 |
118 |
119 |
120 |
121 |
122 |
123 |
124 |
125 |
126 |
127 |
--------------------------------------------------------------------------------
/templates/os-android.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | 3.4
4 | 2017-12-05T20:21:13Z
5 |
6 |
7 | Templates
8 |
9 |
10 |
11 |
12 | Template OS Android
13 | Template OS Android
14 |
15 |
16 |
17 | Templates
18 |
19 |
20 |
21 |
22 | Recursos do Smartphone
23 |
24 |
25 | Zabbix Agent
26 |
27 |
28 |
29 | -
30 | Host name of zabbix_agentd running
31 | 7
32 |
33 |
34 | agent.hostname
35 | 30
36 | 7d
37 | 0
38 | 0
39 | 1
40 |
41 |
42 |
43 |
44 | 0
45 | 0
46 |
47 | 0
48 |
49 |
50 |
51 | 0
52 |
53 |
54 |
55 |
56 |
57 |
58 | 0
59 |
60 |
61 | Zabbix Agent
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 | -
71 | Agent ping
72 | 7
73 |
74 |
75 | agent.ping
76 | 60
77 | 7d
78 | 365d
79 | 0
80 | 3
81 |
82 |
83 |
84 |
85 | 0
86 | 0
87 |
88 | 0
89 |
90 |
91 |
92 | 0
93 |
94 |
95 |
96 |
97 |
98 | The agent always returns 1 for this item. It could be used in combination with nodata() for availability check.
99 | 0
100 |
101 |
102 | Zabbix Agent
103 |
104 |
105 |
106 | Zabbix agent ping status
107 |
108 |
109 |
110 |
111 |
112 |
113 | -
114 | Version of zabbix_agent(d) running
115 | 7
116 |
117 |
118 | agent.version
119 | 3600
120 | 7d
121 | 0
122 | 0
123 | 1
124 |
125 |
126 |
127 |
128 | 0
129 | 0
130 |
131 | 0
132 |
133 |
134 |
135 | 0
136 |
137 |
138 |
139 |
140 |
141 |
142 | 0
143 |
144 |
145 | Zabbix Agent
146 |
147 |
148 |
149 |
150 |
151 |
152 |
153 |
154 | -
155 | Localizacao GPS
156 | 7
157 |
158 |
159 | gps
160 | 30
161 | 0
162 | 0
163 | 0
164 | 1
165 |
166 |
167 |
168 |
169 | 0
170 | 0
171 |
172 | 0
173 |
174 |
175 |
176 | 0
177 |
178 |
179 |
180 |
181 |
182 |
183 | 0
184 |
185 |
186 | Recursos do Smartphone
187 |
188 |
189 |
190 |
191 |
192 |
193 |
194 |
195 | -
196 | Localizacao GPS - Latitude
197 | 18
198 |
199 |
200 | gps.latitude
201 | 0
202 | 90d
203 | 0
204 | 0
205 | 1
206 |
207 |
208 |
209 |
210 | 0
211 | 0
212 |
213 | 0
214 |
215 |
216 |
217 | 0
218 |
219 |
220 |
221 |
222 |
223 |
224 | 0
225 |
226 |
227 | Recursos do Smartphone
228 |
229 |
230 |
231 |
232 |
233 |
234 | 12
235 | $.latitude
236 |
237 |
238 |
239 |
240 | gps
241 |
242 |
243 | -
244 | Localizacao GPS - Longitude
245 | 18
246 |
247 |
248 | gps.longitude
249 | 0
250 | 90d
251 | 0
252 | 0
253 | 1
254 |
255 |
256 |
257 |
258 | 0
259 | 0
260 |
261 | 0
262 |
263 |
264 |
265 | 0
266 |
267 |
268 |
269 |
270 |
271 |
272 | 0
273 |
274 |
275 | Recursos do Smartphone
276 |
277 |
278 |
279 |
280 |
281 |
282 | 12
283 | $.longitude
284 |
285 |
286 |
287 |
288 | gps
289 |
290 |
291 | -
292 | Nível de bateria
293 | 7
294 |
295 |
296 | power.battery_level
297 | 30
298 | 90d
299 | 365d
300 | 0
301 | 3
302 |
303 | %
304 |
305 |
306 | 0
307 | 0
308 |
309 | 0
310 |
311 |
312 |
313 | 0
314 |
315 |
316 |
317 |
318 |
319 |
320 | 0
321 |
322 |
323 | Recursos do Smartphone
324 |
325 |
326 |
327 |
328 |
329 |
330 |
331 |
332 | -
333 | Fonte de energia
334 | 7
335 |
336 |
337 | power.source
338 | 30
339 | 90d
340 | 0
341 | 0
342 | 1
343 |
344 |
345 |
346 |
347 | 0
348 | 0
349 |
350 | 0
351 |
352 |
353 |
354 | 0
355 |
356 |
357 |
358 |
359 |
360 |
361 | 0
362 |
363 |
364 | Recursos do Smartphone
365 |
366 |
367 |
368 |
369 |
370 |
371 |
372 |
373 | -
374 | Status da bateria
375 | 7
376 |
377 |
378 | power.status
379 | 30
380 | 90d
381 | 0
382 | 0
383 | 1
384 |
385 |
386 |
387 |
388 | 0
389 | 0
390 |
391 | 0
392 |
393 |
394 |
395 | 0
396 |
397 |
398 |
399 |
400 |
401 |
402 | 0
403 |
404 |
405 | Recursos do Smartphone
406 |
407 |
408 |
409 |
410 |
411 |
412 |
413 |
414 | -
415 | Carga de CPU
416 | 7
417 |
418 |
419 | system.cpu.load[]
420 | 30
421 | 90d
422 | 365d
423 | 0
424 | 0
425 |
426 |
427 |
428 |
429 | 0
430 | 0
431 |
432 | 0
433 |
434 |
435 |
436 | 0
437 |
438 |
439 |
440 |
441 |
442 |
443 | 0
444 |
445 |
446 | Recursos do Smartphone
447 |
448 |
449 |
450 |
451 |
452 |
453 |
454 |
455 | -
456 | Memória livre
457 | 7
458 |
459 |
460 | vm.memory.size[free]
461 | 30
462 | 90d
463 | 365d
464 | 0
465 | 0
466 |
467 | B
468 |
469 |
470 | 0
471 | 0
472 |
473 | 0
474 |
475 |
476 |
477 | 0
478 |
479 |
480 |
481 |
482 |
483 |
484 | 0
485 |
486 |
487 | Recursos do Smartphone
488 |
489 |
490 |
491 |
492 |
493 |
494 | 1
495 | 1000000
496 |
497 |
498 |
499 |
500 |
501 | -
502 | Memória total
503 | 7
504 |
505 |
506 | vm.memory.size[total]
507 | 30
508 | 90d
509 | 365d
510 | 0
511 | 3
512 |
513 | B
514 |
515 |
516 | 0
517 | 0
518 |
519 | 0
520 |
521 |
522 |
523 | 0
524 |
525 |
526 |
527 |
528 |
529 |
530 | 0
531 |
532 |
533 | Recursos do Smartphone
534 |
535 |
536 |
537 |
538 |
539 |
540 | 1
541 | 1000000
542 |
543 |
544 |
545 |
546 |
547 |
548 |
549 |
550 |
551 |
552 |
553 |
554 |
555 |
556 |
557 | {Template OS Android:agent.hostname.diff(0)}>0
558 | 0
559 |
560 | Host name of zabbix_agentd was changed on {HOST.NAME}
561 | 0
562 |
563 |
564 | 0
565 | 1
566 |
567 | 0
568 | 0
569 |
570 |
571 |
572 |
573 | {Template OS Android:agent.version.diff(0)}>0
574 | 0
575 |
576 | Version of zabbix_agent(d) was changed on {HOST.NAME}
577 | 0
578 |
579 |
580 | 0
581 | 1
582 |
583 | 0
584 | 0
585 |
586 |
587 |
588 |
589 | {Template OS Android:agent.ping.nodata(5m)}=1
590 | 0
591 |
592 | Zabbix agent on {HOST.NAME} is unreachable for 5 minutes
593 | 0
594 |
595 |
596 | 0
597 | 3
598 |
599 | 0
600 | 0
601 |
602 |
603 |
604 |
605 |
606 |
607 | Carga de CPU
608 | 900
609 | 200
610 | 0.0000
611 | 100.0000
612 | 1
613 | 1
614 | 0
615 | 1
616 | 0
617 | 0.0000
618 | 0.0000
619 | 0
620 | 0
621 | 0
622 | 0
623 |
624 |
625 | 0
626 | 5
627 | 00EEEE
628 | 0
629 | 2
630 | 0
631 | -
632 | Template OS Android
633 | system.cpu.load[]
634 |
635 |
636 |
637 |
638 |
639 | Memória
640 | 900
641 | 200
642 | 0.0000
643 | 100.0000
644 | 0
645 | 0
646 | 0
647 | 1
648 | 0
649 | 0.0000
650 | 0.0000
651 | 0
652 | 0
653 | 0
654 | 0
655 |
656 |
657 | 0
658 | 5
659 | 1A7C11
660 | 0
661 | 2
662 | 0
663 | -
664 | Template OS Android
665 | vm.memory.size[total]
666 |
667 |
668 |
669 | 1
670 | 5
671 | F63100
672 | 0
673 | 2
674 | 0
675 | -
676 | Template OS Android
677 | vm.memory.size[free]
678 |
679 |
680 |
681 |
682 |
683 | Nível de bateria
684 | 900
685 | 200
686 | 0.0000
687 | 100.0000
688 | 1
689 | 1
690 | 0
691 | 1
692 | 0
693 | 0.0000
694 | 0.0000
695 | 0
696 | 0
697 | 0
698 | 0
699 |
700 |
701 | 0
702 | 5
703 | EEEE00
704 | 0
705 | 2
706 | 0
707 | -
708 | Template OS Android
709 | power.battery_level
710 |
711 |
712 |
713 |
714 |
715 |
716 |
717 | Zabbix agent ping status
718 |
719 |
720 | 1
721 | Up
722 |
723 |
724 |
725 |
726 |
727 |
--------------------------------------------------------------------------------