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 <mss 16396,sackOK,timestamp 2833992711 0,nop,wscale 2> 13:32:53.888863 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 <mss 16396,sackOK,timestamp 2833992711 2833992711,nop,wscale 2> 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 <nop,nop,timestamp 2833992711 2833992711> 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 <nop,nop,timestamp 2833992711 2833992711> 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 <nop,nop,timestamp 2833992711 2833992711> 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 <nop,nop,timestamp 2833992711 2833992711> 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 <nop,nop,timestamp 2833992711 2833992711> 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 <nop,nop,timestamp 2833992712 2833992711> 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 <nop,nop,timestamp 2833992712 2833992712> 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 <nop,nop,timestamp 2833992712 2833992712> 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 <nop,nop,timestamp 2833992712 2833992712> 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 <nop,nop,timestamp 2833992712 2833992712> 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 <nop,nop,timestamp 2833992718 2833992712> 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 <nop,nop,timestamp 2833992718 2833992718> 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 <nop,nop,timestamp 2833992718 2833992718> 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 <nop,nop,timestamp 2833992718 2833992718> 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 <LONG MAIL> 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 <LONG MAIL> 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 <LONG MAIL> 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. ------------------------------------------------------------------------- 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