Welcome, Guest. Please login or register.

Author Topic: Play time: nedi.pl -f (nedi.pl -n)  (Read 4878 times)

oxo

  • Guest
Play time: nedi.pl -f (nedi.pl -n)
« on: November 23, 2009, 03:13:15 PM »
I got tired of waiting for reverse pointer waits in connection with DNS: this "patch" allows one to not make reverse pointer lookups.
Means the DNS name is not present for an IP address.


nedi.pl
Quote
-f    Do not resolve node ip address to name


getopts('a:AbBdDFfiILNoprt:u:U:vw:y',\%opt) or &Help();
libmisc.pl
Quote
       if($getna){
                $main::nod{$mc}{au} = $main::now;
                if(exists $arpn{$mc}){                                                  # ARPwatch got a name, ...
                        $main::nod{$mc}{na} = $arpn{$mc};
                }else{
                        if (!$main::opt{f}){
                                $main::nod{$mc}{na} = gethostbyaddr(inet_aton($arp{$mc}), AF_INET) or $main::nod{$mc}{na} = "";
                        }else{
                                $main::nod{$mc}{na} = "";
                        }
                }
        }
« Last Edit: November 27, 2009, 02:57:35 PM by oxo »

rickli

  • Administrator
  • Hero Member
  • *****
  • Posts: 2732
    • View Profile
    • NeDi
Re: nedi.pl -f
« Reply #1 on: November 23, 2009, 06:18:21 PM »
Good idea, bad choice of parameter  :) -f means fingerprint now...

As -F means FQDN's for devices though, this makes sense. Will think about a potential rearrangement of options, before final 1oh5...
Please consider Other-Invoices on your NeDi installation for an annual contribution, tx!
-Remo

oxo

  • Guest
Re: nedi.pl -f
« Reply #2 on: November 24, 2009, 08:51:54 PM »
OK did it again with 105 :)

Testing ...

Quote
getopts('hHa:AbBdDf:FiILnNoprt:u:U:vw:y',\%opt) || &HELP_MESSAGE;

&HELP_MESSAGE if $opt{'h'};                                       # not needed
&HELP_MESSAGE if $opt{'H'};                                       # not needed
Quote
       print "-n       don't try to do reverse DNS on nodes: speed up\n";
Quote
       if($getna){
                $main::nod{$mc}{au} = $main::now;
                if(exists $arpn{$mc}){                                                  # ARPwatch got a name, ...
                        $main::nod{$mc}{na} = $arpn{$mc};
                }else{
                        $main::nod{$mc}{na} = gethostbyaddr(inet_aton($arp{$mc}), AF_INET) or $main::nod{$mc}{na} = "" if !$main::opt{n};
                }
        }
« Last Edit: November 26, 2009, 11:17:59 AM by oxo »

rickli

  • Administrator
  • Hero Member
  • *****
  • Posts: 2732
    • View Profile
    • NeDi
Re: nedi.pl -f
« Reply #3 on: November 25, 2009, 07:25:41 PM »
Just a question to start off. How long does it take AFTER the first discovery to resolve the nodes? I remember it was a few seconds on my old workplace (topping 5000 nodes now). Remember only new ones, those where the last update was longer than retire ago or those where the IP changed are updated...

I know, you don't use GUIs. Because then you'd have seen that the official (getopt) way to get help is --help...

That said, I guess -n is a considerable option to avoid lookups. But I first wanted to know, whether you understand daily process. Others, feel free to share your thoughts as well!
Please consider Other-Invoices on your NeDi installation for an annual contribution, tx!
-Remo

oxo

  • Guest
Re: nedi.pl -f
« Reply #4 on: November 26, 2009, 07:42:50 AM »
I'll get back with some times with and without -n


(getopt needs a || or else an invalid option is only displayed and the program continues and the user doesn't notice that one has used an invalid option)

UPDATE
the times depend on if there is a local DNS cache
UPDATE
-n is "safe" doesn't kill dns names from previous non -u runs
« Last Edit: November 26, 2009, 05:06:59 PM by oxo »

rickli

  • Administrator
  • Hero Member
  • *****
  • Posts: 2732
    • View Profile
    • NeDi
Re: nedi.pl -f (nedi.pl -n)
« Reply #5 on: November 26, 2009, 06:28:32 PM »
Ah I see, I missunderstood :) help on wrong options is back in...

I've also added -n, maybe others benefit from this as well. You should still get a decent DNS server for your network  ;)

Please consider Other-Invoices on your NeDi installation for an annual contribution, tx!
-Remo