Need to enable Notification if a particular file (lock file) present in a directory

Hi,

I am using icinga web2. There is a requirement that a particular log file under a directory needs to be checked by icinga. It seems that this particular plugin, https://www.monitoring-plugins.org/doc/man/check_file_age.html can be a potential candidate.

If any one has actually implemented this scenario in icinga, please let me know how it was done.

Thank you!

Hi
Welcome to Community Good Day!
how exactly you want to use the plugin as your subject indicates you want to enable notification
can you be more specific

check_file_age is a plugin to check to file to find out the modification time of the file and size

Please check the below example using file_age in ITL
I am using director way
you can give threshold as per your needs

apply Service “file_age” {
import “file_age_templ”

assign where "Linux-Servers_Testing" in host.templates
vars.file_age_file = "/var/log/monitor_*.log"

import DirectorOverrideTemplate

}

file_age

Hope this helps

Cheers,
Krishna

1 Like

Hi,

Thanks. Sorry for the delayed response.
I think the option, file_age_ignoremissing will verify if the file exists.

I will try setting this plugin and test if it works as per the requirement.

Thanks,
Sreenadh