AW: SNMP AgentX Problem LONG MAIL
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 LONG MAIL 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 LONG MAIL
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 LONG MAIL 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 LONG MAIL 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 - 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
AW: SNMP AgentX Problem LONG MAIL
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 LONG MAIL 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 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. snmpd.conf Description: snmpd.conf - 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