aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKristian Lyngstol <kristian@bohemians.org>2016-05-10 20:34:39 +0200
committerKristian Lyngstol <kristian@bohemians.org>2016-05-10 20:34:39 +0200
commit14a761343c732b5c836aedac8a13771447a2bf8d (patch)
treee7ebb84a86222d1075483e03c096d57f1c45b5e3
parenta762fcbc3a144fcd02352decdf0ab00677859fae (diff)
Tweak SNMP fetch tester
-rw-r--r--build/test/nms-snmp-test.Dockerfile20
-rw-r--r--build/test/playbook-test.yml2
-rwxr-xr-xbuild/test/snmpfetch-misc.sh3
-rwxr-xr-xcollectors/snmpfetchng.pl2
4 files changed, 26 insertions, 1 deletions
diff --git a/build/test/nms-snmp-test.Dockerfile b/build/test/nms-snmp-test.Dockerfile
new file mode 100644
index 0000000..f7bb30e
--- /dev/null
+++ b/build/test/nms-snmp-test.Dockerfile
@@ -0,0 +1,20 @@
+FROM debian:jessie
+RUN apt-get update
+RUN apt-get -y install \
+ libdata-dumper-simple-perl \
+ libdbd-pg-perl \
+ libdbi-perl \
+ libnet-oping-perl \
+ libsocket-perl \
+ libswitch-perl \
+ libtimedate-perl \
+ perl \
+ libjson-xs-perl \
+ libjson-perl \
+ perl-base \
+ snmpd \
+ libsnmp-perl \
+ perl-modules
+RUN mkdir -p /opt/nms
+COPY build/test/snmpd.conf /etc/snmp/
+CMD /opt/nms/build/test/snmpfetch-misc.sh
diff --git a/build/test/playbook-test.yml b/build/test/playbook-test.yml
index 0b5f84e..bd6e19f 100644
--- a/build/test/playbook-test.yml
+++ b/build/test/playbook-test.yml
@@ -11,6 +11,8 @@
links: [ "nms-front-test:nms-front" ]
- name: "nms-collector-test"
links: [ "nms-db-test:db" ]
+ - name: "nms-snmp-test"
+ links: [ "nms-db-test:db" ]
- simple_urls:
- "/api/public/switches"
- "/api/public/switch-state"
diff --git a/build/test/snmpfetch-misc.sh b/build/test/snmpfetch-misc.sh
new file mode 100755
index 0000000..55c024d
--- /dev/null
+++ b/build/test/snmpfetch-misc.sh
@@ -0,0 +1,3 @@
+#!/bin/bash
+service snmpd start
+exec /opt/nms/collectors/snmpfetchng.pl
diff --git a/collectors/snmpfetchng.pl b/collectors/snmpfetchng.pl
index eb2cedf..14561c2 100755
--- a/collectors/snmpfetchng.pl
+++ b/collectors/snmpfetchng.pl
@@ -6,7 +6,7 @@ use POSIX;
#use Time::HiRes qw(time);
use SNMP;
use Data::Dumper;
-use lib '../include';
+use lib '/opt/nms/include';
use nms;
SNMP::initMib();