diff options
author | Ingela Anderton Andin <[email protected]> | 2017-11-10 14:50:33 +0100 |
---|---|---|
committer | Ingela Anderton Andin <[email protected]> | 2017-11-10 14:50:33 +0100 |
commit | cca58959662d473bb329e41a84b5b260bf96a26b (patch) | |
tree | 1fc7319e738ce9bbc4ff1ff615202bff9ddced07 /lib | |
parent | e21f3eb30a384fab1db839ac6a21a6f2055cfb6f (diff) | |
parent | 329870142616f8814d6ef93c91d18d3ab772ec35 (diff) | |
download | otp-cca58959662d473bb329e41a84b5b260bf96a26b.tar.gz otp-cca58959662d473bb329e41a84b5b260bf96a26b.tar.bz2 otp-cca58959662d473bb329e41a84b5b260bf96a26b.zip |
Merge branch 'ingela/snmp/cuddle' into maint
* ingela/snmp/cuddle:
snmp: Correct netsnmp arglist and check for usable netsnmp
Diffstat (limited to 'lib')
-rw-r--r-- | lib/snmp/test/snmp_to_snmpnet_SUITE.erl | 25 |
1 files changed, 18 insertions, 7 deletions
diff --git a/lib/snmp/test/snmp_to_snmpnet_SUITE.erl b/lib/snmp/test/snmp_to_snmpnet_SUITE.erl index 24c14d86ea..6a3466b6e4 100644 --- a/lib/snmp/test/snmp_to_snmpnet_SUITE.erl +++ b/lib/snmp/test/snmp_to_snmpnet_SUITE.erl @@ -88,8 +88,17 @@ groups() -> ]. init_per_suite(Config) -> - [{agent_port, ?AGENT_PORT}, {manager_port, ?MANAGER_PORT} | Config]. - + case re:run(os:cmd("snmpd -v"),"NET-SNMP", [{capture, first}]) of + nomatch -> + {skip, "snmpd is NOT NET-SNMP"}; + {match, _} -> + case re:run(os:cmd("snmpd -v"),"5.4|5.6.2.1", [{capture, first}]) of + nomatch -> + [{agent_port, ?AGENT_PORT}, {manager_port, ?MANAGER_PORT} | Config]; + {match, _} -> + {skip, "buggy snmpd"} + end + end. end_per_suite(_Config) -> ok. @@ -322,7 +331,7 @@ snmpget(Oid, Transport, Config) -> Args = ["-c", "public", net_snmp_version(Versions), - "-m", "", + "-m", ":", "-Cf", net_snmp_addr_str(Transport), oid_str(Oid)], @@ -353,11 +362,13 @@ start_snmpd(Community, SysDescr, Config) -> ["--rocommunity"++domain_suffix(Domain)++"=" ++Community++" "++inet_parse:ntoa(Ip) || {Domain, {Ip, _}} <- Targets], + SnmpdArgs = - ["-f", "-r", %"-Dverbose", - "-c", filename:join(DataDir, "snmpd.conf"), - "-C", "-Lo", - "-m", "", + ["-f", "-r", %"-Dverbose", + "-c", filename:join(DataDir, "snmpd.conf"), + "-C", + "-Lo", + "-m", ":", "--sysDescr="++SysDescr, "--agentXSocket=tcp:localhost:"++integer_to_list(Port)] ++ CommunityArgs |