I worked on configuring the mk_oracle plugin to update the mk_oracle.cfg file to ensure that an update to the plugin wouldn't overwrite (remove) the changes for using Custom SQL, since these configurations are done manually on the host.
We found a Check_MK Werk that brings us a solution to this problem:
Which I documented promptly:
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:
I scheduled a meeting to discuss Dashboards with the team from France.
I tried to track the delivery of my passport, but the tracking code provided didn't return anything...
But some time later it appeared... I believe it hadn't been posted yet. I just don't know how they got the tracking code without the posting 😒
We also began exploring options for our stay in the USA:
"Humble Patriot Week :
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 - this amount would be split by two couples
My Favorite:
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
All the prices above are for 6 nights. In this package, we would buy drinks, foods, and be more comfortable.
This is an idea, all days in the same place, it would save a lot of money, and give us a break from restaurants, Meat and Alcoholic Beverage at home (we don't need more, right?)
Patriot Week “I did the L for this” :
In this package the first two nights would be at a Hotel/Resort by Universal and we would complete it at one of the above Air BNBs:
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 - this amount would be split by two couples
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 - this amount would be split by two couples
PLUS
Universal Hotel (no rhyme) - Universal's Endless Summer Resort - Surfside Inn and Suites - 2 apartments – US$470 divided by 2 couples
The advantage here would be going to this park and being inside it, with access 1 hour before to the attractions (early access right?)
Patriot Week “let's fuck Mickey's ass”:
The same shit as before, but Disney instead of Universal: Disney's Port Orleans Resort – Riverside
US$ 638 per room!
Remember that for both parks, we have to buy the tickets separately. Good news, we can use our resident discount."
We opted for the Humble Patriot Week, at Villatel Orlando Resort, and from there we will make our plans as needed... By demand.
Comentários
Postar um comentário