Oracles ExaWatcher is a nice tool to sample some OS related measurements and keep them for a short period (normally some days) for later analysis. As its name indicates, it exists only on Oracles Engineered systems. A more general tool for non-Engineered Systems is OSWatcher - similar in many areas, but not in the content of this post.
ExaWatcher collect a lot of default information about the system. But sometimes (or somewhere) additional details would be fine to be collected. Of course I can always write my own script to be scheduled in cron and then handle the results. But I am lucky: ExaWatcher provides an interface to extend it's collection: cusom samplers can be implemented easily.
Speaking of easily, the documentation is correct, but somehow a little sparse (Or I'm just not capable of reading it, which is also likely).
I created a script PsSwap.sh based on my previous post stored in /opt/oracle.ExaWatcher/.
To use it, the documentation provides the parameter --customcmd.
| To include a custom collection module in the current group. Example: |
/opt/oracle.ExaWatcher/ExaWatcher.sh --group --start "now" --end "never" --interval 5 --count 360 \
--command_mode "SELECTED" --customcmd 'ProcSwap;;"ProcSwap.sh"'
Can't exec "ProcSwap.sh": No such file or directory at /opt/oracle.ExaWatcher//ExaWatcherParserElements.pm line 2086, <gen3> line 24.
[1693909750][2023-09-05 12:29:10][WARNING][/opt/oracle.ExaWatcher/ParserExaWatcher.pl][ExaWatcherParserElements::format_custom_CMDs][] The custom command "ProcSwap.sh" is not supported by your system. It will be skipped.
It's fine to know it can not be executed, but no reason was given.
/opt/oracle.ExaWatcher/ExaWatcher.sh --group --start "now" --end "never" --interval 5 --count 360 \
--command_mode "SELECTED" --customcmd 'ProcSwap;;"/opt/oracle.ExaWatcher/ProcSwap.sh"' --createconf bx
the result looks promising:
...
[1693909952][2023-09-05 12:32:32][INFO][/opt/oracle.ExaWatcher/ParserExaWatcher.pl][ExaWatcherParserElements::format_custom_CMDs][] CCMDInfo: ProcSwap "/opt/oracle.ExaWatcher/ProcSwap.sh". - scalar: 2
[1693909952][2023-09-05 12:32:38][INFO][/opt/oracle.ExaWatcher/ParserExaWatcher.pl][ExaWatcherParserElements::format_custom_CMDs][] ExaWatcher will automatically generate a name for custom commmand "/opt/oracle.ExaWatcher/ProcSwap.sh".
The previous custom command name "ProcSwap" will be replaced by a new name "CustomCMD0_ProcSwap".
and also the config file contains the expected lines:
...
<Group>
<Start> now
<End> never
<Interval:s> 5
<Count> 360
<CommandMode> SELECTED
<CustomCMD> CustomCMD0_ProcSwap;;"/opt/oracle.ExaWatcher/ProcSwap.sh"
<RunEnd>
The last steps are easy: Adding the line <CustomCMD> ProcSwap;;"/opt/oracle.ExaWatcher/ProcSwap.sh"
to ExaWatcher.conf and restart ExaWatcher.
After ProcSwap.sh is executed once, there is a new directory in /opt/oracle.ExaWatcher/archive/CustomCMD.ExaWatcher/CustomCMD0_ProcSwap and a file there 2023_09_10_10_59_59_CustomCMD0_ProcSwap_<hostname>.dat
The header of this file looks promising as it's identical to all the other data collections by ExaWatcher:
############################################################
# Starting Time: 09/10/2023 10:59:59
# Sample Interval(s): 5
# Archive Count: 360
# Collection Module: CustomCMD0_ProcSwap
# Collection Command: /opt/oracle.ExaWatcher/ProcSwap.sh
# Misc Info: ############################################################
zzz <09/10/2023 10:59:59> Count:0
112 kB 1 root systemd
12 kB 815 root lvmetad
Keine Kommentare:
Kommentar veröffentlichen