fix rancid, graph, and nodemonitor
This commit is contained in:
		| @@ -298,8 +298,8 @@ sub graph_addnode { | ||||
|     $devloc = $GRAPH{$ip}->{location}; | ||||
|  | ||||
|     $label = "($ip)" unless defined $label; | ||||
|     my $domain_suffix = setting('domain_suffix') || ''; | ||||
|     $label =~ s/$domain_suffix$//; | ||||
|     my $domain_suffix = setting('domain_suffix'); | ||||
|     $label =~ s/$domain_suffix//; | ||||
|     $node{label} = $label; | ||||
|  | ||||
|     # Dereferencing the scalar by name below | ||||
|   | ||||
| @@ -5,6 +5,7 @@ use App::Netdisco; | ||||
| use Dancer qw/:syntax :script/; | ||||
| use Dancer::Plugin::DBIC 'schema'; | ||||
|  | ||||
| use Net::Domain 'hostfqdn'; | ||||
| use App::Netdisco::Util::DNS qw/hostname_from_ip ipv4_from_hostname/; | ||||
|  | ||||
| use base 'Exporter'; | ||||
| @@ -16,8 +17,7 @@ our %EXPORT_TAGS = (all => \@EXPORT_OK); | ||||
| sub _email { | ||||
|   my ($to, $subject, $body) = @_; | ||||
|   return unless $to; | ||||
|   my $domain = setting('domain_suffix') || 'localhost'; | ||||
|   $domain =~ s/^\.//; | ||||
|   $domain =~ (hostfqdn || 'fqdn-undefined'); | ||||
|  | ||||
|   my $SENDMAIL = '/usr/sbin/sendmail'; | ||||
|   open (SENDMAIL, "| $SENDMAIL -t") or die "Can't open sendmail at $SENDMAIL.\n"; | ||||
|   | ||||
| @@ -18,7 +18,7 @@ register_worker({ phase => 'main' }, sub { | ||||
|   my ($job, $workerconf) = @_; | ||||
|   my $config = setting('rancid') || {}; | ||||
|  | ||||
|   my $domain_suffix = setting('domain_suffix') || ''; | ||||
|   my $domain_suffix = setting('domain_suffix'); | ||||
|   my $delimiter = $config->{delimiter} || ';'; | ||||
|   my $down_age  = $config->{down_age} || '1 day'; | ||||
|   my $default_group = $config->{default_group} || 'default'; | ||||
| @@ -65,7 +65,7 @@ register_worker({ phase => 'main' }, sub { | ||||
|     } | ||||
|  | ||||
|     my $name = check_acl_no($d, $config->{by_ip}) ? $d->ip : ($d->dns || $d->name); | ||||
|     $name =~ s/$domain_suffix$// if check_acl_no($d, $config->{by_hostname}); | ||||
|     $name =~ s/$domain_suffix// if check_acl_no($d, $config->{by_hostname}); | ||||
|  | ||||
|     my ($group) = | ||||
|       (pairkeys pairfirst { check_acl_no($d, $b) } %{ $config->{groups} }) || $default_group; | ||||
|   | ||||
		Reference in New Issue
	
	Block a user