From 179ee8ee548e9eac057a02dc6f626b5c27803fd3 Mon Sep 17 00:00:00 2001 From: Kristian Lyngstol Date: Fri, 11 Nov 2016 15:39:26 +0100 Subject: Various build-tweaks and cache tweaks - mibs are moved to data/, update gitignore - Adjust cache for switches and switches-management to improve responsiveness when adding new content. - Ensure mibs are correctly loaded if the data directory doesn't exist - Add a small timer to the startup of ping collector/snmp to avoid starting before graphite. --- web/api/public/switches | 3 ++- web/api/read/switches-management | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) (limited to 'web/api') diff --git a/web/api/public/switches b/web/api/public/switches index ce95e5f..5528789 100755 --- a/web/api/public/switches +++ b/web/api/public/switches @@ -10,7 +10,8 @@ use strict; use warnings; use Data::Dumper; -$nms::web::cc{'max-age'} = "60"; +$nms::web::cc{'max-age'} = "5"; +$nms::web::cc{'stale-while-revalidate'} = "30"; my $q2 = $nms::web::dbh->prepare('select switch,sysname,tags,distro_name,placement,mgmt_v4_addr,mgmt_v6_addr,mgmt_v4_gw,mgmt_v6_gw,mgmt_vlan,traffic_vlan,last_config_fetch,current_mac,poll_frequency,community,last_updated,switchtype from switches where placement is not null'); diff --git a/web/api/read/switches-management b/web/api/read/switches-management index 8d899b7..33fc6ab 100755 --- a/web/api/read/switches-management +++ b/web/api/read/switches-management @@ -10,7 +10,8 @@ use strict; use warnings; use Data::Dumper; -$nms::web::cc{'max-age'} = "60"; +$nms::web::cc{'max-age'} = "5"; +$nms::web::cc{'stale-while-revalidate'} = "30"; my $q2 = $nms::web::dbh->prepare('select sysname,mgmt_v4_addr,subnet4,subnet6,mgmt_v6_addr,mgmt_v4_gw,mgmt_v6_gw,mgmt_vlan,traffic_vlan,last_config_fetch,current_mac,poll_frequency,last_updated,distro_phy_port,community from switches where placement is not null'); -- cgit v1.2.3