I will give an example of checking the integrity of a file through checksum calculation using Zabbix agent.
It’s quite simple, we create a data element with the type “Zabbix agent” and, for example, a key (where /dir/file.txt is the file to be checked):
vfs.file.cksum[/dir/file.txt]
Now to find out when the file changes, create a trigger with the expression:
{Template:vfs.file.cksum[/dir/file.txt].diff(0)}>0
See also my article:
File Integrity Check Script