1
0
Fork 0
mirror of https://github.com/munin-monitoring/contrib.git synced 2025-07-21 18:41:03 +00:00

Add environment for variables with default values

This commit is contained in:
Doctor 2022-01-23 14:45:21 +01:00 committed by Lars Kruse
parent f3c8d9519f
commit 38a07950d4

View file

@ -24,12 +24,11 @@ use strict;
use Net::Telnet; use Net::Telnet;
# CONFIG HERE! # CONFIG HERE!
my $hostname = "localhost"; # serveraddress my $hostname = $ENV{hostname} || "localhost"; # serveraddress
my $port = 10011; # querryport (default: 10011) my $port = $ENV{port} || 10011; # querryport (default: 10011)
my @serverids = (1); # array of virtualserverids (1,2,3,4,...) my @serverids = $ENV{serverids} || (1); # array of virtualserverids (1,2,3,4,...)
my $username = $ENV{username} || ""; # only set if the default queryuser hasn't enough rights (should work without this)
my $username = ""; # only set if the default queryuser hasn't enough rights (should work without this) my $password = $ENV{password} || "";
my $password = "";
# SCRIPT START! # SCRIPT START!
if(exists $ARGV[0] and $ARGV[0] eq "config") if(exists $ARGV[0] and $ARGV[0] eq "config")