Permalink
Browse files

Added first snmp tests.

  • Loading branch information...
1 parent 4ba62c6 commit d98ca9a41278a1f08b12992dff617737db13219b @Licenser Licenser committed Apr 27, 2013
View
@@ -1,3 +1,4 @@
+*.bin
*.version
apps/wiggle/src/wiggle_version.hrl
apps/wiggle/.eunit/
@@ -0,0 +1,90 @@
+%%% This file was automatically generated by snmpc_mib_to_hrl version 4.22.1
+%%% Date: 27-Apr-2013::05:05:13
+-ifndef('WIGGLE-MIB').
+-define('WIGGLE-MIB', true).
+
+%% Oids
+
+-define(wiggle, [1,3,6,1,3,7]).
+-define(name, [1,3,6,1,3,7,1]).
+-define(name_instance, [1,3,6,1,3,7,1,0]).
+-define(version, [1,3,6,1,3,7,2]).
+-define(version_instance, [1,3,6,1,3,7,2,0]).
+
+-define(vms, [1,3,6,1,3,7,3]).
+-define(vmsP999, [1,3,6,1,3,7,3,1]).
+-define(vmsP999_instance, [1,3,6,1,3,7,3,1,0]).
+-define(vmsP99, [1,3,6,1,3,7,3,2]).
+-define(vmsP99_instance, [1,3,6,1,3,7,3,2,0]).
+-define(vmsP95, [1,3,6,1,3,7,3,3]).
+-define(vmsP95_instance, [1,3,6,1,3,7,3,3,0]).
+-define(vmsP75, [1,3,6,1,3,7,3,4]).
+-define(vmsP75_instance, [1,3,6,1,3,7,3,4,0]).
+-define(vmsP25, [1,3,6,1,3,7,3,5]).
+-define(vmsP25_instance, [1,3,6,1,3,7,3,5,0]).
+-define(vmsCount, [1,3,6,1,3,7,3,6]).
+-define(vmsCount_instance, [1,3,6,1,3,7,3,6,0]).
+-define(vmsMin, [1,3,6,1,3,7,3,7]).
+-define(vmsMin_instance, [1,3,6,1,3,7,3,7,0]).
+-define(vmsMedian, [1,3,6,1,3,7,3,8]).
+-define(vmsMedian_instance, [1,3,6,1,3,7,3,8,0]).
+-define(vmsMean, [1,3,6,1,3,7,3,9]).
+-define(vmsMean_instance, [1,3,6,1,3,7,3,9,0]).
+-define(vmsMax, [1,3,6,1,3,7,3,10]).
+-define(vmsMax_instance, [1,3,6,1,3,7,3,10,0]).
+
+-define(users, [1,3,6,1,3,7,4]).
+-define(usersP999, [1,3,6,1,3,7,4,1]).
+-define(usersP999_instance, [1,3,6,1,3,7,4,1,0]).
+-define(usersP99, [1,3,6,1,3,7,4,2]).
+-define(usersP99_instance, [1,3,6,1,3,7,4,2,0]).
+-define(usersP95, [1,3,6,1,3,7,4,3]).
+-define(usersP95_instance, [1,3,6,1,3,7,4,3,0]).
+-define(usersP75, [1,3,6,1,3,7,4,4]).
+-define(usersP75_instance, [1,3,6,1,3,7,4,4,0]).
+-define(usersP25, [1,3,6,1,3,7,4,5]).
+-define(usersP25_instance, [1,3,6,1,3,7,4,5,0]).
+-define(usersCount, [1,3,6,1,3,7,4,6]).
+-define(usersCount_instance, [1,3,6,1,3,7,4,6,0]).
+-define(usersMin, [1,3,6,1,3,7,4,7]).
+-define(usersMin_instance, [1,3,6,1,3,7,4,7,0]).
+-define(usersMedian, [1,3,6,1,3,7,4,8]).
+-define(usersMedian_instance, [1,3,6,1,3,7,4,8,0]).
+-define(usersMean, [1,3,6,1,3,7,4,9]).
+-define(usersMean_instance, [1,3,6,1,3,7,4,9,0]).
+-define(usersMax, [1,3,6,1,3,7,4,10]).
+-define(usersMax_instance, [1,3,6,1,3,7,4,10,0]).
+
+
+%% Range values
+-define(low_name, 0).
+-define(high_name, 255).
+-define(low_version, 0).
+-define(high_version, 255).
+
+
+%% Default values
+-define(default_name, []).
+-define(default_version, []).
+-define(default_vmsP999, 0).
+-define(default_vmsP99, 0).
+-define(default_vmsP95, 0).
+-define(default_vmsP75, 0).
+-define(default_vmsP25, 0).
+-define(default_vmsCount, 0).
+-define(default_vmsMin, 0).
+-define(default_vmsMedian, 0).
+-define(default_vmsMean, 0).
+-define(default_vmsMax, 0).
+-define(default_usersP999, 0).
+-define(default_usersP99, 0).
+-define(default_usersP95, 0).
+-define(default_usersP75, 0).
+-define(default_usersP25, 0).
+-define(default_usersCount, 0).
+-define(default_usersMin, 0).
+-define(default_usersMedian, 0).
+-define(default_usersMean, 0).
+-define(default_usersMax, 0).
+
+-endif.
@@ -0,0 +1,27 @@
+{name, {wiggle_snmp_handler, name, []}}.
+{version, {wiggle_snmp_handler, version, []}}.
+
+{usersP999, {wiggle_snmp_handler, p999, [<<"/api/0.1.0/users">>]}}.
+{usersP99, {wiggle_snmp_handler, p99, [<<"/api/0.1.0/users">>]}}.
+{usersP95, {wiggle_snmp_handler, p95, [<<"/api/0.1.0/users">>]}}.
+{usersP75, {wiggle_snmp_handler, p75, [<<"/api/0.1.0/users">>]}}.
+{usersP25, {wiggle_snmp_handler, p25, [<<"/api/0.1.0/users">>]}}.
+
+{usersCount, {wiggle_snmp_handler, count, [<<"/api/0.1.0/users">>]}}.
+{usersMin, {wiggle_snmp_handler, min, [<<"/api/0.1.0/users">>]}}.
+{usersMedian, {wiggle_snmp_handler, median, [<<"/api/0.1.0/users">>]}}.
+{usersMean, {wiggle_snmp_handler, mean, [<<"/api/0.1.0/users">>]}}.
+{usersMax, {wiggle_snmp_handler, max, [<<"/api/0.1.0/users">>]}}.
+
+
+{vmsP999, {wiggle_snmp_handler, p999, [<<"/api/0.1.0/vms">>]}}.
+{vmsP99, {wiggle_snmp_handler, p99, [<<"/api/0.1.0/vms">>]}}.
+{vmsP95, {wiggle_snmp_handler, p95, [<<"/api/0.1.0/vms">>]}}.
+{vmsP75, {wiggle_snmp_handler, p75, [<<"/api/0.1.0/vms">>]}}.
+{vmsP25, {wiggle_snmp_handler, p25, [<<"/api/0.1.0/vms">>]}}.
+
+{vmsCount, {wiggle_snmp_handler, count, [<<"/api/0.1.0/vms">>]}}.
+{vmsMin, {wiggle_snmp_handler, min, [<<"/api/0.1.0/vms">>]}}.
+{vmsMedian, {wiggle_snmp_handler, median, [<<"/api/0.1.0/vms">>]}}.
+{vmsMean, {wiggle_snmp_handler, mean, [<<"/api/0.1.0/vms">>]}}.
+{vmsMax, {wiggle_snmp_handler, max, [<<"/api/0.1.0/vms">>]}}.
@@ -0,0 +1,194 @@
+-- 1.3.6.1.4.1
+WIGGLE-MIB DEFINITIONS ::= BEGIN
+
+ IMPORTS
+ experimental FROM RFC1155-SMI
+ RowStatus FROM STANDARD-MIB
+ DisplayString FROM RFC1213-MIB
+ OBJECT-TYPE FROM RFC-1212
+ ;
+
+ wiggle OBJECT IDENTIFIER ::= { experimental 7 }
+
+ vms OBJECT IDENTIFIER ::= { wiggle 3 }
+
+ users OBJECT IDENTIFIER ::= { wiggle 4 }
+
+ name OBJECT-TYPE
+ SYNTAX DisplayString (SIZE (0..255))
+ ACCESS read-only
+ STATUS mandatory
+ DESCRIPTION
+ "My own name"
+ ::= { wiggle 1 }
+
+ version OBJECT-TYPE
+ SYNTAX DisplayString (SIZE (0..255))
+ ACCESS read-only
+ STATUS mandatory
+ DESCRIPTION
+ "wiggle version"
+ ::= { wiggle 2 }
+
+ vmsP999 OBJECT-TYPE
+ SYNTAX INTEGER
+ ACCESS read-only
+ STATUS mandatory
+ DESCRIPTION
+ "99.9 percertile"
+ ::= { vms 1 }
+
+ vmsP99 OBJECT-TYPE
+ SYNTAX INTEGER
+ ACCESS read-only
+ STATUS mandatory
+ DESCRIPTION
+ "99 percertile"
+ ::= { vms 2 }
+
+ vmsP95 OBJECT-TYPE
+ SYNTAX INTEGER
+ ACCESS read-only
+ STATUS mandatory
+ DESCRIPTION
+ "95 percertile"
+ ::= { vms 3 }
+
+ vmsP75 OBJECT-TYPE
+ SYNTAX INTEGER
+ ACCESS read-only
+ STATUS mandatory
+ DESCRIPTION
+ "75 percertile"
+ ::= { vms 4 }
+
+ vmsP25 OBJECT-TYPE
+ SYNTAX INTEGER
+ ACCESS read-only
+ STATUS mandatory
+ DESCRIPTION
+ "25 percertile"
+ ::= { vms 5 }
+
+ vmsCount OBJECT-TYPE
+ SYNTAX INTEGER
+ ACCESS read-only
+ STATUS mandatory
+ DESCRIPTION
+ "number of events"
+ ::= { vms 6 }
+
+ vmsMin OBJECT-TYPE
+ SYNTAX INTEGER
+ ACCESS read-only
+ STATUS mandatory
+ DESCRIPTION
+ "number of events"
+ ::= { vms 7 }
+
+ vmsMedian OBJECT-TYPE
+ SYNTAX INTEGER
+ ACCESS read-only
+ STATUS mandatory
+ DESCRIPTION
+ "number of events"
+ ::= { vms 8 }
+
+ vmsMean OBJECT-TYPE
+ SYNTAX INTEGER
+ ACCESS read-only
+ STATUS mandatory
+ DESCRIPTION
+ "number of events"
+ ::= { vms 9 }
+
+ vmsMax OBJECT-TYPE
+ SYNTAX INTEGER
+ ACCESS read-only
+ STATUS mandatory
+ DESCRIPTION
+ "number of events"
+ ::= { vms 10 }
+
+ usersP999 OBJECT-TYPE
+ SYNTAX INTEGER
+ ACCESS read-only
+ STATUS mandatory
+ DESCRIPTION
+ "99.9 percertile"
+ ::= { users 1 }
+
+ usersP99 OBJECT-TYPE
+ SYNTAX INTEGER
+ ACCESS read-only
+ STATUS mandatory
+ DESCRIPTION
+ "99 percertile"
+ ::= { users 2 }
+
+ usersP95 OBJECT-TYPE
+ SYNTAX INTEGER
+ ACCESS read-only
+ STATUS mandatory
+ DESCRIPTION
+ "95 percertile"
+ ::= { users 3 }
+
+ usersP75 OBJECT-TYPE
+ SYNTAX INTEGER
+ ACCESS read-only
+ STATUS mandatory
+ DESCRIPTION
+ "75 percertile"
+ ::= { users 4 }
+
+ usersP25 OBJECT-TYPE
+ SYNTAX INTEGER
+ ACCESS read-only
+ STATUS mandatory
+ DESCRIPTION
+ "25 percertile"
+ ::= { users 5 }
+
+ usersCount OBJECT-TYPE
+ SYNTAX INTEGER
+ ACCESS read-only
+ STATUS mandatory
+ DESCRIPTION
+ "number of events"
+ ::= { users 6 }
+
+ usersMin OBJECT-TYPE
+ SYNTAX INTEGER
+ ACCESS read-only
+ STATUS mandatory
+ DESCRIPTION
+ "number of events"
+ ::= { users 7 }
+
+ usersMedian OBJECT-TYPE
+ SYNTAX INTEGER
+ ACCESS read-only
+ STATUS mandatory
+ DESCRIPTION
+ "number of events"
+ ::= { users 8 }
+
+ usersMean OBJECT-TYPE
+ SYNTAX INTEGER
+ ACCESS read-only
+ STATUS mandatory
+ DESCRIPTION
+ "number of events"
+ ::= { users 9 }
+
+ usersMax OBJECT-TYPE
+ SYNTAX INTEGER
+ ACCESS read-only
+ STATUS mandatory
+ DESCRIPTION
+ "number of events"
+ ::= { users 10 }
+
+
+END
@@ -14,6 +14,7 @@
lager,
mimetypes,
newrelic,
+ snmp,
cowboy
]},
{mod, { wiggle_app, []}},
@@ -34,6 +34,7 @@ start(_StartType, _StartArgs) ->
R = wiggle_sup:start_link(),
statman_server:add_subscriber(statman_aggregator),
+ wiggle_snmp_handler:start(),
case application:get_env(newrelic,license_key) of
undefined ->
ok;
Oops, something went wrong.

0 comments on commit d98ca9a

Please sign in to comment.