Changeset 299
- Timestamp:
- Jul 18, 2018, 1:08:50 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/ddt/ddt
r298 r299 2261 2261 my $computer_db = ipamdb_load($COMPUTER_YAML); 2262 2262 2263 LOOP_ON_DOMAIN: 2263 my $tb_computer = Text::Table->new( 2264 {align => 'left', align_title => 'left', title => 'Hostname.DomainSet'}, 2265 {is_sep => 1, body => ' '}, 2266 {align => 'left', align_title => 'left', title => 'IPv4-Address'}, 2267 {is_sep => 1, body => ' '}, 2268 {align => 'center', align_title => 'center', title => 'MAC-Address'}, 2269 {is_sep => 1, body => ' '}, 2270 {align => 'right', align_title => 'right', title => 'Type'}, 2271 {align => 'right', align_title => 'right', title => 'Status'}, 2272 {is_sep => 1, body => ' '}, 2273 {align => 'left', align_title => 'left', title => 'Date'}, 2274 {align => 'left', align_title => 'left', title => 'Comment'}, 2275 ); 2276 2277 LOOP_ON_DOMAIN: 2264 2278 for my $domainset_current (sort keys %{$computer_db}) { 2265 2279 next if $domainset_current eq 'dset'; … … 2269 2283 next if $domainset_current eq 'version'; 2270 2284 2271 my $tb_computer = Text::Table->new(2272 {align => 'left', align_title => 'left', title => 'Hostname.DomainSet'},2273 {is_sep => 1, body => ' '},2274 {align => 'left', align_title => 'left', title => 'IPv4-Address'},2275 {is_sep => 1, body => ' '},2276 {align => 'center', align_title => 'center', title => 'MAC-Address'},2277 {is_sep => 1, body => ' '},2278 {align => 'right', align_title => 'right', title => 'Type'},2279 {align => 'right', align_title => 'right', title => 'Status'},2280 {is_sep => 1, body => ' '},2281 {align => 'left', align_title => 'left', title => 'Date'},2282 {align => 'left', align_title => 'left', title => 'Comment'},2283 );2284 2285 #printf "%-30s %-20s %17s %5s %7s %-10s %s\n",2286 # 'Hostname',2287 # 'IPv4-Address',2288 # 'MAC-Address',2289 # 'Type',2290 # 'Status',2291 # 'Date',2292 # 'Comment';2293 2285 my @domainsetdb = @{$computer_db->{$domainset_current}}; 2294 2286 … … 2305 2297 'domainset' => $domainset_current, 2306 2298 }; 2307 next LOOP_ON_COMPUTER;2308 2299 } 2309 2300 else { 2310 print {*STDERR} "# Warning: $ip already exists in the database !\n";2301 print {*STDERR} "# Warning: $ip already exists in the database with MAC $mac_address!\n"; 2311 2302 } 2303 next LOOP_ON_COMPUTER; 2312 2304 } 2313 2305 … … 2339 2331 ); 2340 2332 } 2341 2342 if ($tb_computer->body_height) { 2343 print "\n# *** List of pool computers in the domain set: $domainset_current ***\n"; 2344 print $tb_computer->title(); 2345 print $tb_computer->rule('-'); 2346 print $tb_computer->body(); 2347 } 2348 } 2349 2350 print "\n# *** List of computers ordered by IP and domain set ***\n"; 2333 #print "\n# *** List of pool computers in the domain set: $domainset_current ***\n"; 2334 } 2335 2336 #print "\n# *** List of computers ordered by IP and domain set ***\n"; 2351 2337 LOOP_ON_IP_ADDRESS: 2352 2338 foreach my $ip (Net::Netmask::sort_by_ip_address(keys %ipdb)) { … … 2367 2353 } 2368 2354 2369 printf "%-30s %-20s %17s %9s %3s %10s %s\n", 2355 #printf "%-30s %-20s %17s %9s %3s %10s %s\n", 2356 $tb_computer->add( 2370 2357 $ipdb{$ip}->{'hostname'} . '.' . $ipdb{$ip}->{'domainset'}, 2371 2358 $ip, … … 2374 2361 $enable, 2375 2362 $date, 2376 $comment; 2377 } 2363 $comment 2364 ); 2365 } 2366 2367 print $tb_computer->title(); 2368 print $tb_computer->rule('-'); 2369 print $tb_computer->body(); 2378 2370 } 2379 2371
Note: See TracChangeset
for help on using the changeset viewer.