I have read the FAQ you mentioned, as well as other related to this topic a few 
days ago, and I can't says it was all clear to me.

OK, so here are the said files in full version, including changes you suggested 
below.

Daniel

-----Message d'origine-----
De : dave.shi...@gmail.com [mailto:dave.shi...@gmail.com] De la part de Dave 
Shield
Envoyé : mercredi 6 juin 2012 15:14
À : Chayvialle, Daniel (External)
Cc : net-snmp-users@lists.sourceforge.net
Objet : Re: Stuck in the way of quering a private MIB (extension using perl)

On 6 June 2012 14:02, Chayvialle, Daniel (External)
<daniel.chayvialle.exter...@cassidian.com> wrote:
> My intention was to have a perl sub-agent. The pass version was added
> just in case it would work by chance (the kind of things that rarely happen,
> but for which I get blamed if I don't try).

Fair enough - but I have to say that it was wildly optimistic.
The pass-through mechanism and the perl-subagent approach
are completely different, and use very different styles of coding.

If you're using the perl sub-agent, then stick with that.


> The access control settings are
>
> % ls -l .snmp/mibs/tcs-agent-module.pl                                 ~
> -rw-rw-r-- 1 daniel daniel 3134  5 juin  14:51 .snmp/mibs/tcs-agent-module.pl
> % ls -l /etc/snmp/snmpd.conf                                           ~
> -rw------- 1 root root 7362  6 juin  10:05 /etc/snmp/snmpd.conf

No.   That's not what I meant.

What are the access control settings *within* the snmpd.conf file.
Have you read the FAQ entry that I mentioned yet?


> The TCS-MIB as you'd expect from below in my mail in the said private MIB.
>
> Here is an extract from the ~/.snmp/mibs/TCS-MIB.mib file

Hmmm...   I really dislike being given "extracts" of a file.
I never know whether the bits that have been omitted might actually be
important.


> TCS-MIB DEFINITIONS ::= BEGIN
>
> IMPORTS
> OBJECT-TYPE, MODULE-IDENTITY, enterprises, Integer32,
> Counter32, Gauge32, TimeTicks
>                                FROM SNMPv2-SMI
> TruthValue, TimeStamp           FROM SNMPv2-TC
> MODULE-COMPLIANCE,OBJECT-GROUP  FROM SNMPv2-CONF
> ;
>
> -- Gauge32 est un alias de Gauge
>
> -- EnumVal defini comme un alias de INTEGER
> EnumVal ::= INTEGER (0..4294967295)
>
> tcs MODULE-IDENTITY
>    LAST-UPDATED "201205230000Z"
>    DESCRIPTION
>        "Example MIB objects for agent module example implementations"
>    REVISION     "201205230000Z"
>    DESCRIPTION
>        "First draft"
>    ::= { eads 3665 }
> -- IANA assigned OID 16304 to EADS, but I can't find this in Cafuro, so it's 
> stated here
> eads                    OBJECT IDENTIFIER ::= { enterprises 16304 }

I'm not sure offhand how well the Net-SNMP MIB parser copes with this
sort of back-reference.   It might be safer to use

   tcs MODULE-IDENTITY
      :
   ::=  { enterprises 16304  3665 }


> --
> -- test string
> --
> tcsTestString OBJECT-TYPE
>    SYNTAX      OctetString
>    MAX-ACCESS  read-write
>    STATUS      current
>    DESCRIPTION
>        "This is a test string."
>    DEFVAL { "et comme ca ca marche?" }
>    ::= { tcs 0 }

Don't use 0 as the final element of an object's OID.
This should be positive - typically starting at 1
   [See RFC 2578, section 7.10, final para]


> After applying what you adviced to the conf files, I still get
>
> % snmpget -v1 -c public localhost sysDescr.0 sysUpTime.0; snmpget -v1 -c 
> public localhost tcsTestString.0
> SNMPv2-MIB::sysDescr.0 = STRING: Linux debian 2.6.32-5-686 #1 SMP Mon Mar 26 
> 05:20:33 UTC 2012 i686
> DISMAN-EVENT-MIB::sysUpTimeInstance = Timeticks: (5758) 0:00:57.58
> tcsTestString.0: Unknown Object Identifier (Sub-id not found: (top) -> 
> tcsTestString)

Don't be so hasty.
We know that you can query the system group, but you still haven't
checked whether
you can query other standard objects.
   Don't even think about looking at your TCS-MIB objects until something like

         snmpgetnext -v1 -c public localhost   ifName

works.

Dave

Attachment: snmpd.conf
Description: snmpd.conf

Attachment: TCS-MIB.mib
Description: TCS-MIB.mib

------------------------------------------------------------------------------
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

Reply via email to