Greetings!
I have a perl script which displays a menu. Each menu item is generated from a list of module scripts in a specified directory. So basically we can write module scripts to perform routine tasks, and offer them to our operations team in a nice (safe) menu format.
The script is run via sudo as a login shell. So their login shell is /usr/local/bin/login.sh which just contains: sudo /usr/local/bin/menu.pl (and some traps and whatnot) ...
The piece I'm missing is the ability to log the ip address of those who run the menu. Something like:
<date> <ip address> <choice / script ran> ....
The question is: What's a good way to determine the ip address of the person running items in the script? I suppose I could pull it from the login shell before it fires off the perl script, but I'm hoping that the IP can be determined from the perl script, even after sudo. Ah, it's running on solaris and linux machines.