Of course! Sorry for being all sloppy with this I have too many projects going 
on at the same time.

This is validated as ok so I'll use this for my initial testing: (thanks again)

Advania-Traps-MIB DEFINITIONS ::= BEGIN
 
IMPORTS
   OBJECT-GROUP, NOTIFICATION-GROUP FROM SNMPv2-CONF 
   DisplayString FROM SNMPv2-TC
   MODULE-IDENTITY, OBJECT-TYPE, NOTIFICATION-TYPE,
   enterprises                   FROM SNMPv2-SMI;


-- ## Module identity
 
advania MODULE-IDENTITY
    LAST-UPDATED "201404090000Z"
    ORGANIZATION "Advania hf"
    CONTACT-INFO "Aki Barkarson a...@advania.is"
    DESCRIPTION  "Intended for internal Advania use only."
    REVISION      "201404090000Z"
    DESCRIPTION
            "This revision of this MIB module was published as
             a test for custom traps."
::= { enterprises 1513 }

-- ## Structure

-- ID for this attempt at OID structure is traps1
traps1                                    OBJECT IDENTIFIER ::= { advania  1 }
objects                                 OBJECT IDENTIFIER ::= { traps1 1 }
notifications                       OBJECT IDENTIFIER ::= { traps1 2 }
groups                                 OBJECT IDENTIFIER ::= { traps1 3 }
-- set sub-id as 0 for SNMPv1 compatibility as per rfc2578 section 8.5
notificationsPrefix     OBJECT IDENTIFIER ::= { notifications 0 }

-- ## Groups

allTraps NOTIFICATION-GROUP
   NOTIFICATIONS { customTrap }
   STATUS        current
   DESCRIPTION
           "Traps group."
   ::= { groups 1 }

allObjects OBJECT-GROUP
   OBJECTS {
       trapState, shortMsg, longMsg1,
       longMsg2, longMsg3, longMsg4
      }
    STATUS   current
    DESCRIPTION
               "All objects."
    ::= { groups 2 }

 
-- ## Objects
 
trapState OBJECT-TYPE
    SYNTAX      DisplayString (SIZE (0..7))
    MAX-ACCESS accessible-for-notify
    STATUS      current
    DESCRIPTION
            "Describes the state of an alert like start or end"
    ::= { objects 1 }
 
shortMsg OBJECT-TYPE
    SYNTAX      DisplayString (SIZE (0..31))
    MAX-ACCESS accessible-for-notify
    STATUS      current
    DESCRIPTION
            "A brief description. Can also contain transaction ID."
    ::= { objects 2 }
 
longMsg1 OBJECT-TYPE
    SYNTAX      DisplayString (SIZE (0..255))
    MAX-ACCESS accessible-for-notify
    STATUS      current
    DESCRIPTION
            "Detailed info."
    ::= { objects 3 }

longMsg2 OBJECT-TYPE
    SYNTAX      DisplayString (SIZE (0..255))
    MAX-ACCESS accessible-for-notify
    STATUS      current
    DESCRIPTION
            "Detailed info."
    ::= { objects 4 }

longMsg3 OBJECT-TYPE
    SYNTAX      DisplayString (SIZE (0..255))
    MAX-ACCESS accessible-for-notify
    STATUS      current
    DESCRIPTION
            "Detailed info."
    ::= { objects 5 }

longMsg4 OBJECT-TYPE
    SYNTAX      DisplayString (SIZE (0..255))
    MAX-ACCESS accessible-for-notify
    STATUS      current
    DESCRIPTION
            "Detailed info."
    ::= { objects 6 }

 
 -- ## Notifications
 
customTrap NOTIFICATION-TYPE
       OBJECTS { trapState, shortMsg, longMsg1, longMsg2, longMsg3, longMsg4 }
       STATUS current
       DESCRIPTION "Custom trap alert."
       ::= { notificationsPrefix 1 }
 
END



Áki Hermann Barkarson
Sérfræðingur / Service Engineer
CCDP / CCIE # 27552
 

Skilmálar/Disclaimer
 



-----Original Message-----
From: Olivier Miakinen [mailto:om+net-s...@miakinen.net] 
Sent: 9. apríl 2014 11:15
To: Áki Hermann Barkarson; net-snmp-users@lists.sourceforge.net
Subject: Re: creating custom mib

Le 09/04/2014 12:37, Áki Hermann Barkarson a écrit :
> Using your input this is what I come up with: any more comments appreciated :)
> 
> [...]
>     MAX-ACCESS  notify

accessible-for-notify

The best would be to validate your mib with an automatic validator.
Net-SNMP recommends smilint or libsmi :
<http://www.net-snmp.org/wiki/index.php/Writing_your_own_MIBs#Validating_your_MIB>

Regards,
-- 
Olivier Miakinen

------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/NeoTech
_______________________________________________
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