AW: ORDER of varbind IN SNMP response PDU
Hi @all How can we force to use PDU 1 or 2 ? The Subagent sends no Data to the Agent (SNMPD), while the Agent (SNMPD) not initalisation the subagent :-( Log Entrys: snmpd: send_trap: Cannot send V1 PDU on V2 session snmpd: send_trap: Cannot send V1 PDU on V2 session snmpd: send_trap: Cannot send V1 PDU on V2 session snmpd: send_trap: Cannot send V1 PDU on V2 session snmpd: send_trap: Cannot send V1 PDU on V2 session snmpd: send_trap: Cannot send V1 PDU on V2 session snmpd: send_trap: Cannot send V1 PDU on V2 session NET-SNMP version 5.4 agentx/master: unexpected callback op 4 agentx/master: handle pdu (req=0x55a0e861,trans=0x0,sess=0x0) agentx/master: open 0x81922c0 agentx/master: opened 0x8192a90 = 17 with flags = a0 agentx/master: send response, stat 0 (req=0x55a0e861,trans=0x0,sess=0x0) agentx_build: packet built okay Stefan -Ursprüngliche Nachricht- Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Auftrag von Dave Shield Gesendet: Montag, 30. Juli 2007 10:44 An: [EMAIL PROTECTED] Cc: net-snmp-users@lists.sourceforge.net Betreff: Re: ORDER of varbind IN SNMP response PDU On 30/07/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > Suppose all the three varbinds are part of same request > PDU then is it also expected that response PDU will have the same order? Yes This is required. The varbinds in the response PDU *must* match the order from the original request. (For both GET and GETNEXT requests). Dave - This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/ ___ Net-snmp-users mailing list Net-snmp-users@lists.sourceforge.net Please see the following page to unsubscribe or change other options: https://lists.sourceforge.net/lists/listinfo/net-snmp-users - This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/ ___ Net-snmp-users mailing list Net-snmp-users@lists.sourceforge.net Please see the following page to unsubscribe or change other options: https://lists.sourceforge.net/lists/listinfo/net-snmp-users
AW: SNMP AgentX Problem
Hello Thomas, yes, this was the issue :-) Now, i must look how i can put the collected data from my snmp-subagent (attached) to snmp-agent, I think there is only the set function not included, as Dave me telled, but i'm not a perl programer :-( Regards Stefan -Ursprüngliche Nachricht- Von: Thomas Anders [mailto:[EMAIL PROTECTED] Gesendet: Donnerstag, 5. Juli 2007 18:27 An: Stefan Mikuszeit Cc: net-snmp-users@lists.sourceforge.net Betreff: Re: SNMP AgentX Problem Stefan Mikuszeit wrote: > I used the Hello World example from `perldoc NetSNMP::agent` and > started the SNMP Agent via: > /usr/sbin/snmpd -Ls DAEMON -Lf /var/log/snmpd.log -u root -p > /var/run/snmpd.pid -x tcp:localhost:705 -c /etc/snmp/snmpd.conf > > and the subagent via: > /usr/lib/net-snmp/agents/mysql_agent.pl > > The agent conf: > cat /etc/snmp/snmp/my_agent_name.conf > agentxSocket tcp:localhost:705 What's the output of "net-snmp-config --snmpconfpath"? /etc/snmp/snmp looks wrong. Since your subagent connects, this may just be a typo, though. > I will become this message: > NET-SNMP version 5.4 AgentX subagent connected > > If i now start an snmpwalk, this will not work :-( > snmpwalk localhost -c public -v2c > .1.3.6.1.4.1.8072...7375.1.0 > > Errormessage: > NET-SNMP-MIB::netSnmpPlaypen.7375.1.0 = No Such Object > available on this agent at this OID Try adding use NetSNMP::ASN qw(ASN_OCTET_STR); to the top of /usr/lib/net-snmp/agents/mysql_agent.pl. Does it help? +Thomas -- Thomas Anders (thomas.anders at blue-cable.de) mysql_agent.pl Description: mysql_agent.pl - This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/___ Net-snmp-users mailing list Net-snmp-users@lists.sourceforge.net Please see the following page to unsubscribe or change other options: https://lists.sourceforge.net/lists/listinfo/net-snmp-users
AW: SNMP AgentX Problem
Hello Dave, Is there are any changes in the agentx that are not in the documentation ? I used the Hello World example from `perldoc NetSNMP::agent` and started the SNMP Agent via: /usr/sbin/snmpd -Ls DAEMON -Lf /var/log/snmpd.log -u root -p /var/run/snmpd.pid -x tcp:localhost:705 -c /etc/snmp/snmpd.conf and the subagent via: /usr/lib/net-snmp/agents/mysql_agent.pl The agent conf: cat /etc/snmp/snmp/my_agent_name.conf agentxSocket tcp:localhost:705 I will become this message: NET-SNMP version 5.4 AgentX subagent connected If i now start an snmpwalk, this will not work :-( snmpwalk localhost -c public -v2c .1.3.6.1.4.1.8072...7375.1.0 Errormessage: NET-SNMP-MIB::netSnmpPlaypen.7375.1.0 = No Such Object available on this agent at this OID Where's the problem ? Regards Stefan -Ursprüngliche Nachricht- Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Auftrag von Stefan Mikuszeit Gesendet: Donnerstag, 5. Juli 2007 11:33 An: Dave Shield Cc: net-snmp-users@lists.sourceforge.net Betreff: AW: SNMP AgentX Problem Hallo Dave, this will now work fine, thx again :-) snmpwalk localhost -c public -v2c enterprises.ucdavis.50.100.1 UCD-SNMP-MIB::ucdavis.50.100.1.1.0 = INTEGER: 1 UCD-SNMP-MIB::ucdavis.50.100.1.2.1.2.4.84.101.115.116 = STRING: "/bin/sh" UCD-SNMP-MIB::ucdavis.50.100.1.2.1.3.4.84.101.115.116 = STRING: "/tmp/shtest" UCD-SNMP-MIB::ucdavis.50.100.1.2.1.4.4.84.101.115.116 = "" UCD-SNMP-MIB::ucdavis.50.100.1.2.1.5.4.84.101.115.116 = INTEGER: 5 UCD-SNMP-MIB::ucdavis.50.100.1.2.1.6.4.84.101.115.116 = INTEGER: 1 UCD-SNMP-MIB::ucdavis.50.100.1.2.1.7.4.84.101.115.116 = INTEGER: 1 UCD-SNMP-MIB::ucdavis.50.100.1.2.1.20.4.84.101.115.116 = INTEGER: 4 UCD-SNMP-MIB::ucdavis.50.100.1.2.1.21.4.84.101.115.116 = INTEGER: 1 UCD-SNMP-MIB::ucdavis.50.100.1.3.1.1.4.84.101.115.116 = STRING: "hello world" UCD-SNMP-MIB::ucdavis.50.100.1.3.1.2.4.84.101.115.116 = STRING: "hello world hi there" UCD-SNMP-MIB::ucdavis.50.100.1.3.1.3.4.84.101.115.116 = INTEGER: 2 UCD-SNMP-MIB::ucdavis.50.100.1.3.1.4.4.84.101.115.116 = INTEGER: 35 UCD-SNMP-MIB::ucdavis.50.100.1.4.1.2.4.84.101.115.116.1 = STRING: "hello world" UCD-SNMP-MIB::ucdavis.50.100.1.4.1.2.4.84.101.115.116.2 = STRING: "hi there" Regards Stefan -Ursprüngliche Nachricht- Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Auftrag von Dave Shield Gesendet: Donnerstag, 5. Juli 2007 10:53 An: Stefan Mikuszeit Cc: net-snmp-users@lists.sourceforge.net Betreff: Re: SNMP AgentX Problem On 03/07/07, Stefan Mikuszeit <[EMAIL PROTECTED]> wrote: > The next i have found is with the /tmp/shtest that is > configured > in the snmpd.conf via this line: > > exec enterprises.ucdavis.50.100.1 /bin/sh /tmp/shtest Three problems. Firstly, the "relocatable" forms of exec/sh (and extend) rely on the OID being specified in the full numeric form. The agent won't recognise "enterprises" as specifying the root OID for the output. So it's actually taking "enterprises.ucdavis.50.100.1" as the identifying name for this entry. We need to amend the documentation to clarify this. Secondly, the syntax of this command is exec ROOTOID NAMECOMMAND You don't seem to be specifying a NAME token. So even if the ROOTOID was recognised correctly, the agent would then take "/bin/sh" as the NAME value, and attempt to run "/tmp/shtest" directly (which wouldn't work). Thirdly, the 5.3.x release line marked the "exec OID NAME COMMAND" syntax as deprecated (since the output format is technically invalid). The 5.4 release then dropped it altogether. If you'd been using the numeric OID, then you'd see an error message: /snmpd.conf: line 3: Error: ERROR: This output format has been deprecated - Please use the 'extend' directive instead Again, we need to amend the documentation to emphasise this. Try extend .1.3.6.1.4.1.2021.50.100.1 Test /bin/sh /tmp/shtest See NET-SNMP-EXTEND-MIB for a description of the structure of the output. Dave - This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ ___ Net-snmp-users mailing list Net-snmp-users@lists.sourceforge.net Please see the following page to unsubscribe or change other options: https://lists.sourceforge.net/lists/listinfo/net-snmp-users --
AW: SNMP AgentX Problem
Hallo Dave, this will now work fine, thx again :-) snmpwalk localhost -c public -v2c enterprises.ucdavis.50.100.1 UCD-SNMP-MIB::ucdavis.50.100.1.1.0 = INTEGER: 1 UCD-SNMP-MIB::ucdavis.50.100.1.2.1.2.4.84.101.115.116 = STRING: "/bin/sh" UCD-SNMP-MIB::ucdavis.50.100.1.2.1.3.4.84.101.115.116 = STRING: "/tmp/shtest" UCD-SNMP-MIB::ucdavis.50.100.1.2.1.4.4.84.101.115.116 = "" UCD-SNMP-MIB::ucdavis.50.100.1.2.1.5.4.84.101.115.116 = INTEGER: 5 UCD-SNMP-MIB::ucdavis.50.100.1.2.1.6.4.84.101.115.116 = INTEGER: 1 UCD-SNMP-MIB::ucdavis.50.100.1.2.1.7.4.84.101.115.116 = INTEGER: 1 UCD-SNMP-MIB::ucdavis.50.100.1.2.1.20.4.84.101.115.116 = INTEGER: 4 UCD-SNMP-MIB::ucdavis.50.100.1.2.1.21.4.84.101.115.116 = INTEGER: 1 UCD-SNMP-MIB::ucdavis.50.100.1.3.1.1.4.84.101.115.116 = STRING: "hello world" UCD-SNMP-MIB::ucdavis.50.100.1.3.1.2.4.84.101.115.116 = STRING: "hello world hi there" UCD-SNMP-MIB::ucdavis.50.100.1.3.1.3.4.84.101.115.116 = INTEGER: 2 UCD-SNMP-MIB::ucdavis.50.100.1.3.1.4.4.84.101.115.116 = INTEGER: 35 UCD-SNMP-MIB::ucdavis.50.100.1.4.1.2.4.84.101.115.116.1 = STRING: "hello world" UCD-SNMP-MIB::ucdavis.50.100.1.4.1.2.4.84.101.115.116.2 = STRING: "hi there" Regards Stefan -Ursprüngliche Nachricht- Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Auftrag von Dave Shield Gesendet: Donnerstag, 5. Juli 2007 10:53 An: Stefan Mikuszeit Cc: net-snmp-users@lists.sourceforge.net Betreff: Re: SNMP AgentX Problem On 03/07/07, Stefan Mikuszeit <[EMAIL PROTECTED]> wrote: > The next i have found is with the /tmp/shtest that is > configured > in the snmpd.conf via this line: > > exec enterprises.ucdavis.50.100.1 /bin/sh /tmp/shtest Three problems. Firstly, the "relocatable" forms of exec/sh (and extend) rely on the OID being specified in the full numeric form. The agent won't recognise "enterprises" as specifying the root OID for the output. So it's actually taking "enterprises.ucdavis.50.100.1" as the identifying name for this entry. We need to amend the documentation to clarify this. Secondly, the syntax of this command is exec ROOTOID NAMECOMMAND You don't seem to be specifying a NAME token. So even if the ROOTOID was recognised correctly, the agent would then take "/bin/sh" as the NAME value, and attempt to run "/tmp/shtest" directly (which wouldn't work). Thirdly, the 5.3.x release line marked the "exec OID NAME COMMAND" syntax as deprecated (since the output format is technically invalid). The 5.4 release then dropped it altogether. If you'd been using the numeric OID, then you'd see an error message: /snmpd.conf: line 3: Error: ERROR: This output format has been deprecated - Please use the 'extend' directive instead Again, we need to amend the documentation to emphasise this. Try extend .1.3.6.1.4.1.2021.50.100.1 Test /bin/sh /tmp/shtest See NET-SNMP-EXTEND-MIB for a description of the structure of the output. Dave - This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ ___ Net-snmp-users mailing list Net-snmp-users@lists.sourceforge.net Please see the following page to unsubscribe or change other options: https://lists.sourceforge.net/lists/listinfo/net-snmp-users
AW: SNMP AgentX Problem
Hello all, Have anyone an idea where the problem's is ? The Subagent is connected: write(2, "NET-SNMP version 5.4 AgentX suba"..., 47NET-SNMP version 5.4 AgentX subagent connected) = 47 PDU Error, what's this mean ?? write(2, "registering pdu failed: 263!\n", 29registering pdu failed: 263!) = 29 Timeout's on localhost :-( select(8, [3 5 7], NULL, NULL, {14, 999644}) = 0 (Timeout) select(8, [3 5 7], NULL, NULL, {0, 1460}) = 0 (Timeout) Execute of an Shell Script to enhance the enterprises.ucdavis OID but this will not work correctly ! exec enterprises.ucdavis.50.100.1 /bin/sh /tmp/shtest An `snmpwalk localhost -c public -v2c enterprises.ucdavis.50.100.1` give's me following: UCD-SNMP-MIB::ucdavis.50.100.1 = No Such Object available on this agent at this OID I will find the entris under UCD-SNMP-MIB::ucdavis but not under UCD-SNMP-MIB::ucdavis.50.100.1 Where#s the problem ? Regards Stefan -Ursprüngliche Nachricht- Von: Stefan Mikuszeit Gesendet: Dienstag, 3. Juli 2007 15:41 An: Stefan Mikuszeit; 'Dave Shield' Cc: 'net-snmp-users@lists.sourceforge.net' Betreff: AW: SNMP AgentX Problem Hello Dave, i have changed the code of logging from the perlscript, but i become not more entries: mysql_agent.pl: started us as a subagent (NetSNMP::agent=HASH(0x83ee44c)) mysql_agent.pl: refs: mysql_agent.pl: - finished processing mysql_agent.pl: shutting down mysql_agent.pl: shutting down mysql_agent.pl: Refreshed at 1183466657 If i use -x localhost:705 i see that the SubAgent search an filepath ! Then i have changed the -x localhost:705 to -x tcp:localhost:705 and now the connection from SubAgent to the MasterAgent seams to work. I have now make a check: Start the SNMPD /usr/sbin/snmpd -Ls DAEMON -Lf /var/log/snmpd.log -u root -p /var/run/snmpd.pid -x tcp:localhost:705 -c /etc/snmp/snmpd.conf -Dperl -Dread_config -Dagentx/master -Dagentx/subagent Then I have make a new agent like the example from `perldoc NetSNMP::agent` [EMAIL PROTECTED]:~# /usr/lib/net-snmp/agents/mysql_agent.pl NET-SNMP version 5.4 AgentX subagent connected registering pdu failed: 263! As you can see, the SubAgent will find the MasterAgent but then come this errormessage. In an strace i can see many timeouts: connect(7, {sa_family=AF_INET, sin_port=htons(705), sin_addr=inet_addr("127.0.0.1")}, 16) = 0 getsockopt(7, SOL_SOCKET, SO_SNDBUF, [50592], [4]) = 0 getsockopt(7, SOL_SOCKET, SO_RCVBUF, [87888], [4]) = 0 send(7, "\1\1\0\0\0\0\0\0\0\0\0\0\354b\6J<\0\0\0\0\0\0\0\5\4\0\0"..., 80, 0) = 80 gettimeofday({1183469846, 171336}, NULL) = 0 gettimeofday({1183469846, 171373}, NULL) = 0 select(8, [3 5 7], NULL, NULL, {0, 63}) = 1 (in [7], left {1, 0}) brk(0x8382000) = 0x8382000 recv(7, "\1\22\0\0\27\0\0\0\0\0\0\0\354b\6JD\0\0\0\7\25\1\0\0\0"..., 65536, 0) = 88 gettimeofday({1183469846, 172485}, NULL) = 0 brk(0x8372000) = 0x8372000 write(2, "NET-SNMP version 5.4 AgentX suba"..., 47NET-SNMP version 5.4 AgentX subagent connected ) = 47 send(7, "\1\3\0\0\27\0\0\0\0\0\0\0\355b\6J\34\0\0\0\0\177\0\0\5"..., 48, 0) = 48 gettimeofday({1183469846, 176211}, NULL) = 0 gettimeofday({1183469846, 176294}, NULL) = 0 select(8, [3 5 7], NULL, NULL, {0, 17}) = 1 (in [7], left {1, 0}) recv(7, "\1\22\0\0\27\0\0\0\0\0\0\0\355b\6J$\0\0\0\7\25\1\0\7\1"..., 65536, 0) = 56 gettimeofday({1183469846, 176590}, NULL) = 0 write(2, "registering pdu failed: 263!\n", 29registering pdu failed: 263! ) = 29 gettimeofday({1183469846, 176819}, NULL) = 0 times({tms_utime=11, tms_stime=2, tms_cutime=0, tms_cstime=0}) = 1572397666 times({tms_utime=11, tms_stime=2, tms_cutime=0, tms_cstime=0}) = 1572397666 gettimeofday({1183469846, 177108}, NULL) = 0 gettimeofday({1183469846, 177175}, NULL) = 0 gettimeofday({1183469846, 177200}, NULL) = 0 select(8, [3 5 7], NULL, NULL, {14, 999644}) = 0 (Timeout) gettimeofday({1183469861, 174977}, NULL) = 0 gettimeofday({1183469861, 175063}, NULL) = 0 gettimeofday({1183469861, 175148}, NULL) = 0 gettimeofday({1183469861, 175234}, NULL) = 0 gettimeofday({1183469861, 175359}, NULL) = 0 gettimeofday({1183469861, 175448}, NULL) = 0 select(8, [3 5 7], NULL, NULL, {0, 1460}) = 0 (Timeout) gettimeofday({1183469861, 176888}, NULL) = 0 gettimeofday({1183469861, 176972}, NULL) = 0 gettimeofday({1183469861, 177056}, NULL) = 0 gettimeofday({1183469861, 177133}, NULL) = 0 send(7, "\1\r\0\0\27\0\0\0\0\0\0\0\356b\6J\0\0\0\0", 20, 0) = 20 gettimeofday({1183469
AW: SNMP AgentX Problem
Hello Dave, i have changed the code of logging from the perlscript, but i become not more entries: mysql_agent.pl: started us as a subagent (NetSNMP::agent=HASH(0x83ee44c)) mysql_agent.pl: refs: mysql_agent.pl: - finished processing mysql_agent.pl: shutting down mysql_agent.pl: shutting down mysql_agent.pl: Refreshed at 1183466657 If i use -x localhost:705 i see that the SubAgent search an filepath ! Then i have changed the -x localhost:705 to -x tcp:localhost:705 and now the connection from SubAgent to the MasterAgent seams to work. I have now make a check: Start the SNMPD /usr/sbin/snmpd -Ls DAEMON -Lf /var/log/snmpd.log -u root -p /var/run/snmpd.pid -x tcp:localhost:705 -c /etc/snmp/snmpd.conf -Dperl -Dread_config -Dagentx/master -Dagentx/subagent Then I have make a new agent like the example from `perldoc NetSNMP::agent` [EMAIL PROTECTED]:~# /usr/lib/net-snmp/agents/mysql_agent.pl NET-SNMP version 5.4 AgentX subagent connected registering pdu failed: 263! As you can see, the SubAgent will find the MasterAgent but then come this errormessage. In an strace i can see many timeouts: connect(7, {sa_family=AF_INET, sin_port=htons(705), sin_addr=inet_addr("127.0.0.1")}, 16) = 0 getsockopt(7, SOL_SOCKET, SO_SNDBUF, [50592], [4]) = 0 getsockopt(7, SOL_SOCKET, SO_RCVBUF, [87888], [4]) = 0 send(7, "\1\1\0\0\0\0\0\0\0\0\0\0\354b\6J<\0\0\0\0\0\0\0\5\4\0\0"..., 80, 0) = 80 gettimeofday({1183469846, 171336}, NULL) = 0 gettimeofday({1183469846, 171373}, NULL) = 0 select(8, [3 5 7], NULL, NULL, {0, 63}) = 1 (in [7], left {1, 0}) brk(0x8382000) = 0x8382000 recv(7, "\1\22\0\0\27\0\0\0\0\0\0\0\354b\6JD\0\0\0\7\25\1\0\0\0"..., 65536, 0) = 88 gettimeofday({1183469846, 172485}, NULL) = 0 brk(0x8372000) = 0x8372000 write(2, "NET-SNMP version 5.4 AgentX suba"..., 47NET-SNMP version 5.4 AgentX subagent connected ) = 47 send(7, "\1\3\0\0\27\0\0\0\0\0\0\0\355b\6J\34\0\0\0\0\177\0\0\5"..., 48, 0) = 48 gettimeofday({1183469846, 176211}, NULL) = 0 gettimeofday({1183469846, 176294}, NULL) = 0 select(8, [3 5 7], NULL, NULL, {0, 17}) = 1 (in [7], left {1, 0}) recv(7, "\1\22\0\0\27\0\0\0\0\0\0\0\355b\6J$\0\0\0\7\25\1\0\7\1"..., 65536, 0) = 56 gettimeofday({1183469846, 176590}, NULL) = 0 write(2, "registering pdu failed: 263!\n", 29registering pdu failed: 263! ) = 29 gettimeofday({1183469846, 176819}, NULL) = 0 times({tms_utime=11, tms_stime=2, tms_cutime=0, tms_cstime=0}) = 1572397666 times({tms_utime=11, tms_stime=2, tms_cutime=0, tms_cstime=0}) = 1572397666 gettimeofday({1183469846, 177108}, NULL) = 0 gettimeofday({1183469846, 177175}, NULL) = 0 gettimeofday({1183469846, 177200}, NULL) = 0 select(8, [3 5 7], NULL, NULL, {14, 999644}) = 0 (Timeout) gettimeofday({1183469861, 174977}, NULL) = 0 gettimeofday({1183469861, 175063}, NULL) = 0 gettimeofday({1183469861, 175148}, NULL) = 0 gettimeofday({1183469861, 175234}, NULL) = 0 gettimeofday({1183469861, 175359}, NULL) = 0 gettimeofday({1183469861, 175448}, NULL) = 0 select(8, [3 5 7], NULL, NULL, {0, 1460}) = 0 (Timeout) gettimeofday({1183469861, 176888}, NULL) = 0 gettimeofday({1183469861, 176972}, NULL) = 0 gettimeofday({1183469861, 177056}, NULL) = 0 gettimeofday({1183469861, 177133}, NULL) = 0 send(7, "\1\r\0\0\27\0\0\0\0\0\0\0\356b\6J\0\0\0\0", 20, 0) = 20 gettimeofday({1183469861, 177945}, NULL) = 0 gettimeofday({1183469861, 178030}, NULL) = 0 gettimeofday({1183469861, 178108}, NULL) = 0 select(8, [3 5 7], NULL, NULL, {0, 1}) = 1 (in [7], left {0, 1000}) recv(7, "\1\22\0\0\27\0\0\0\0\0\0\0\356b\6J\10\0\0\0\344\32\1\0"..., 65536, 0) = 28 gettimeofday({1183469861, 178414}, NULL) = 0 gettimeofday({1183469861, 178501}, NULL) = 0 gettimeofday({1183469861, 178591}, NULL) = 0 gettimeofday({1183469861, 178670}, NULL) = 0 select(8, [3 5 7], NULL, NULL, {14, 998542} I hope this will help :-) Regards Stefan -Ursprüngliche Nachricht- Von: Stefan Mikuszeit Gesendet: Dienstag, 3. Juli 2007 13:34 An: Stefan Mikuszeit; 'Dave Shield' Cc: 'net-snmp-users@lists.sourceforge.net' Betreff: AW: SNMP AgentX Problem Hello Dave Log Output from the subagent: [EMAIL PROTECTED]:~# /usr/lib/net-snmp/agents/mysql_agent.pl started us as a subagent (NetSNMP::agent=HASH(0x82cb94c)) refs: , , , - finished processing shutting down shutting down Refreshed at 1183462255 0 Log Output from tcpdump at starting the subagent: [EMAIL PROTECTED]:~# tcpdump -i lo -v tcpdump: listening on lo, link-type EN10MB (Ethernet),
AW: SNMP AgentX Problem
Hello Dave Log Output from the subagent: [EMAIL PROTECTED]:~# /usr/lib/net-snmp/agents/mysql_agent.pl started us as a subagent (NetSNMP::agent=HASH(0x82cb94c)) refs: , , , - finished processing shutting down shutting down Refreshed at 1183462255 0 Log Output from tcpdump at starting the subagent: [EMAIL PROTECTED]:~# tcpdump -i lo -v tcpdump: listening on lo, link-type EN10MB (Ethernet), capture size 96 bytes 13:32:53.888535 IP (tos 0x0, ttl 64, id 21438, offset 0, flags [DF], proto: TCP (6), length: 60) localhost.localdomain.43798 > localhost.localdomain.mysql: S, cksum 0xb45d (correct), 245440441:245440441(0) win 32767 13:32:53.63 IP (tos 0x0, ttl 64, id 0, offset 0, flags [DF], proto: TCP (6), length: 60) localhost.localdomain.mysql > localhost.localdomain.43798: S, cksum 0x9595 (correct), 246094617:246094617(0) ack 245440442 win 32767 13:32:53.888623 IP (tos 0x0, ttl 64, id 21440, offset 0, flags [DF], proto: TCP (6), length: 52) localhost.localdomain.43798 > localhost.localdomain.mysql: ., cksum 0x5eb4 (correct), ack 1 win 8192 13:32:53.888938 IP (tos 0x8, ttl 64, id 22301, offset 0, flags [DF], proto: TCP (6), length: 95) localhost.localdomain.mysql > localhost.localdomain.43798: P 1:44(43) ack 1 win 8192 13:32:53.889104 IP (tos 0x0, ttl 64, id 21442, offset 0, flags [DF], proto: TCP (6), length: 52) localhost.localdomain.43798 > localhost.localdomain.mysql: ., cksum 0x5e89 (correct), ack 44 win 8192 13:32:53.889348 IP (tos 0x8, ttl 64, id 21444, offset 0, flags [DF], proto: TCP (6), length: 74) localhost.localdomain.43798 > localhost.localdomain.mysql: P, cksum 0xfe3e (incorrect (-> 0x462c), 1:23(22) ack 44 win 8192 13:32:53.889381 IP (tos 0x8, ttl 64, id 22303, offset 0, flags [DF], proto: TCP (6), length: 52) localhost.localdomain.mysql > localhost.localdomain.43798: ., cksum 0x5e73 (correct), ack 23 win 8192 13:32:53.889424 IP (tos 0x8, ttl 64, id 22305, offset 0, flags [DF], proto: TCP (6), length: 61) localhost.localdomain.mysql > localhost.localdomain.43798: P, cksum 0xfe31 (incorrect (-> 0x595d), 44:53(9) ack 23 win 8192 13:32:53.889660 IP (tos 0x8, ttl 64, id 21446, offset 0, flags [DF], proto: TCP (6), length: 73) localhost.localdomain.43798 > localhost.localdomain.mysql: P, cksum 0xfe3d (incorrect (-> 0x1df7), 23:44(21) ack 53 win 8192 13:32:53.889761 IP (tos 0x8, ttl 64, id 22307, offset 0, flags [DF], proto: TCP (6), length: 61) localhost.localdomain.mysql > localhost.localdomain.43798: P, cksum 0xfe31 (incorrect (-> 0x593f), 53:62(9) ack 44 win 8192 13:32:53.890074 IP (tos 0x8, ttl 64, id 21448, offset 0, flags [DF], proto: TCP (6), length: 87) localhost.localdomain.43798 > localhost.localdomain.mysql: P 44:79(35) ack 62 win 8192 13:32:53.890205 IP (tos 0x8, ttl 64, id 22309, offset 0, flags [DF], proto: TCP (6), length: 3330) localhost.localdomain.mysql > localhost.localdomain.43798: P 62:3340(3278) ack 79 win 8192 13:32:53.895815 IP (tos 0x8, ttl 64, id 21450, offset 0, flags [DF], proto: TCP (6), length: 57) localhost.localdomain.43798 > localhost.localdomain.mysql: P, cksum 0xfe2d (incorrect (-> 0x3ee7), 79:84(5) ack 3340 win 12383 13:32:53.895865 IP (tos 0x8, ttl 64, id 22311, offset 0, flags [DF], proto: TCP (6), length: 52) localhost.localdomain.mysql > localhost.localdomain.43798: F, cksum 0x5147 (correct), 3340:3340(0) ack 84 win 8192 13:32:53.896018 IP (tos 0x8, ttl 64, id 21452, offset 0, flags [DF], proto: TCP (6), length: 52) localhost.localdomain.43798 > localhost.localdomain.mysql: F, cksum 0x40e7 (correct), 84:84 (0) ack 3341 win 12383 13:32:53.896028 IP (tos 0x8, ttl 64, id 22313, offset 0, flags [DF], proto: TCP (6), length: 52) localhost.localdomain.mysql > localhost.localdomain.43798: ., cksum 0x5146 (correct), ack 85 win 8192 Regards Stefan -Ursprüngliche Nachricht- Von: Stefan Mikuszeit Gesendet: Dienstag, 3. Juli 2007 13:10 An: Stefan Mikuszeit; Dave Shield Cc: net-snmp-users@lists.sourceforge.net Betreff: AW: SNMP AgentX Problem Hello Dave, i have found following: if i put this line to snmpd.conf the snmpd dosn't work anymore (snmpwalk / snmpget becomes timeout): perl do '/usr/lib/net-snmp/agents/mysql_agent.pl'; Wenn i start the agent (snmpd) via the '-X' argument i have the same problem as above. The next i have found is with the /tmp/shtest that is configured in the snmpd.conf via this line: exec enterprises.ucdavis.50.100.1 /bin/sh /tmp/shtest as you can see the OID is runni
AW: SNMP AgentX Problem
Hello Dave, i have found following: if i put this line to snmpd.conf the snmpd dosn't work anymore (snmpwalk / snmpget becomes timeout): perl do '/usr/lib/net-snmp/agents/mysql_agent.pl'; Wenn i start the agent (snmpd) via the '-X' argument i have the same problem as above. The next i have found is with the /tmp/shtest that is configured in the snmpd.conf via this line: exec enterprises.ucdavis.50.100.1 /bin/sh /tmp/shtest as you can see the OID is running at enterprises.ucdavis.50.100.1, but if i make an snmpwalk i become an errormessage: [EMAIL PROTECTED]:/etc/snmp# snmpwalk localhost -c public -v2c enterprises.ucdavis.50.100.1 UCD-SNMP-MIB::ucdavis.50.100.1 = No Such Object available on this agent at this OID [EMAIL PROTECTED]:/etc/snmp# cat /tmp/shtest #!/bin/sh echo hello world echo hi there exit 35 with an snmpwalk at enterprises.ucdavis i find following entries in the table: UCD-SNMP-MIB::extIndex.1 = INTEGER: 1 UCD-SNMP-MIB::extIndex.2 = INTEGER: 2 UCD-SNMP-MIB::extNames.1 = STRING: enterprises.ucdavis.50.100.1 UCD-SNMP-MIB::extNames.2 = STRING: enterprises.ucdavis.50.100.1 UCD-SNMP-MIB::extCommand.1 = STRING: /bin/sh /tmp/shtest UCD-SNMP-MIB::extCommand.2 = STRING: /bin/sh /tmp/shtest UCD-SNMP-MIB::extResult.1 = INTEGER: 35 UCD-SNMP-MIB::extResult.2 = INTEGER: 35 UCD-SNMP-MIB::extOutput.1 = STRING: hello world hi there UCD-SNMP-MIB::extOutput.2 = STRING: hello world hi there UCD-SNMP-MIB::extErrFix.1 = INTEGER: noError(0) UCD-SNMP-MIB::extErrFix.2 = INTEGER: noError(0) UCD-SNMP-MIB::extErrFixCmd.1 = STRING: UCD-SNMP-MIB::extErrFixCmd.2 = STRING: It's seams that no extension is make to the table :-( Is this right, that the subagent must start before the agent is startet ? Like this: /usr/lib/net-snmp/agents/mysql_agent.pl & `which snmpd` -Ls DAEMON -Lf /var/log/snmpd.log -u root -p /var/run/snmpd.pid -X -x localhost:705 -c /etc/snmp/snmpd.conf Sorry i have forgotten to tell you that i work on an Linux Ubuntu 6.06 Server :-) I have attached the actual snmpd.conf. Regards Stefan -Ursprüngliche Nachricht- Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Auftrag von Stefan Mikuszeit Gesendet: Dienstag, 3. Juli 2007 12:38 An: Dave Shield Cc: net-snmp-users@lists.sourceforge.net Betreff: AW: SNMP AgentX Problem Hello Dave, thx for your help :-) This is the code for set the new Value to the OID, it's included in the Script ;-) if ($next ne "") { $value = $global_status{$next}{'value'}; $request->setOID($next); $request->setValue(ASN_OCTET_STR, "$value"); The Debugging Info you will find at the attachment. Regards Stefan -Ursprüngliche Nachricht- Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Auftrag von Dave Shield Gesendet: Dienstag, 3. Juli 2007 10:40 An: Stefan Mikuszeit Cc: net-snmp-users@lists.sourceforge.net Betreff: Re: SNMP AgentX Problem On 02/07/07, Stefan Mikuszeit <[EMAIL PROTECTED]> wrote: > The problem is that the subagent dos not submit the collected data's > to the snmp agent, but i don't no why :( Try activating the debugging code in your subagent. What does that show? What are the exact commands you are trying? I haven't looked through the whole of your code, but: > My Subagent Perlscript > > <-- SNIP --> > > #!/usr/bin/perl -- > sub mysql_snmp_handler { > if ($mode == MODE_GET) { [snip] > } > > if ($mode == MODE_GETNEXT) { [snip] > } > } > #print STDERR "- finished processing\n" if ($debugging); > } This handler doesn't seem to include and code to support SET requests - just GET and GETNEXT. So it's not too surprising that SET requests aren't working :-) Dave PS: Please don't include so much in-line information. If you've got various additional code, MIB and config files, it's probably better to include them as attachments. snmpd.conf Description: snmpd.conf
AW: SNMP AgentX Problem
Hello Dave, thx for your help :-) This is the code for set the new Value to the OID, it's included in the Script ;-) if ($next ne "") { $value = $global_status{$next}{'value'}; $request->setOID($next); $request->setValue(ASN_OCTET_STR, "$value"); The Debugging Info you will find at the attachment. Regards Stefan -Ursprüngliche Nachricht- Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Auftrag von Dave Shield Gesendet: Dienstag, 3. Juli 2007 10:40 An: Stefan Mikuszeit Cc: net-snmp-users@lists.sourceforge.net Betreff: Re: SNMP AgentX Problem On 02/07/07, Stefan Mikuszeit <[EMAIL PROTECTED]> wrote: > The problem is that the subagent dos not submit the collected data's > to the snmp agent, but i don't no why :( Try activating the debugging code in your subagent. What does that show? What are the exact commands you are trying? I haven't looked through the whole of your code, but: > My Subagent Perlscript > > <-- SNIP --> > > #!/usr/bin/perl -- > sub mysql_snmp_handler { > if ($mode == MODE_GET) { [snip] > } > > if ($mode == MODE_GETNEXT) { [snip] > } > } > #print STDERR "- finished processing\n" if ($debugging); > } This handler doesn't seem to include and code to support SET requests - just GET and GETNEXT. So it's not too surprising that SET requests aren't working :-) Dave PS: Please don't include so much in-line information. If you've got various additional code, MIB and config files, it's probably better to include them as attachments. Jul 3 12:26:17 HOM21DB snmpd[11628]: registered debug token perl, 1 Jul 3 12:26:17 HOM21DB snmpd[11628]: registered debug token read_config, 1 Jul 3 12:26:17 HOM21DB snmpd[11628]: registered debug token agentx/master, 1 Jul 3 12:26:17 HOM21DB snmpd[11628]: registered debug token agentx/subagent, 1 Jul 3 12:26:17 HOM21DB snmpd[11630]: read_config: Jul 3 12:26:17 HOM21DB snmpd[11630]: reading premib configuration tokens Jul 3 12:26:17 HOM21DB snmpd[11630]: read_config: Jul 3 12:26:17 HOM21DB snmpd[11630]: config path used for snmpd:/etc/snmp/snmp:/usr/share/snmp:/usr/lib/snmp:/root/.snmp (persistent path:/var/net-snmp) Jul 3 12:26:17 HOM21DB snmpd[11630]: read_config: Jul 3 12:26:17 HOM21DB snmpd[11630]: Reading configuration /etc/snmp/snmp/snmpd.conf Jul 3 12:26:17 HOM21DB snmpd[11630]: read_config: Jul 3 12:26:17 HOM21DB snmpd[11630]: /etc/snmp/snmp/snmpd.conf:53 examining: com2sec local localhost secret Jul 3 12:26:17 HOM21DB snmpd[11630]: read_config: Jul 3 12:26:17 HOM21DB snmpd[11630]: /etc/snmp/snmp/snmpd.conf:54 examining: com2sec local localhost private Jul 3 12:26:17 HOM21DB snmpd[11630]: read_config: Jul 3 12:26:17 HOM21DB snmpd[11630]: /etc/snmp/snmp/snmpd.conf:55 examining: com2sec local localhost public Jul 3 12:26:17 HOM21DB snmpd[11630]: read_config: Jul 3 12:26:17 HOM21DB snmpd[11630]: /etc/snmp/snmp/snmpd.conf:57 examining: com2sec mynetwork 10.43.0.0/24 secret Jul 3 12:26:17 HOM21DB snmpd[11630]: read_config: Jul 3 12:26:17 HOM21DB snmpd[11630]: /etc/snmp/snmp/snmpd.conf:58 examining: com2sec mynetwork 10.43.0.0/24 private Jul 3 12:26:17 HOM21DB snmpd[11630]: read_config: Jul 3 12:26:17 HOM21DB snmpd[11630]: /etc/snmp/snmp/snmpd.conf:59 examining: com2sec mynetwork 10.43.0.0/24 public Jul 3 12:26:17 HOM21DB snmpd[11630]: read_config: Jul 3 12:26:17 HOM21DB snmpd[11630]: /etc/snmp/snmp/snmpd.conf:61 examining: com2sec mynetwork 10.42.0.0/24 secret Jul 3 12:26:17 HOM21DB snmpd[11630]: read_config: Jul 3 12:26:17 HOM21DB snmpd[11630]: /etc/snmp/snmp/snmpd.conf:62 examining: com2sec mynetwork 10.42.0.0/24 private Jul 3 12:26:17 HOM21DB snmpd[11630]: read_config: Jul 3 12:26:17 HOM21DB snmpd[11630]: /etc/snmp/snmp/snmpd.conf:63 examining: com2sec mynetwork 10.42.0.0/24 public Jul 3 12:26:17 HOM21DB snmpd[11630]: read_config: Jul 3 12:26:17 HOM21DB snmpd[11630]: /etc/snmp/snmp/snmpd.conf:70 examining: group MyRWGroup v1 local Jul 3 12:26:17 HOM21DB snmpd[11630]: read_config: Jul 3 12:26:17 HOM21DB snmpd[11630]: /etc/snmp/snmp/snmpd.conf:71 examining: group MyRWGroup v2clocal Jul 3 12:26:17 HOM21DB snmpd[11630]: read_config: Jul 3 12:26:17 HOM21DB snmpd[11630]: /etc/snmp/snmp/snmpd.conf:72 examining: group MyRWGroup usmlocal Jul 3 12:26:17 HOM21DB snmpd[11630]: read_config: Jul 3 12:26:17 HOM21DB snmpd[11630]: /etc/snmp/snmp/snmpd.conf:73 examining: group MyROGroup v1 mynetwork Jul 3 12:26:17 HOM21DB snmpd[11630]: read_config: Jul 3 12:26:17 HOM21DB snmpd[11630]: /etc/snmp/snmp/snmpd.conf:74 examining: group MyROGroup v2cmynetwork Jul 3 12:26:17 HOM21DB snmpd[11630]: read_config: Jul 3 12:26:17 HOM21DB snmpd[11630]: /etc/snm