I'm working in a Linux-based environment where there are more than 100 servers. I need to get a mail notification and popup notification whenever anyone connects a storage device. How do I configure that?
I'm working in a Linux-based environment where there are more than 100 servers. I need to get a mail notification and popup notification whenever anyone connects a storage device. How do I configure that?
The simplest way to do this is to monitor for the word 'mount' in /var/log/syslog on a cronjob. This sample would run every 10 minutes.
Make sure the date format matches what is in your logs. You can use whatever sendmail command you wish. If you wanted once a minute just remove the time truncate line. If you wanted immediate, you'd need to monitor
udisksctl monitor
for output. Once the email is sent, you can use any email notification for your popup.