I have written a udev rule that call a script to send email when a usb drive is attached/removed. so far its working fine. following is my udev rule and send email script:
SUBSYSTEM=="usb", ACTION=="add", RUN+="/u/usb_added %b"
SUBSYSTEM=="usb", ACTION=="remove", RUN+="/u/usb_removed %b"
But in sendemail script i also want to include detail of usb drive (usb size, label, mounted on and time of attachment). But I dont know how to get this information. can anyone please help me either from udev or to write a script in bash to read log/messages and fetch this information.