fix rancid, graph, and nodemonitor

This commit is contained in:
Oliver Gorwits
2019-09-03 13:17:17 +01:00
parent 6d881de3ff
commit 0a2b5c8fa2
4 changed files with 8 additions and 8 deletions

View File

@@ -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

View File

@@ -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";