PODUNK-RR-MIB DEFINITIONS ::= BEGIN -- PODUNK-RR-MIB: -- A private enterprise mib (enterprise #9999) -- This is a demo of the restricted MIB syntax understood by -- fsubagent and its mib2h.pl MIB compiler. -- mib2h.pl has built-in definitions for things like Gauge -- and DisplayString, -- but import them from the right place anyway for benefit of -- other mib compilers. IMPORTS enterprises, Counter, Gauge FROM RFC1155-SMI OBJECT-TYPE FROM RFC-1212 DisplayString FROM RFC1213-MIB; -- I personally have found that absolute timestamps are better than -- relative timestamps, because you can tell at a glance whether they're -- fresh or stale. I tend to use the Unix time_t style of timestamp, -- and syncronize clocks between all my machines. YMMV. TimeT ::= TEXTUAL-CONVENTION STATUS current DESCRIPTION "UNIX time in seconds since January 1, 1970 00:00 UTC" SYNTAX INTEGER -- podunk OBJECT IDENTIFIER ::= { enterprises 9999 } fleet OBJECT IDENTIFIER ::= { podunk 71 } -- fleet-wide status fleetStatus OBJECT IDENTIFIER ::= { fleet 1 } fsTrainUsed OBJECT-TYPE SYNTAX Gauge ACCESS read-only STATUS mandatory DESCRIPTION "Number of active trains in fleet." ::= { fleetStatus 1 } fsTrainFree OBJECT-TYPE SYNTAX Gauge ACCESS read-only STATUS mandatory DESCRIPTION "Number of unused trains in fleet." ::= { fleetStatus 2 } fsTrainCount OBJECT-TYPE SYNTAX Counter ACCESS read-only STATUS mandatory DESCRIPTION "Number of rows in trainTable. Can't decrease, because this MIB doesn't support row deletion (which is ill defined anyway)." ::= { fleetStatus 3 } -- Next, a table that info about each train. -- It has entries with OIDs like -- podunk.fleet.trainTable.trainEntry.trainName.n -- where n varies from 1 to the number of trains. trainTable OBJECT-TYPE SYNTAX SEQUENCE OF TrainEntry ACCESS read-only STATUS mandatory DESCRIPTION "A table containing information about the state of trains in a fleet." ::= { fleet 2 } trainEntry OBJECT-TYPE SYNTAX TrainEntry ACCESS read-only STATUS mandatory DESCRIPTION "An entry containing information about a train" INDEX { trainIndex } ::= { trainTable 1 } TrainEntry ::= SEQUENCE { trainIndex INTEGER, trainName DisplayString, trainLastDeparture TimeT, trainCarCount INTEGER, } trainIndex OBJECT-TYPE SYNTAX integer ACCESS read-only STATUS mandatory DESCRIPTION "Reference Index for each train. Identical to last component of OID; not very interesting." ::= { trainEntry 1 } trainName OBJECT-TYPE SYNTAX DisplayString (SIZE (0..255)) ACCESS read-only STATUS mandatory DESCRIPTION "String uniquely identifying the train." ::= { trainEntry 2 } trainLastDeparted OBJECT-TYPE SYNTAX TimeT ACCESS read-only STATUS mandatory DESCRIPTION "Time this train last left the station, in seconds since Jan 1 1970 00:00 UTC." ::= { trainEntry 3 } trainCarCount OBJECT-TYPE SYNTAX INTEGER ACCESS read-only STATUS mandatory DESCRIPTION "The number of entries in carTable for this train." ::= { trainEntry 4 } -- Next, a table that extends trainTable with info about cars of each train. -- It has entries with OIDs like -- podunk.fleet.carTable.carEntry.carName.n.m -- where n is the index in the train table, -- and m varies from 1 to the number of cars in that train carTable OBJECT-TYPE SYNTAX SEQUENCE OF CarEntry ACCESS read-only STATUS mandatory DESCRIPTION "A table containing information about the state of cars of a train." ::= { fleet 3 } carEntry OBJECT-TYPE SYNTAX CarEntry ACCESS read-only STATUS mandatory DESCRIPTION "Information about the state of cars of a train." INDEX { trainIndex, carIndex } ::= { carTable 1 } CarEntry ::= SEQUENCE { carIndex Integer, carName DisplayString, carLastCleaned TimeT } carIndex OBJECT-TYPE SYNTAX Integer ACCESS read-only STATUS mandatory DESCRIPTION "Reference Index for each car. Identical to last component of OID; not very interesting." ::= { carEntry 1 } carName OBJECT-TYPE SYNTAX DisplayString (SIZE (0..255)) ACCESS read-only STATUS mandatory DESCRIPTION "Name identifying a car of a train." ::= { carEntry 2 } carLastCleaned OBJECT-TYPE SYNTAX TimeT ACCESS read-only STATUS mandatory DESCRIPTION "Time this car was last cleaned, in seconds since Jan 1 1970 00:00 UTC." ::= { carEntry 3 } END