mirror of
https://github.com/Tautulli/Tautulli.git
synced 2025-07-13 00:32:58 -07:00
Merge branch 'nightly' into python3
# Conflicts: # plexpy/activity_pinger.py # plexpy/webserve.py
This commit is contained in:
commit
4e0563bbf9
5 changed files with 42 additions and 8 deletions
|
@ -79,7 +79,7 @@
|
||||||
$('#ip_error').html('<i class="fa fa-exclamation-circle"></i> Internal request failed.').show();
|
$('#ip_error').html('<i class="fa fa-exclamation-circle"></i> Internal request failed.').show();
|
||||||
},
|
},
|
||||||
success: function (result) {
|
success: function (result) {
|
||||||
if (result.results === 'error') {
|
if (result.result === 'error') {
|
||||||
$('#ip_error').html('<i class="fa fa-exclamation-circle"></i> ' + result.message).show();
|
$('#ip_error').html('<i class="fa fa-exclamation-circle"></i> ' + result.message).show();
|
||||||
} else {
|
} else {
|
||||||
var data = result.data;
|
var data = result.data;
|
||||||
|
|
|
@ -858,6 +858,28 @@
|
||||||
<span id="remoteAccessCheck" class="settings-warning"></span>
|
<span id="remoteAccessCheck" class="settings-warning"></span>
|
||||||
<p class="help-block">Enable to have Tautulli check if remote access to the Plex Media Server goes down.</p>
|
<p class="help-block">Enable to have Tautulli check if remote access to the Plex Media Server goes down.</p>
|
||||||
</div>
|
</div>
|
||||||
|
<div id="monitor_remote_access_options">
|
||||||
|
<div class="form-group advanced-setting">
|
||||||
|
<label for="remote_access_ping_interval">Remote Access Ping Interval</label>
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-md-2">
|
||||||
|
<input type="text" class="form-control" data-parsley-type="integer" id="remote_access_ping_interval" name="remote_access_ping_interval" value="${config['remote_access_ping_interval']}" size="5" data-parsley-min="60" data-parsley-trigger="change" data-parsley-errors-container="#remote_access_ping_interval_error" required>
|
||||||
|
</div>
|
||||||
|
<div id="remote_access_ping_interval_error" class="alert alert-danger settings-alert" role="alert"></div>
|
||||||
|
</div>
|
||||||
|
<p class="help-block">The interval (in seconds) Tautulli will ping the Plex Media Server for the remote access status. Minimum 60.</p>
|
||||||
|
</div>
|
||||||
|
<div class="form-group advanced-setting">
|
||||||
|
<label for="remote_access_ping_threshold">Remote Access Ping Threshold</label>
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-md-2">
|
||||||
|
<input type="text" class="form-control" data-parsley-type="integer" id="remote_access_ping_threshold" name="remote_access_ping_threshold" value="${config['remote_access_ping_threshold']}" size="5" data-parsley-min="1" data-parsley-trigger="change" data-parsley-errors-container="#remote_access_ping_threshold_error" required>
|
||||||
|
</div>
|
||||||
|
<div id="remote_access_ping_threshold_error" class="alert alert-danger settings-alert" role="alert"></div>
|
||||||
|
</div>
|
||||||
|
<p class="help-block">The number of consecutive remote access status failures to consider remote access as down. Minimum 1.</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="form-group advanced-setting">
|
<div class="form-group advanced-setting">
|
||||||
<label for="refresh_users_interval">Users List Refresh Interval</label>
|
<label for="refresh_users_interval">Users List Refresh Interval</label>
|
||||||
|
@ -2051,6 +2073,7 @@ $(document).ready(function() {
|
||||||
initConfigCheckbox('#https_create_cert');
|
initConfigCheckbox('#https_create_cert');
|
||||||
initConfigCheckbox('#check_github');
|
initConfigCheckbox('#check_github');
|
||||||
initConfigCheckbox('#monitor_pms_updates');
|
initConfigCheckbox('#monitor_pms_updates');
|
||||||
|
initConfigCheckbox('#monitor_remote_access');
|
||||||
initConfigCheckbox('#newsletter_self_hosted');
|
initConfigCheckbox('#newsletter_self_hosted');
|
||||||
|
|
||||||
$('#menu_link_shutdown').click(function() {
|
$('#menu_link_shutdown').click(function() {
|
||||||
|
|
|
@ -45,6 +45,7 @@ else:
|
||||||
|
|
||||||
monitor_lock = threading.Lock()
|
monitor_lock = threading.Lock()
|
||||||
ext_ping_count = 0
|
ext_ping_count = 0
|
||||||
|
ext_ping_error = None
|
||||||
int_ping_count = 0
|
int_ping_count = 0
|
||||||
|
|
||||||
|
|
||||||
|
@ -323,18 +324,25 @@ def check_server_access():
|
||||||
server_response = pms_connect.get_server_response()
|
server_response = pms_connect.get_server_response()
|
||||||
|
|
||||||
global ext_ping_count
|
global ext_ping_count
|
||||||
|
global ext_ping_error
|
||||||
|
|
||||||
# Check for remote access
|
# Check for remote access
|
||||||
if server_response:
|
if server_response:
|
||||||
|
log = (server_response['mapping_error'] != ext_ping_error)
|
||||||
|
|
||||||
if server_response['reason']:
|
if server_response['reason']:
|
||||||
ext_ping_count += 1
|
ext_ping_count += 1
|
||||||
logger.warn("Tautulli Monitor :: Remote access failed: %s, ping attempt %s." \
|
ext_ping_error = server_response['mapping_error']
|
||||||
% (server_response['reason'], str(ext_ping_count)))
|
if log:
|
||||||
|
logger.warn("Tautulli Monitor :: Remote access failed: %s, ping attempt %s."
|
||||||
|
% (server_response['reason'], str(ext_ping_count)))
|
||||||
|
|
||||||
# Waiting for port mapping
|
# Waiting for port mapping
|
||||||
elif server_response['mapping_state'] == 'waiting':
|
elif server_response['mapping_state'] == 'waiting':
|
||||||
logger.warn("Tautulli Monitor :: Remote access waiting for port mapping, ping attempt %s." \
|
ext_ping_error = server_response['mapping_error']
|
||||||
% str(ext_ping_count))
|
if log:
|
||||||
|
logger.warn("Tautulli Monitor :: Remote access waiting for port mapping, ping attempt %s."
|
||||||
|
% str(ext_ping_count))
|
||||||
|
|
||||||
# Reset external ping counter
|
# Reset external ping counter
|
||||||
else:
|
else:
|
||||||
|
@ -344,8 +352,10 @@ def check_server_access():
|
||||||
plexpy.NOTIFY_QUEUE.put({'notify_action': 'on_extup', 'remote_access_info': server_response})
|
plexpy.NOTIFY_QUEUE.put({'notify_action': 'on_extup', 'remote_access_info': server_response})
|
||||||
|
|
||||||
ext_ping_count = 0
|
ext_ping_count = 0
|
||||||
|
ext_ping_error = None
|
||||||
|
|
||||||
if ext_ping_count == plexpy.CONFIG.REMOTE_ACCESS_PING_THRESHOLD:
|
if ext_ping_count == plexpy.CONFIG.REMOTE_ACCESS_PING_THRESHOLD:
|
||||||
|
logger.info("Tautulli Monitor: Plex remote access is down.")
|
||||||
plexpy.NOTIFY_QUEUE.put({'notify_action': 'on_extdown', 'remote_access_info': server_response})
|
plexpy.NOTIFY_QUEUE.put({'notify_action': 'on_extdown', 'remote_access_info': server_response})
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -946,7 +946,7 @@ class PlexTV(object):
|
||||||
return account_details
|
return account_details
|
||||||
|
|
||||||
def get_geoip_lookup(self, ip_address=''):
|
def get_geoip_lookup(self, ip_address=''):
|
||||||
if not ip_address or not helpers.is_public_ip(ip_address):
|
if not ip_address or not helpers.is_valid_ip(ip_address):
|
||||||
return
|
return
|
||||||
|
|
||||||
geoip_data = self.get_plextv_geoip(ip_address=ip_address, output_format='xml')
|
geoip_data = self.get_plextv_geoip(ip_address=ip_address, output_format='xml')
|
||||||
|
|
|
@ -2993,6 +2993,8 @@ class WebInterface(object):
|
||||||
"grouping_charts": checked(plexpy.CONFIG.GROUPING_CHARTS),
|
"grouping_charts": checked(plexpy.CONFIG.GROUPING_CHARTS),
|
||||||
"monitor_pms_updates": checked(plexpy.CONFIG.MONITOR_PMS_UPDATES),
|
"monitor_pms_updates": checked(plexpy.CONFIG.MONITOR_PMS_UPDATES),
|
||||||
"monitor_remote_access": checked(plexpy.CONFIG.MONITOR_REMOTE_ACCESS),
|
"monitor_remote_access": checked(plexpy.CONFIG.MONITOR_REMOTE_ACCESS),
|
||||||
|
"remote_access_ping_interval": plexpy.CONFIG.REMOTE_ACCESS_PING_INTERVAL,
|
||||||
|
"remote_access_ping_threshold": plexpy.CONFIG.REMOTE_ACCESS_PING_THRESHOLD,
|
||||||
"refresh_libraries_interval": plexpy.CONFIG.REFRESH_LIBRARIES_INTERVAL,
|
"refresh_libraries_interval": plexpy.CONFIG.REFRESH_LIBRARIES_INTERVAL,
|
||||||
"refresh_libraries_on_startup": checked(plexpy.CONFIG.REFRESH_LIBRARIES_ON_STARTUP),
|
"refresh_libraries_on_startup": checked(plexpy.CONFIG.REFRESH_LIBRARIES_ON_STARTUP),
|
||||||
"refresh_users_interval": plexpy.CONFIG.REFRESH_USERS_INTERVAL,
|
"refresh_users_interval": plexpy.CONFIG.REFRESH_USERS_INTERVAL,
|
||||||
|
@ -3124,6 +3126,7 @@ class WebInterface(object):
|
||||||
kwargs.get('pms_update_check_interval') != str(plexpy.CONFIG.PMS_UPDATE_CHECK_INTERVAL) or \
|
kwargs.get('pms_update_check_interval') != str(plexpy.CONFIG.PMS_UPDATE_CHECK_INTERVAL) or \
|
||||||
kwargs.get('monitor_pms_updates') != plexpy.CONFIG.MONITOR_PMS_UPDATES or \
|
kwargs.get('monitor_pms_updates') != plexpy.CONFIG.MONITOR_PMS_UPDATES or \
|
||||||
kwargs.get('monitor_remote_access') != plexpy.CONFIG.MONITOR_REMOTE_ACCESS or \
|
kwargs.get('monitor_remote_access') != plexpy.CONFIG.MONITOR_REMOTE_ACCESS or \
|
||||||
|
kwargs.get('remote_access_ping_interval') != plexpy.CONFIG.REMOTE_ACCESS_PING_INTERVAL or \
|
||||||
kwargs.get('pms_url_manual') != plexpy.CONFIG.PMS_URL_MANUAL:
|
kwargs.get('pms_url_manual') != plexpy.CONFIG.PMS_URL_MANUAL:
|
||||||
reschedule = True
|
reschedule = True
|
||||||
|
|
||||||
|
@ -5828,8 +5831,6 @@ class WebInterface(object):
|
||||||
message = 'No IP address provided.'
|
message = 'No IP address provided.'
|
||||||
elif not helpers.is_valid_ip(ip_address):
|
elif not helpers.is_valid_ip(ip_address):
|
||||||
message = 'Invalid IP address provided: %s' % ip_address
|
message = 'Invalid IP address provided: %s' % ip_address
|
||||||
elif not helpers.is_public_ip(ip_address):
|
|
||||||
message = 'Non-public IP address provided: %s' % ip_address
|
|
||||||
|
|
||||||
if message:
|
if message:
|
||||||
return {'result': 'error', 'message': message}
|
return {'result': 'error', 'message': message}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue