1
0
Fork 0
mirror of https://github.com/munin-monitoring/contrib.git synced 2025-07-22 14:16:00 +00:00

Plugin runs, even if no access to list DBs.

If the user as whom "munin" connects has no rights to list existing DBs,
the plugin crashes. Even though the rest of the code is OK. Listing DBs
is only necessary in the case of auto-configuring the plugin. Not for
running it.

This removes the line which causes the bug. The variable which is set in
this line is anyway not used.
This commit is contained in:
Michel Albert 2015-05-26 15:52:44 +02:00
parent a52f8e49c9
commit a8e524449d

View file

@ -67,9 +67,6 @@ if (exists $ARGV[0]) {
my (undef, undef, $dbname) = split (/_/, $0, 3); my (undef, undef, $dbname) = split (/_/, $0, 3);
die "No dbname configured (did you make the proper symlink?)" unless $dbname; die "No dbname configured (did you make the proper symlink?)" unless $dbname;
my @datasources = DBI->data_sources ('Pg')
or die ("Can't read any possible data sources: $?");
my $dsn = "DBI:Pg:dbname=$dbname"; my $dsn = "DBI:Pg:dbname=$dbname";
$dsn .= ";host=$dbhost" if $dbhost; $dsn .= ";host=$dbhost" if $dbhost;
print "#$dsn\n" if $debug; print "#$dsn\n" if $debug;