I have got the requirement to find the core file in multiple box/machine and trigger email about core file generation.
Do we have any utility which help us to find core in single machine or multiple machine.
I believe we should have any utility to find the core file beacuse it is very generic scenario.
After the below input, I am able to write a perl script which find the core file and trigger mail if any core file exist
This script work fine into local machine but I need to add all Production server. Does anyone also provide me any idea to connect linux terminal through Perl script.
As of now, we are concentrating on dev machine So this script can login into all dev machine and find the core file.
The old-fashioned way is to periodically search the whole filesystem for core files:
or
This, naturally, does have the risk of matching user files with the (rather unfortunate) name
core.Fortunately, modern Linux systems are somewhat more configurable. You can use the
/proc/sys/kernel/core_patternfile to set up a specific directory where core files will be placed, as well as a format for the name of the file. You can have core filenames that contain the name of the program, the UID and GID under which it was launched and so on – have a look at this manual page.This way you can keep all your core files in a single directory, which has several advantages:
You do not risk having core files sprinkled all over the filesystem.
You can easily remove all core files without the computational expense of searching all over the filesystem and without the risk of removing user files.
Since all core files are in a single place, it is far more reasonable to poll for new files as needed.
If you want immediate action, you can avoid polling by using
inotifywaitor other tools based oninotifyto monitor the core file directory.