当前仓库属于暂停状态,部分功能使用受限,详情请查阅 仓库状态说明
4 Star 8 Fork 6

dachuan zhang / snmputil
暂停

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README

#snmputil 许可 初步添加的是 tlv 的解析工具,添加IP地址转换工具(IPV4) 需使用java commons ##异步snmp ##bulk snmp

	private Entry<String, String>[] walkImplBulk(String rootId,

			int maxRePetitions, String... oids) throws IOException {

		target.setCommunity(new OctetString(readCommunity));

		PDU request = new PDU();

		request.setType(PDU.GETBULK);



		for (String oid : oids) {

			request.add(new VariableBinding(new OID(oid)));

		}

		request.setMaxRepetitions(maxRePetitions);

		request.setNonRepeaters(0);

		// request.setErrorStatus(0);


		// request.setErrorIndex(0);


		ResponseEvent rspEvt = curSession.send(request, target);

		// System.out.println("xxxxxxxxxxx");


		PDU response = rspEvt.getResponse();

		// System.out.println(response);


		List<Entry<String, String>> lists = new LinkedList<Entry<String, String>>();

		if (null != response && response.getErrorIndex() == PDU.noError

				&& response.getErrorStatus() == PDU.noError) {



			Vector<?> vector = response.getVariableBindings();

			// System.out.println(vector.size());


			Entry<String, String>[] val = new Map.Entry[vector.size()];



			for (Object variable : vector) {

				VariableBinding binding = (VariableBinding) variable;

				// System.out.println(binding.getOid().toString());


				// System.out.println(binding.getVariable().toString());


				lists.add(new AbstractMap.SimpleImmutableEntry<String, String>(

						binding.getOid().toString(), binding.getVariable()

								.toString()));

			}

			return lists.toArray(val);



		}

		return null;

	}

空文件

简介

封装SNMP协议一些需要的操作 展开 收起
Java
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
Java
1
https://gitee.com/zdc524/snmputil.git
git@gitee.com:zdc524/snmputil.git
zdc524
snmputil
snmputil
master

搜索帮助