aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rwxr-xr-xinclude/config.pm.dist6
-rwxr-xr-xinclude/nms.pm2
-rwxr-xr-xinclude/nms/web.pm3
3 files changed, 7 insertions, 4 deletions
diff --git a/include/config.pm.dist b/include/config.pm.dist
index cce82df..382b4e2 100755
--- a/include/config.pm.dist
+++ b/include/config.pm.dist
@@ -10,8 +10,10 @@ our $db_host = "gerald.tg15.gathering.org";
our $db_username = "nms";
our $db_password = "<removed>";
-# NMS hash used for public NMS obfuscation of interface names
-our $nms_hash = "<removed>";
+# NMS: What SNMP objects to fetch.
+our @snmp_objects = [['ifTable'], ['ifXTable'], ['sysDescr'], ['sysName'],['ipForward']];
+# Max SNMP polls to fire off at the same time.
+our $snmp_max = 20;
# DHCP-servers
our $dhcp_server1 = "185.12.59.66"; # primary
diff --git a/include/nms.pm b/include/nms.pm
index 6a9598e..2ec922b 100755
--- a/include/nms.pm
+++ b/include/nms.pm
@@ -26,7 +26,7 @@ sub db_connect {
my $dbh = DBI->connect($connstr,
$nms::config::db_username,
- $nms::config::db_password)
+ $nms::config::db_password, {AutoCommit => 0})
or die "Couldn't connect to database";
return $dbh;
}
diff --git a/include/nms/web.pm b/include/nms/web.pm
index 0f37a59..2a336c6 100755
--- a/include/nms/web.pm
+++ b/include/nms/web.pm
@@ -59,13 +59,14 @@ sub setwhen {
$now = db_safe_quote('now') . "::timestamp ";
$cc{'max-age'} = "3600";
}
- $when = " time > " . $now . " - '5m'::interval and time < " . $now . " ";
+ $when = " time > " . $now . " - '15m'::interval and time < " . $now . " ";
return $when;
}
sub finalize_output {
my $query;
my $hash = Digest::SHA::sha512_base64(FreezeThaw::freeze(%json));
+ $dbh->commit;
$query = $dbh->prepare('select to_char(' . $now . ', \'YYYY-MM-DD"T"HH24:MI:SS\') as time;');
$query->execute();