Re: Perl scripts
Ian Eiloart <[email protected]> Sat, 24 Jun 2006 14:38:21 +0100
| Newsgroups | gmane.comp.apache.mod-wackamole.general |
|---|---|
| Message-ID | <056E75A50D3F5A50A1C74F84@Vigor10> |
>> I've managed to get a perl function logging to syslog, but I don't >> see how to work out what the new IP address is. Does the perl >> function get called with any parameters? Is there a way to do that? >> If not, is there another way of deciding which interfaces just came >> up? > > It isn't doc'd. check in perl.c: you get three arguments: > > (1) hash ref with the psuedo interface that was affected. > (2) an array ref of hashrefs of the extra interfaces associated with it > (3) hash ref with the real interface that was affected. Ah, that's excellent - thanks, Theo. I had managed to see that there was a hash, and empty array (but my test case has only one IP address per VIF) and another hash. I'd not managed to figure out the content of the hashes. I'll put more effort in now that I know that there is valuable data there! > These are complicated to explain, I suggest Dumper'ing them to see what > you get first -- it might be obvious at that point. > >> I'm using MacOSX 10.4 with this config: >> >> # Named socket for online control >> Control = /var/run/wack.it >> PerlUseLib /opt/local/etc/ >> PerlUse wackamole >> RunDynamic wackamole::mysub on up >> >> mysub just prints a string to syslog. I tried to capture arguments >> passed to mysub by dumping $_ into the string, but couldn't make >> any sense of the output. That could be my perl ignorance, though. > > use Data::Dumper; > print LOGFILE Dumper(\@_); > > > // Theo Schlossnagle > // CTO -- http://www.omniti.com/~jesus/ > // OmniTI Computer Consulting, Inc. -- http://www.omniti.com/ > // Ecelerity: Run with it. > > > > _______________________________________________ > wackamole-users mailing list > [email protected] > http://lists.backhand.org/mailman/listinfo/wackamole-users -- Ian Eiloart IT Services, University of Sussex