Hi
Can anyone help with the following? I've been trying to write a simple subagent in Perl just to experiment with a view to maybe writing more complex stuff for our own software and config. I simply cannot get it to work at all. Firstly I used the NetSNMP::agent module with Perl as per the examples, however when registering the subagent I get a non-zero error code back (I cannot work out what the code is or what error may have occurred) If I strace the perl I can see during the registration its opened the /var/agentx/master socket, sends some stuff and gets a response back. Switching on a load of debug on the snmpd.... (just put on separate lines for readability) /usr/local/sbin/snmpd -f -Lf /tmp/snmpd.log -Dregister_mib,handler::register,agentx/subagent,agentx/config,agentx,ag entx/master,logging:register,handler_registry,handler:calling,subtree,ta ble_iterator,agent_handler,agent_registry -c /etc/snmp/snmpd.conf I get the following in log when I run the subagent... ========== agentx/master: unexpected callback op 4 agentx/master: handle pdu (req=0x7d2c2e2b,trans=0x0,sess=0x0) agentx/master: open 0x817a4a8 agentx/master: opened 0x8179d08 = 14 with flags = a0 agentx/master: send response, stat 0 (req=0x7d2c2e2b,trans=0x0,sess=0x0) agentx_build: packet built okay agentx/master: handle pdu (req=0x7d2c2e2c,trans=0x0,sess=0xe) agentx/master: in register_agentx_list register_mib: registering "AgentX subagent 14, session 0x817a4a8, subsession 0x8179d08" at SNMPv2-SMI::enterprises.19774.255 with context "(null)" subtree: looking for subtree for context: "" subtree: found one for: "" subtree: looking for subtree for context: "" subtree: found one for: "" agentx/master: registered ok agentx/master: send response, stat 0 (req=0x7d2c2e2c,trans=0x0,sess=0xe) agentx_build: packet built okay ========== Obviously I perked up seeing the last three lines there, but that's not getting translated into a success to the subagent. When I do an snmpget/walk around my OID I am just informed its past the end of the tree and my sub-agent handler does not get called (there is no real handler code yet, just a debug print to show me its being called) I tried messing around with various entries in config files, I have the main daemon config set with 'master agentx' on one line and regardless of the name passed in my subagent script, it always opens 'perl.conf' in the config dir which I have set to... agentx-master /var/agentx/master agentXTimeout 10 agentXRetries 1 agentPingInterval 3 All of which the subagent complains about, e.g. 'Warning: Unknown token: agentx-master.' The snmpd and perl subagent module were all pre-installed. From /etc/redhat-release we're running 'Red Hat Linux release 9 (Shrike)' snmpd -v reveals NET-SNMP version: 5.3.0.1 Web: http://www.net-snmp.org/ Email: net-snmp-cod...@lists.sourceforge.net Although we do also have the NetSNMP pure Perl module installed from writing SNMP clients/checkers. I have also written my own very simple MIB and installed it in to the correct dir, running snmptranslate picks it up without any errors. Although I'm not really sure where the MIB fits into the Perl sub-agent dev process, as there's no equivalent mib2c step I could see... So some guidance on that would be handy So I gave up on this and downloaded and build my own snmpd and perl from source. This seems even worse. It doesn't attempt to read the config files, open a socket or even try to send or receive anything. Can anyone help me with these problems at all? Clearly I've missed something fundamental on the source build and installation but I can't work out what. I cannot see any special steps to include agentx support. With the half working example, are there known bugs with this version or am I doing something wrong? Many thanks in advance _ _ Bill Melotti OSS Tools Manager Email: bill.melo...@mblox.com IM: bill.melotti.mb...@live.co.uk Direct: +44 (0) 20 8432 1332 WFH: +44 (0) 20 8432 1322 Mobile: +44 (0) 7810 000 333 Office: +44 (0) 20 8432 1260 Address: Olympic Office Centre, 4th Floor, 8 Fulton Road, Wembley, HA9 0NU, UK Website: www.mblox.com _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ NOTICE - This message and any attached files may contain information that is confidential and/or subject of legal privilege intended only for use by the intended recipient. If you are not the intended recipient or the person responsible for delivering the message to the intended recipient, be advised that you have received this message in error and that any dissemination, copying or use of this message or attachment is strictly forbidden, as is the disclosure of the information therein. If you have received this message in error please notify the sender immediately and delete the message.
<<image001.jpg>>
------------------------------------------------------------------------------ Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________ 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