=================================================================== RCS file: /cvs/nagios/check_rrd/bin/make_wireless_client_config,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- nagios/check_rrd/bin/make_wireless_client_config 2007/01/22 17:55:04 1.5 +++ nagios/check_rrd/bin/make_wireless_client_config 2007/10/03 16:16:42 1.6 @@ -1,5 +1,5 @@ #!/usr/bin/perl -# $RedRiver: make_wireless_client_config,v 1.4 2007/01/22 16:40:52 andrew Exp $ +# $RedRiver: make_wireless_client_config,v 1.5 2007/01/22 17:55:04 andrew Exp $ ######################################################################## # make_wireless_client_config *** Generate the Nagios config file we # need for wireless clients. @@ -37,7 +37,7 @@ #print Dumper $AP, \@clients; - foreach my $id (@clients) { + foreach my $id (sort @clients) { my $host; my $name; my $template; @@ -46,19 +46,22 @@ if ($hosts->{$AP}->{'Host'}->{'Type'} =~ /Trango$/) { $host = $hosts->{$AP}->{'Info'}->{'suRemarks'}->{$id}; $name = $hosts->{$host}->{'Host'}->{'name'}; - $nagios_host = "${AP}-${id}"; + $nagios_host = $AP . '-' . $id; $template = $Trango_Template; } elsif ($hosts->{$AP}->{'Host'}->{'Type'} =~ /TurboCell$/) { $host = $hosts->{$AP}->{'Info'}->{'Wireless_Host_Name'}->{$id}; $name = $hosts->{$host}->{'Host'}->{'name'}; - $nagios_host = "${AP}-${host}"; + $nagios_host = $AP . '-' . $host; $template = $TurboCell_Template; } else { next; } - next unless $host; - next if $host =~ /^rr\w{6}\d{4}$/i; + next if ! $host; + next if $host =~ /^rr\w{6}\d{4}$/i; + + next if ! $name; + #next if ! $name =~ / \A \d{1,3}\. \d{1,3}\. \d{1,3}\. \d{1,3} \z /xms next if exists $nagios_hosts{$nagios_host}; $nagios_hosts{$nagios_host}++;