check_file_age plugin you can monitor not only the last modification date of a file, but also its size. In the simplest case it is just run with the name and path of the file to be monitored:
user@linux:nagios/libexec$ ./check_file_age /var/log/messages WARNING - /var/log/syslog/messages is 376 seconds old and 7186250 bytes
Here the plugin gives a warning, since the warning limit set is 240 seconds and the critical limit, 600 seconds. The last modification of the file was 376 seconds ago—that is, inside the warning range.
The file size is taken into account by
check_file_age only if a warning limit for the file size (option
-W) is explicitly specified. The plugin could then give a warning ...