How do I convert MIB to C - SNMP

This is a discussion on How do I convert MIB to C - SNMP ; I have written a MIB. Can you tell me how can I use mib2c or other tool in Linux (Fedora) to make a .c and a .h file from the MIB file. My MIB file is here ... ================ MY-OWN-MIB.txt ...

+ Reply to Thread
Results 1 to 2 of 2

Thread: How do I convert MIB to C

  1. How do I convert MIB to C

    I have written a MIB. Can you tell me how can I use mib2c or other
    tool in Linux (Fedora) to make a .c and a .h file from the MIB file.
    My MIB file is here ...


    ================
    MY-OWN-MIB.txt
    ================

    MY-OWN-MIB DEFINITIONS ::= BEGIN

    IMPORTS
    MODULE-IDENTITY, OBJECT-TYPE, Integer32 FROM SNMPv2-SMI
    DisplayString FROM SNMPv2-TC
    enterprises FROM RFC1155-SMI;


    mycom OBJECT IDENTIFIER ::= { enterprises 10 }


    myOwnMIB MODULE-IDENTITY
    LAST-UPDATED "9912090000Z"
    ORGANIZATION "Group Work"
    CONTACT-INFO
    "KAT
    "
    DESCRIPTION
    "My MIB"
    REVISION "9912090000Z"
    DESCRIPTION
    "SMIv2 version converted from older MIB definitions."
    ::= { groupwork 1234 }



    myOwnMIBobjects OBJECT IDENTIFIER ::= { myOwnMIB 1 }
    mem OBJECT IDENTIFIER ::= { myOwnMIBobjects 1 }
    cpu OBJECT IDENTIFIER ::= { myOwnMIBobjects 2 }

    FreeSWAP OBJECT-TYPE
    SYNTAX Integer32
    MAX-ACCESS read-only
    STATUS current
    DESCRIPTION
    "Gives the swap space available in the system."
    ::= { mem 1 }

    TotalSWAP OBJECT-TYPE
    SYNTAX Integer32
    MAX-ACCESS read-only
    STATUS current
    DESCRIPTION
    "Gives the total swap space available in the system."
    ::= { mem 2 }

    FreeRAM OBJECT-TYPE
    SYNTAX Integer32
    MAX-ACCESS read-only
    STATUS current
    DESCRIPTION
    "Gives the amount of free RAM available in the system."
    ::= { mem 3 }

    TotalRAM OBJECT-TYPE
    SYNTAX Integer32
    MAX-ACCESS read-only
    STATUS current
    DESCRIPTION
    "Gives the total amount of RAM available in the system."
    ::= { mem 4 }

    SharedRAM OBJECT-TYPE
    SYNTAX Integer32
    MAX-ACCESS read-only
    STATUS current
    DESCRIPTION
    "Gives the amount of shared RAM available in the system."
    ::= { mem 5 }


    BufferRAM OBJECT-TYPE
    SYNTAX Integer32
    MAX-ACCESS read-only
    STATUS current
    DESCRIPTION
    "Gives the amount of buffer RAM available in the system."
    ::= { mem 6 }


    USG1 OBJECT-TYPE
    SYNTAX Integer32
    MAX-ACCESS read-only
    STATUS current
    DESCRIPTION
    "Gives the amount of CPU utilization for 1 min in the system."
    ::= { cpu 1 }

    USG2 OBJECT-TYPE
    SYNTAX Integer32
    MAX-ACCESS read-only
    STATUS current
    DESCRIPTION
    "Gives the amount of CPU utilization for 5 mins in the
    system."
    ::= { cpu 2 }

    USG3 OBJECT-TYPE
    SYNTAX Integer32
    MAX-ACCESS read-only
    STATUS current
    DESCRIPTION
    "Gives the amount of CPU utilization for 15 mins in the
    system."
    ::= { cpu 3 }

    END


    =====================

    Please help me. Am new to mib2c and dont know how to convert it.
    Thank you.

  2. Re: How do I convert MIB to C

    On Feb 17, 9:04 am, Anjali Gupta wrote:
    > I have written a MIB. Can you tell me how can I use mib2c or other
    > tool in Linux (Fedora) to make a .c and a .h file from the MIB file.
    > My MIB file is here ...
    >
    > ================
    > MY-OWN-MIB.txt
    > ================
    >
    > MY-OWN-MIB DEFINITIONS ::= BEGIN
    >
    > IMPORTS
    > MODULE-IDENTITY, OBJECT-TYPE, Integer32 FROM SNMPv2-SMI
    > DisplayString FROM SNMPv2-TC
    > enterprises FROM RFC1155-SMI;
    >
    > mycom OBJECT IDENTIFIER ::= { enterprises 10 }
    >
    > myOwnMIB MODULE-IDENTITY
    > LAST-UPDATED "9912090000Z"
    > ORGANIZATION "Group Work"
    > CONTACT-INFO
    > "KAT
    > "
    > DESCRIPTION
    > "My MIB"
    > REVISION "9912090000Z"
    > DESCRIPTION
    > "SMIv2 version converted from older MIB definitions."
    > ::= { groupwork 1234 }
    >
    > myOwnMIBobjects OBJECT IDENTIFIER ::= { myOwnMIB 1 }
    > mem OBJECT IDENTIFIER ::= { myOwnMIBobjects 1 }
    > cpu OBJECT IDENTIFIER ::= { myOwnMIBobjects 2 }
    >
    > FreeSWAP OBJECT-TYPE
    > SYNTAX Integer32
    > MAX-ACCESS read-only
    > STATUS current
    > DESCRIPTION
    > "Gives the swap space available in the system."
    > ::= { mem 1 }
    >
    > TotalSWAP OBJECT-TYPE
    > SYNTAX Integer32
    > MAX-ACCESS read-only
    > STATUS current
    > DESCRIPTION
    > "Gives the total swap space available in the system."
    > ::= { mem 2 }
    >
    > FreeRAM OBJECT-TYPE
    > SYNTAX Integer32
    > MAX-ACCESS read-only
    > STATUS current
    > DESCRIPTION
    > "Gives the amount of free RAM available in the system."
    > ::= { mem 3 }
    >
    > TotalRAM OBJECT-TYPE
    > SYNTAX Integer32
    > MAX-ACCESS read-only
    > STATUS current
    > DESCRIPTION
    > "Gives the total amount of RAM available in the system."
    > ::= { mem 4 }
    >
    > SharedRAM OBJECT-TYPE
    > SYNTAX Integer32
    > MAX-ACCESS read-only
    > STATUS current
    > DESCRIPTION
    > "Gives the amount of shared RAM available in the system."
    > ::= { mem 5 }
    >
    > BufferRAM OBJECT-TYPE
    > SYNTAX Integer32
    > MAX-ACCESS read-only
    > STATUS current
    > DESCRIPTION
    > "Gives the amount of buffer RAM available in the system."
    > ::= { mem 6 }
    >
    > USG1 OBJECT-TYPE
    > SYNTAX Integer32
    > MAX-ACCESS read-only
    > STATUS current
    > DESCRIPTION
    > "Gives the amount of CPU utilization for 1 min in the system."
    > ::= { cpu 1 }
    >
    > USG2 OBJECT-TYPE
    > SYNTAX Integer32
    > MAX-ACCESS read-only
    > STATUS current
    > DESCRIPTION
    > "Gives the amount of CPU utilization for 5 mins in the
    > system."
    > ::= { cpu 2 }
    >
    > USG3 OBJECT-TYPE
    > SYNTAX Integer32
    > MAX-ACCESS read-only
    > STATUS current
    > DESCRIPTION
    > "Gives the amount of CPU utilization for 15 mins in the
    > system."
    > ::= { cpu 3 }
    >
    > END
    >
    > =====================
    >
    > Please help me. Am new to mib2c and dont know how to convert it.
    > Thank you.



    Need no help. I have done it. Just needed to load the mibs.

+ Reply to Thread