On Sun, 10 Apr 2011 14:42:11 -0400 Jesse Becker <becker...@mail.nih.gov> wrote: 

JB> Here's a question:  how does one detect a *new* IP address getting added
JB> to a system?

JB> For example, if there's some mecahnism for bringing up a new interface
JB> (such as failover/heartbeat mechanism), is there a way to detect this?
JB> I suppose that some sort of log-processing mechanism could do this, but
JB> that won't help in the case of manual intervention.

You could store the list of IPs to find out if the interfaces' address
assignment has changed.  For example, if you can install the Perl
Regexp::Common module:

ifconfig -a | perl -MRegexp::Common -n -e 'print "$_\n" foreach 
m/$RE{net}{IPv4}/g'

You can do this by looking at /proc/net/* I think, but don't know all
the files involved offhand and /proc is not always available.

Detecting new interfaces can be done with ifconfig -a, again, or by
looking at /proc/net/dev.

Ted
_______________________________________________
Help-cfengine mailing list
Help-cfengine@cfengine.org
https://cfengine.org/mailman/listinfo/help-cfengine

Reply via email to