snmptrapd

<UNKNOWN> value for host in snmptraps

戏子无情 提交于 2020-01-06 19:25:35
问题 while executing " snmptrap -v 1 -c public localhost TRAP-TEST-MIB::demotraps localhost 4 0 '' IF-MIB::ifIndex i 1" on my system,I am getting host ,ip & OID values as host = localhost.localdomain :ip = UDP: [127.0.0.1]:49109->[127.0.0.1] :OID =DISMAN-EVENT-MIB::sysUpTimeInstance 0:3:12:38.28 But when traps are coming from outside its showing host = :ip = UDP: [192.168.1.73]:52346->[192.168.1.23]:OID =DISMAN-EVENT-MIB::sysUpTimeInstance 7:1:05:54.27 . Now its clearly shown above that host value

<UNKNOWN> value for host in snmptraps

感情迁移 提交于 2020-01-06 19:24:10
问题 while executing " snmptrap -v 1 -c public localhost TRAP-TEST-MIB::demotraps localhost 4 0 '' IF-MIB::ifIndex i 1" on my system,I am getting host ,ip & OID values as host = localhost.localdomain :ip = UDP: [127.0.0.1]:49109->[127.0.0.1] :OID =DISMAN-EVENT-MIB::sysUpTimeInstance 0:3:12:38.28 But when traps are coming from outside its showing host = :ip = UDP: [192.168.1.73]:52346->[192.168.1.23]:OID =DISMAN-EVENT-MIB::sysUpTimeInstance 7:1:05:54.27 . Now its clearly shown above that host value

how to decode the result of listenning to port 162 (Snmp Trap)?

帅比萌擦擦* 提交于 2019-12-23 03:24:08
问题 I want to get the snmp trap by using my own traplistener. In fact, I used a code found in internet I added some modifications and now it is working. I can listen through the port 162. #include "stdio.h" #include "winsock2.h" #pragma comment(lib, "ws2_32.lib") #define SNMP_TRAP_PORT 162 #define MAX_MSG 400 static void init(void) { WSADATA wsa; int err = WSAStartup(MAKEWORD(2, 2), &wsa); if(err < 0) { puts("WSAStartup failed !"); exit(EXIT_FAILURE); } } static void end(void) { WSACleanup(); }

how to decode the result of listenning to port 162 (Snmp Trap)?

独自空忆成欢 提交于 2019-12-06 16:08:28
I want to get the snmp trap by using my own traplistener. In fact, I used a code found in internet I added some modifications and now it is working. I can listen through the port 162. #include "stdio.h" #include "winsock2.h" #pragma comment(lib, "ws2_32.lib") #define SNMP_TRAP_PORT 162 #define MAX_MSG 400 static void init(void) { WSADATA wsa; int err = WSAStartup(MAKEWORD(2, 2), &wsa); if(err < 0) { puts("WSAStartup failed !"); exit(EXIT_FAILURE); } } static void end(void) { WSACleanup(); } int main(int argc, char *argv[]) { int sd, rc, n, cliLen; struct sockaddr_in cliAddr, servAddr; char msg