22 de Março de 2024
Trabalhei na configuração do plugin mk_oracle para atualizar o arquivo mk_oracle.cfg afim de um update no plugin não vir a sobrescrever (remover) as alterações das configurações para usar Custom SQL, já que essas configurações são feitas manualmente no host.
Achamos um Werk do Check_MK que nos trás uma solução para esse problema:
O qual documentei logo de pronto:This is a guide to deploy Custom SQLs checks for Oracle Agent. As there still isn't how to configure this in the GUI, and the Agent Bakery will overwrite the changes made directly into the mk_oracle.cfg file, this document will guide to do a safe configuration and thus avoid the overwriting of the mk_oracle.cfg file.
1) Make a directory "mk_oracle.d" inside the $MK_CONFDIR directory. Usually its /etc/check_mk
#mkdir mk_oracle.d
2) Also create a directory where yours .sql files will be placed, into the same $MK_CONFDIR
#mkdir sqldir
3) The sql script ouput must be as following:
details: here is a breaf description over the output for the services output;
exit: Here is the value that will inform if 0 - OK ;
perfdata: [ Leave this empty ];
long: A long detailed text for the services output)
For example:
"corrupted_blocks_check.sql":
set serveroutput on
set feedback off
declare
ncount NUMBER;
filenumber NUMBER;
blocknumber NUMBER;
vCorruption VARCHAR2(20);
begin
select count(*) INTO ncount from v$database_block_corruption;
if ncount = 1 then
select file#, block#, corruption_type
into filenumber, blocknumber, vCorruption
FROM v$database_block_corruption;
dbms_output.put_line('details: File Number:' || filenumber ||' Block Number: '|| blocknumber ||' Corruption Type: ' || vCorruption);
dbms_output.put_line('exit: 1');
dbms_output.put_line('perfdata:');
dbms_output.put_line('long: Corrupted File/Block was detected');
elsif ncount > 1 THEN
dbms_output.put_line('Multiple Block Corruption was detected: '||ncount);
dbms_output.put_line('exit: 2');
dbms_output.put_line('perfdata:');
dbms_output.put_line('long: For more details do: SELECT FILE#, BLOCK#, CORRUPTION_TYPE FROM v$database_block_corruption');
else
dbms_output.put_line('details: No blocks corrupted');
dbms_output.put_line('exit: 0');
dbms_output.put_line('perfdata:');
dbms_output.put_line('long:');
end if;
end;
/
4) Create a .cfg file inside mk_oracle.d directory
#vi custom_sql.cfg
5) The .cfg file must have this format:
SQLS_SECTIONS="CorruptedBlocks,db_files"
CorruptedBlocks () {
SQLS_SIDS="XE"
SQLS_DIR="/etc/check_mk/sqldir"
SQLS_SQL="corrupted_blocks_check.sql"
}
db_files () {
SQLS_SIDS="XE"
SQLS_DIR="/etc/check_mk/sqldir"
SQLS_SQL="db_files.sql"
}
5.1) Where...
SQLS_SECTIONS - Refers to all the Custom SQL services you want to run, comman (",") separated and between double quotes ( "" );
Bellow this all the sessions gave to the SQLS_SESSIONS entry
CorruptedBlocks () {
SQLS_SIDS="XE" --> SID where you want to run this SQL. *
SQLS_DIR="/etc/check_mk/sqldir" --> Directory where the .sql script is placed
SQLS_SQL="corrupted_blocks_check.sql" --> Name of the .sql file
}
*If the Oracle Plugin is configured to use REMOTE INSANCE you must use the REMOTE_INSTANCE entry here, for example
SQLS_SIDS="REMOTE_INSTANCE_PICASSO1"
6) The output at Check_MK will be something like this:
Realizei o agendamento da reunião para discutirmos sobre os Dashboards com o time da França.
Tentei rastrear a entrega do meu passaporte, mas o código de rastreamento dado não retornou nada...
Mas algum tempo depois ele apareceu... Acredito que não havia sido postado ainda. Só não sei como conseguiram o código de rastreamento sem a postagem 😒
Também começamos a analisar as opções para nossa estadia nos EUA:
"Semana Patriota humildão :
https://www.airbnb.com/rooms/43716981?adults=4&category_tag=Tag%3A8528&children=1&enable_m3_private_room=true&photo_id=1017699670&search_mode=flex_destinations_search&source_impression_id=p3_1710961505_3xU9geWQjMMeMvEh&previous_page_section_name=1000&federated_search_id=4f794de5-2364-437c-9fae-0a145729a8fb&guests=1&check_in=2024-05-07&check_out=2024-05-12
US$1621 - esse valor seria dividido por 2 casais
Meu Favorito:
https://www.booking.com/hotel/us/orlando-resort.en-gb.html?aid=304142&label=gen173nr-1FCAEoggI46AdIM1gEaI4CiAEBmAEJuAEHyAEN2AEB6AEB-AELiAIBqAIDuALDuu2vBsACAdICJGVhN2I1NTJhLTRhZmQtNDllMC05ODRhLWRiZmI4YmE5MmMyY9gCBuACAQ&sid=5946b0a3268fc9dfe59921aea48604a1&age=2&all_sr_blocks=1072634006_388826457_10_0_0&checkin=2024-05-07&checkout=2024-05-12&dest_id=20023488&dest_type=city&dist=0&group_adults=4&group_children=1&hapos=1&highlighted_blocks=1072634006_388826457_10_0_0&hpos=1&matching_block_id=1072634006_388826457_10_0_0&nflt=ht_id%3D220%3Bdi%3D4909&no_rooms=1&req_adults=4&req_age=2&req_children=1&room1=A%2CA%2CA%2CA%2C2&sb_price_type=total&sr_order=popularity&sr_pri_blocks=1072634006_388826457_10_0_0__102143&srepoch=1710973230&srpvid=77629b34be8700f1&type=total&ucfs=1&activeTab=main
Todos os precos acima sao para 6 noites. Neste pacote comprariamos bebidas . comidas e ficariamos mais a vontade.
Essa eh uma ideia , todos os dias no mesmo local, daria uma economia boa, e daria uma folga para restaurantes, Carne e Bebida alcolica pra casa ( nao precisamos de mais , right?)
Semana Patriota “Fiz o L pra isso” :
Nesse pacote as duas primeiras noites seriao em um Hotel/Resort da Universal e completariamos em um dos Air BNB acima:
https://www.airbnb.com/rooms/43716981?adults=4&category_tag=Tag%3A8528&children=1&enable_m3_private_room=true&photo_id=1017699670&search_mode=flex_destinations_search&source_impression_id=p3_1710961505_3xU9geWQjMMeMvEh&previous_page_section_name=1000&federated_search_id=4f794de5-2364-437c-9fae-0a145729a8fb&guests=1&check_in=2024-05-09&check_out=2024-05-12
USS$1.165 - esse valor seria dividido por 2 casais
https://www.booking.com/hotel/us/orlando-resort.en-gb.html?aid=304142&label=gen173nr-1FCAEoggI46AdIM1gEaI4CiAEBmAEJuAEHyAEN2AEB6AEB-AELiAIBqAIDuALDuu2vBsACAdICJGVhN2I1NTJhLTRhZmQtNDllMC05ODRhLWRiZmI4YmE5MmMyY9gCBuACAQ&sid=5946b0a3268fc9dfe59921aea48604a1&age=2;all_sr_blocks=1072634006_388826457_10_0_0;checkin=2024-05-09;checkout=2024-05-12;dest_id=20023488;dest_type=city;dist=0;group_adults=4;group_children=1;hapos=1;highlighted_blocks=1072634006_388826457_10_0_0;hpos=1;matching_block_id=1072634006_388826457_10_0_0;no_rooms=1;req_adults=4;req_age=2;req_children=1;room1=A%2CA%2CA%2CA%2C2;sb_price_type=total;sr_order=popularity;sr_pri_blocks=1072634006_388826457_10_0_0__65974;srepoch=1711129492;srpvid=e6517cc08b1b01e8;type=total;ucfs=1&#hotelTmpl
USS$660 - esse valor seria dividido por 2 casais
PLUS
Hotel Universal ( sem rima) - Universal's Endless Summer Resort - Surfside Inn and Suites - 2 apartamentos – US$470 dividido por 2 casais
A Vantage aqui seria ir pra esse park e estar dentro dele, e com acesso 1 hora antes para as atracoes ( early access right? )
Semana Patriota “ vamos comer o cu do Mickey” :
A mesma merda de antes, so que a Disney no Lugar da Universal: Disney's Port Orleans Resort – Riverside
USS$ 638 por quarto!
Lembrando que ambos parques, temos que comprar os ticktes por fora. Boa Noticia, podemos usar o nosso desconto pra residente."
Ficamos com a Semana Patriota Humildão, no Villatel Oralando Resort, e de lá vamos fazendo nossa programação por demanda...
Comentários
Postar um comentário