uniqid pandora_snmp_bandwidth
This commit is contained in:
parent
2826f4fd89
commit
aca9814e0f
|
@ -56,6 +56,7 @@ Where OPTIONS could be:
|
||||||
[EXTRA]
|
[EXTRA]
|
||||||
-ifIndex Target interface to retrieve, if not specified, total
|
-ifIndex Target interface to retrieve, if not specified, total
|
||||||
bandwith will be reported.
|
bandwith will be reported.
|
||||||
|
-uniqid Use custom temporary file name.
|
||||||
|
|
||||||
Note: You can also use snmpget/snmpwalk argument notation,
|
Note: You can also use snmpget/snmpwalk argument notation,
|
||||||
e.g. -v is equal to -version, -c to -community, etc.
|
e.g. -v is equal to -version, -c to -community, etc.
|
||||||
|
@ -124,6 +125,9 @@ sub update_config_key ($) {
|
||||||
if ($arg eq 'ifIndex') {
|
if ($arg eq 'ifIndex') {
|
||||||
return "ifIndex";
|
return "ifIndex";
|
||||||
}
|
}
|
||||||
|
if ($arg eq 'uniqid') {
|
||||||
|
return "uniqid";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
################################################################################
|
################################################################################
|
||||||
|
@ -478,6 +482,10 @@ if(snmp_walk({
|
||||||
# Create unique name for tmp and log file for host
|
# Create unique name for tmp and log file for host
|
||||||
my $filename = $config->{'tmp'}.'/pandora_bandwith_'.$config->{'host'};
|
my $filename = $config->{'tmp'}.'/pandora_bandwith_'.$config->{'host'};
|
||||||
|
|
||||||
|
if (!empty($config->{'uniqid'})) {
|
||||||
|
$filename = $config->{'tmp'}.'/pandora_bandwith_'.$config->{'uniqid'};
|
||||||
|
}
|
||||||
|
|
||||||
# Replace every dot for underscore
|
# Replace every dot for underscore
|
||||||
$filename =~ tr/./_/;
|
$filename =~ tr/./_/;
|
||||||
$config->{'tmp_file'} = $filename.'.idx' if empty($config->{'tmp_file'});
|
$config->{'tmp_file'} = $filename.'.idx' if empty($config->{'tmp_file'});
|
||||||
|
|
Loading…
Reference in New Issue