cPanel & WHM Version
100.0.9

Ram Freedman

Active Member
Jul 18, 2017
25
2
53
Israel
cPanel Access Level
Website Owner
Hi,
Is there a way to send an alert by webhook or email when a certain file is updated / changed?

I have a file that I need to know immediately when it's updated / changed so I can upload a fixed version of him.
If there is a way to automatically upload another version any time this file is changed - it's will be awesome, but if not getting an alert by webhook or by email that something happened to the file and that I should fix it - will also be superb.

So - Is there a way to get a Webhook when a specific file is changed?

Thanks!
Ram
 

cPRex

Jurassic Moderator
Staff member
Oct 19, 2014
16,569
2,612
363
cPanel Access Level
Root Administrator
Hey there! I don't know about the webhook side of things, but Linux has the auditd system built-in. We have a guide at the following link that explains how the tool works and gives an example of how to watch for changes to a file:


I'd start there and see if that will do what you're looking for.
 

Ram Freedman

Active Member
Jul 18, 2017
25
2
53
Israel
cPanel Access Level
Website Owner
Hey there! I don't know about the webhook side of things, but Linux has the auditd system built-in. We have a guide at the following link that explains how the tool works and gives an example of how to watch for changes to a file:


I'd start there and see if that will do what you're looking for.
Dear cPRex
Thanks for the lead.

As far as I can see from the link you provided (Thanks for that!) to use the Linux Auditing System I should install it, restart the server, create a permanent rule in /etc/audit/rules.d/audit.rules file and finally manually search the audit logs of the result.

I'm looking for a way to get the information pushed to an email address (if not directly to a webhook) as soon as the trigger I set will occur - and I don't think there is such an option while using the Auditing System (even if I found a way to set a rule for a specific file size change - because I want the trigger to be only when a specific file size will change).

I found a way to do something similar - using the lfd Directory File Watching as mentioned here and also mentioned here.
I configured the relevant email address as described here - and I started getting the email alerts - The problem is that I get such an alert every 5 minutes regardless if the file was changed or not....

Is there a way to get an alert only when there is a change in the file size?

Thanks!
Ram