<%doc> Show Unused Statics % % <%attr> title => 'Unused Statics' section => 'Reports' % % <%args> $days $version => 4 $edit => 0 % % <%init> my $DEBUG = 0; print "

    ", Dumper(%ARGS), "

" if $DEBUG; my $sqldate = Netdot::Model->sqldate_days_ago($days); print "$days days ago was: $sqldate", "
" if $DEBUG; my $static = IpblockStatus->search(name=>'Static')->first; my @ips = Ipblock->search_where({status=>$static, version=>$version, last_seen=>{ '<', $sqldate }}, {order_by=>'address'}); # We're going to ignore device and multicast IPs my @unused; foreach my $ip ( @ips ){ next if ( int($ip->interface) != 0 ); next if ( $ip->snmp_devices ); next if ( $ip->is_multicast ); push @unused, $ip; } %if ( !scalar(@unused) ){

No unused IPs found.

%}else{ <& /generic/sortresults.mhtml, object=>\@unused, withedit=>$edit &> %}