On Sun, 20 Sep 1998, Gabe Harriman wrote:
> Does anyone have an idea on how to make linux send an email to someone
> whenever DHCPcd obtaines a different IP address? Is there a script already
> made for this?
I think that there is a script in /etc/dhcpcd (or something like that)
that is run by dhcpcd. I can't remember whether it is run when dhcpcd is
started, or every time it gets a new address, though. It usually does
stuff like set up default routes. You could insert stuff to do whatever
you want, including send email. This is of course assuming that it runs
every time dhcp gets a new address.
If it doesn't, there are tools that do things whenever they see certain
entries in your syslog. (Usually used for security monitoring, I think)
DHCPcd always logs when it gets a new IP address (and even when it just
renews the current lease). You could probably run such a tool to monitor
syslog and send email when it sees a dhcpcd message that fits certain
criteria. I've never used one of these tools, so I can't tell you how to
use them or what exactly to use.
The first way would be much easier, if it works.
HTH,
Todd Greer <[EMAIL PROTECTED]>
---------------------------------------------------------------------------
Send administrative requests to [EMAIL PROTECTED]