...
The cmk commands have the option to profile them.
Code Block language bash theme RDark OMD[mysite]:~$ cmk |grep profile --profile Enable profiling mode
.
The profile file will be created in the current directory. Let's go to tmp and run the cmk command with the profile option.
Code Block language bash theme RDark ➜ ~ su - at OMD[mysite]:~$ cd tmp OMD[mysite]:~$ cmk -Afv --profile
Note cmk -Afv --profile is only one example. This command will trigger the agent baking via the CLI. You may need to profile a different command.
.
Now we will see two files:
Code Block language bash theme RDark OMD[mysite]:~/tmp$ ls |grep profile profile.out* show_profile.py*
.
To work with these files, we need to copy them outside the site.
Code Block language bash theme RDark OMD[mysite]:~/tmp$ cp show_profile.py profile.out /tmp/
.
- Now there are two ways to analyze these files:
Open the profile file via the command line:
Code Block language bash theme RDark ➜ /tmp ./show_profile.py
- Analyze via snakevize as described here: 9473249
...