Simon icon Simon
Flexible server monitoring

test for file permission change?

Is there a way to tell if a specified files permissions have changed on a remote server?

for example, if the permissions for:
/usr/bin/sudo

change from:
-r-s--x--x root:wheel

to anything else... then alert me.

i see the default option for "file is writable" but am not sure how to accomplish what i need.

thanks

David Sinclair's picture

Re: test for file permission change?

You could check for that by creating a Script-based service that simply contains the following line:

ls -la /usr/bin/sudo

In fact, I've just created this new service for you, called File Attributes; you can download it from the Simon Extras page.

Once that service is added, you can simply create a new test and select it, and enter the /usr/bin/sudo path. Use Smart Change Detection to alert you if that changes: ensure the Smart Change Detection checkbox is enabled, and add a Change notifier.

thanks!!!

!!!

usage...

How would this be used to check for a file change on another computer? I am evaluating Simon for purchase and am not terribly experienced with it yet.

For test like HTTP, there is a field for the computer IP. For this service test, I don't see this field as an option.

Thanks!

David Sinclair's picture

Re: usage...

Oh, sorry... I got carried away with the checking attributes part, and overlooked the remote part.

For that, you'd need to SSH into the machine first, then use the command.

I'm not sure that it's possible to include the password as input for ssh in the script, though. So another option would be to duplicate the existing SSH service and add a line to the session to issue the ls -la /usr/bin/sudo command.