snmp request time out?
来源:互联网 发布:网络红猫红小胖照片 编辑:程序博客网 时间:2024/05/16 14:42
为什么人家的可以呢?看这里snmp的深入学习三中程序运行正常,snmp get调用成功的,我的超时了。代码如下。
#include "snmp_pp.h"#include "iostream.h"#define SYSDESCR "1.3.6.1.2.1.1.1.0" // Object ID for System Descriptorvoid main(){ Snmp::socket_startup(); //socket_startup()静态成员函数,初始化Winsocket的相关函数int status; // return status CTarget ctarget( (IpAddress) "192.168.1.74"); // SNMP++ v1 target //使用一个Address对象构造一个Ctarget对象 Vb vb( SYSDESCR); // SNMP++ Variable Binding Pdu pdu; // SNMP++ PDU //-------[ Construct a SNMP++ SNMP Object ]--------------------------------------- Snmp snmp( status); // Create a SNMP++ session 创建一个新的snmp对象, //第一个参数表示创建状态,0表示成功 if ( status != SNMP_CLASS_SUCCESS) { // check creation status cout << snmp.error_msg( status); // if fail, print error string return; } //-------[ Invoke a SNMP++ Get ]------------------------------------------------------- //invoke的意思是requests help or protection(from a deity) pdu += vb; // add the variable binding if ( (status = snmp.get( pdu, ctarget)) != SNMP_CLASS_SUCCESS) cout << "获取没成功\n"<<snmp.error_msg( status); else { pdu.get_vb( vb,0); // extract the variable binding cout << "系统描述符 = "<< vb.get_printable_value(); } // print out Snmp::socket_cleanup(); //socket_cleanup()静态成员函数,释放被上面函数初始化的winsocket的资源}
通过这个网站找出snmp request time out 的原因,原来是community的原因,改成和交换机对应的communiry就行。如果是get ,应该是get的community.
- snmp request time out?
- SNMP++ 01-SNMP request time out问题的解决
- Lock request time out period exceeded SQL2005
- .net项目: Lock request time out period exceeded问题
- time out
- Lock request time out period exceeded. (Microsoft SQL Server, Error: 1222)
- session time out
- webservice,connection time out。
- Time Out 与 idle
- msyql 各种time out
- pscp connection time out
- SoapUI socket time out
- HTTP Client Time out
- socket time out
- tomcat time out
- jedis read time out
- 504 Gateway Time-out
- dubbo超时 time out
- 我国调整撤销105个国家级非遗保护单位-调整-撤销-非遗
- 菜单自绘,修改弹出菜单样式
- IOS几种简单有效的数组排序方法
- matlab补习之一
- js中的map
- snmp request time out?
- 10.16的实验要求
- Linux下如何生成和使用动静态库
- 山东规定举报食品犯罪最高可获涉案额10%奖励-山东-举报-食品安全犯罪
- Gem 与 Bundler - Ruby项目依赖管理
- 数据声明(Data declarations)
- ftp服务器配置之vsftp
- Sybase 15.7 Windows 2008 64位 安配置服务时出错CreateProcess error=14001,sybatch.exe无法执行
- VC 设置静态文本框透明背