From 064ec952c75841c96431d52692c08170e355085b Mon Sep 17 00:00:00 2001 From: Florian Asche Date: Thu, 28 Aug 2014 10:29:34 +0200 Subject: [PATCH] Refs: #5771 --- network/fritzbox/mode/traffic.pm | 7 ++++++- network/fritzbox/mode/upstatus.pm | 9 +++++++-- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/network/fritzbox/mode/traffic.pm b/network/fritzbox/mode/traffic.pm index c4fd2e64c..8e079fb2d 100644 --- a/network/fritzbox/mode/traffic.pm +++ b/network/fritzbox/mode/traffic.pm @@ -52,6 +52,7 @@ sub new { "hostname:s" => { name => 'hostname' }, "port:s" => { name => 'port', default => '49000' }, "timeout:s" => { name => 'timeout', default => 30 }, + "agent:s" => { name => 'agent', default => 'igdupnp' }, "warning-in:s" => { name => 'warning_in', }, "critical-in:s" => { name => 'critical_in', }, "warning-out:s" => { name => 'warning_out', }, @@ -100,7 +101,7 @@ sub run { my $old_timestamp = $self->{statefile_value}->get(name => 'last_timestamp'); ### GET DATA START - network::fritzbox::mode::libgetdata::init($self, pfad => '/upnp/control/WANCommonIFC1', + network::fritzbox::mode::libgetdata::init($self, pfad => '/' . $self->{option_results}->{agent} . '/control/WANCommonIFC1', uri => 'urn:schemas-upnp-org:service:WANCommonInterfaceConfig:1'); network::fritzbox::mode::libgetdata::call($self, soap_method => 'GetAddonInfos'); my $NewTotalBytesSent = network::fritzbox::mode::libgetdata::value($self, path => '//GetAddonInfosResponse/NewTotalBytesSent'); @@ -208,6 +209,10 @@ This Mode needs UPNP. =over 8 +=item B<--agent> + +Fritzbox has two different UPNP Agents. upnp or igdupnp. (Default: igdupnp) + =item B<--warning-in> Threshold warning for 'in' traffic. diff --git a/network/fritzbox/mode/upstatus.pm b/network/fritzbox/mode/upstatus.pm index 7241a8ff1..c5339b0df 100644 --- a/network/fritzbox/mode/upstatus.pm +++ b/network/fritzbox/mode/upstatus.pm @@ -53,6 +53,7 @@ sub new { "hostname:s" => { name => 'hostname' }, "port:s" => { name => 'port', default => '49000' }, "timeout:s" => { name => 'timeout', default => 30 }, + "agent:s" => { name => 'agent', default => 'igdupnp' }, "warning:s" => { name => 'warning', }, "critical:s" => { name => 'critical', }, "seconds" => { name => 'seconds', }, @@ -83,13 +84,13 @@ sub run { my ($self, %options) = @_; my $exit_code; - network::fritzbox::mode::libgetdata::init($self, pfad => '/upnp/control/WANCommonIFC1', + network::fritzbox::mode::libgetdata::init($self, pfad => '/' . $self->{option_results}->{agent} . '/control/WANCommonIFC1', uri => 'urn:schemas-upnp-org:service:WANCommonInterfaceConfig:1'); network::fritzbox::mode::libgetdata::call($self, soap_method => 'GetCommonLinkProperties'); my $WANAccessType = network::fritzbox::mode::libgetdata::value($self, path => '//GetCommonLinkPropertiesResponse/NewWANAccessType'); my $LinkStatus = network::fritzbox::mode::libgetdata::value($self, path => '//GetCommonLinkPropertiesResponse/NewPhysicalLinkStatus'); - network::fritzbox::mode::libgetdata::init($self, pfad => '/upnp/control/WANIPConn1', + network::fritzbox::mode::libgetdata::init($self, pfad => '/' . $self->{option_results}->{agent} . '/control/WANIPConn1', uri => 'urn:schemas-upnp-org:service:WANIPConnection:1'); network::fritzbox::mode::libgetdata::call($self, soap_method => 'GetStatusInfo'); my $uptime = network::fritzbox::mode::libgetdata::value($self, path => '//GetStatusInfoResponse/NewUptime'); @@ -128,6 +129,10 @@ This Mode needs UPNP. =over 8 +=item B<--agent> + +Fritzbox has two different UPNP Agents. upnp or igdupnp. (Default: igdupnp) + =item B<--warning> Threshold warning in seconds.