What do I set ProductID to in HOST-RESOURCES-MIB - snmp

I'm implementing an SNMP agent in python and am using the MIB HOST-RESOURCES-MIB. One of the fields that I need to set is hrSWRunID. This OID is defined to be of type ProductID and the definition for ProductID states
ProductID ::= TEXTUAL-CONVENTION
STATUS current
DESCRIPTION
"This textual convention is intended to identify the
manufacturer, model, and version of a specific
hardware or software product. It is suggested that
these OBJECT IDENTIFIERs are allocated such that all
products from a particular manufacturer are registered
under a subtree distinct to that manufacturer. In
addition, all versions of a product should be
registered under a subtree distinct to that product.
With this strategy, a management station may uniquely
determine the manufacturer and/or model of a product
whose productID is unknown to the management station.
Objects of this type may be useful for inventory
purposes or for automatically detecting
incompatibilities or version mismatches between
various hardware and software components on a system.
For example, the product ID for the ACME 4860 66MHz
clock doubled processor might be:
enterprises.acme.acmeProcessors.a4860DX2.MHz66
A software product might be registered as:
enterprises.acme.acmeOperatingSystems.acmeDOS.six(6).one(1)
"
SYNTAX OBJECT IDENTIFIER
-- unknownProduct will be used for any unknown ProductID
-- unknownProduct OBJECT IDENTIFIER ::= { 0 0 }
From this I assumed that a value of com.mycompany.mydepartment.myapp.appversion would suffice but when I run the code it fails with an error ProductID: invalid literal for int() with base 0: 'com'\n"]
With a bit of experimentation I finally managed to run my code with a ProductID set to a set of numbers such as {1, 2, 3}.Although my code now works I'm no clearer on what a correct value should be.
Can anyone shed any light on what ProductID is or should be?

The ProductID would be the OBJECT IDENTIFIER of a MIB object defined
under your enterprise MIB. A good start would be to make it the same as
the sysObjectID of your system group.

Related

Simulate the assembly of parts in Arena Simulation Software

I am simulating an assembly process in Arena. To keep things simple, suppose a model that assigns bags to passengers.
Each entity has a different ID (Entity.SerialNumber): I would like to check which bag has been assigned to which passenger.
How could I write a log file saving the ID of passenger and ID of the assigned bag?
First you must declare an attribute for the original entity that I understand that in this case would be the passenger, for example: ID = ID + 1, then with the separate module you duplicate the original entity, now both entities can have their independent flow and when you want to put them together again you can do it with a batch module using the rule: by attribute or with a match module using the type: based on attribute.

How to find the OID for particular product?

Now, I know the an Avaya switch product "ERS 5510-24T", how can I find the Object identifier for the product without using sysObjectID? Because before use snmpget to get the OID, we need have static list that use to map the OID, and then we know what the product is.
You have to use sysObjectID for proper network discovery. There is no other way around to identify the device/equipment via SNMP. The target OID is a part RFC1213 (MIB-II)
Object Name: sysObjectID
Object ID: 1.3.6.1.2.1.1.2.0
Object Syntax: OBJECT IDENTIFIER
Object Access: read-only
Object Status: mandatory
Object Description: The vendor's authoritative identification of the
network management subsystem contained in the
entity. This value is allocated within the SMI
enterprises subtree (1.3.6.1.4.1) and provides an
easy and unambiguous means for determining `what
kind of box' is being managed. For example, if
vendor `Flintstones, Inc.' was assigned the
subtree 1.3.6.1.4.1.4242, it could assign the
identifier 1.3.6.1.4.1.4242.1.1 to its `Fred
Router'.
You can use the following command from Net-SNMP package to get the value via SNMPv2C directly from device/equipment:
snmpget -v2c -c public device_addr 1.3.6.1.2.1.1.2.0
The vendors usually have a MIB that identifies its products. For Avaya I found the G3-AVAYA-MIB with some product OIDs, and the Nortel S5-REG-MIB which seems to be more appropriate. If you want to support a vendor, you'll have to search for the OIDs, or ask them.
Mentioned OID is SNMPv2-MIB::sysDescr.0, with numric value .1.3.6.1.2.1.1.1.0
Reference here
Exmaple using MIB name:
snmpget -v2c -c public rb750 SNMPv2-MIB::sysDescr.0 -On
Output
.1.3.6.1.2.1.1.1.0 = STRING: Some device
Exmaple using OID:
snmpget -v2c -c public rb750 .1.3.6.1.2.1.1.1.0
Output
SNMPv2-MIB::sysDescr.0 = STRING: Some device
GET sysObjectId.0 (1.3.6.1.2.1.1.2.0)
From that, you get what looks like on OID. The sixth (zero based!) element of that is the enterprise id.
Now you can zero in on the model, firmware, serial number, etc. of the device.
I use a map from enterprise Id to a collection of OIDs yanked from MIBs for this and I just keep tossing OIDs at the device until it likes one of them.
For example, if I know it's ZyXEL and I want to know the serial number I try these until one hits.
("ZyXEL Communications Corp.",
Seq(".1.3.6.1.4.1.890.1.15.3.82.2.10.0",
".1.3.6.1.4.1.890.1.5.8.55.1.10.0",
".1.3.6.1.4.1.890.1.5.8.18.1.10.0",
".1.3.6.1.4.1.890.1.5.8.19.1.10.0",
".1.3.6.1.4.1.890.1.5.8.16.1.10.0",
".1.3.6.1.4.1.890.1.15.3.1.12.0",
".1.3.6.1.4.1.890.1.5.8.59.1.10.0",
".1.3.6.1.4.1.890.1.5.8.60.1.10.0",
".1.3.6.1.4.1.890.1.5.8.56.1.10.0",
".1.3.6.1.4.1.890.1.5.8.21.1.10.0",
".1.3.6.1.4.1.890.1.5.8.27.1.10.0",
".1.3.6.1.4.1.890.1.5.8.73.1.10.0",
".1.3.6.1.4.1.890.1.5.8.53.1.10.0",
".1.3.6.1.4.1.890.1.5.8.23.1.10.0",
".1.3.6.1.4.1.890.1.5.8.72.1.10.0",
".1.3.6.1.4.1.890.1.5.8.12.1.10.0",
".1.3.6.1.4.1.890.1.5.8.20.1.10.0",
".1.3.6.1.4.1.890.1.5.8.68.1.10.0",
".1.3.6.1.4.1.890.1.5.12.47.1.10.0",
".1.3.6.1.4.1.890.1.5.8.46.1.10.0")),

CoreAudio: What is "AudioBox" as contrasted to "AudioDevice"

The header file CoreAudio/AudioHardware.h refers to a class "AudioBox" and indicates that it is distinct from but related to the class "AudioDevice". Searching developer.apple.com yields no hits for AudioBox. There is, unfortunately, a commercial product called AudioBox™, which makes googling for the term painfully low-yield.
Here are the comments containing the references:
kAudioHardwarePropertyBoxList
An array of AudioObjectIDs that represent all the AudioBox
objects currently provided by the system.
kAudioHardwarePropertyTranslateUIDToBox
This property fetches the AudioObjectID that corresponds to the
AudioBox that has the given UID. The UID is passed in via the qualifier as a CFString while the AudioObjectID for the AudioBox is
returned to the caller as the property's data. Note that an error
is not returned if the UID doesn't refer to any AudioBoxes.
Rather, this property will return kAudioObjectUnknown as the value of the property.
The header file: AudioHardwareBase.h contains numerous references to AudioBox, but does not define or explain it, although it associates it with AudioDevice.
Searching the docs via XCode just takes me back to AudioHardwareBase.h.
I can infer that perhaps an "AudioBox" is an audio device that is accessed via a plugin. But this does not appear to be stated anywhere.
So What Is An AudioBox?
An AudioBox is a container of (usually) AudioDevices

Unique id/code of every deployed application

I believe every deployed product (application) from VS has a unique id or smth like that, that doesn't change over distribution. What I mean is that I publish an app and give it to a company with 100 employees and the product remains with the same unique ID on every single PC it is installed.
I have come across GUID from Assembly Information of the program's project, but I am not sure it is that one. So is there anything like such unique id of the product, and if yes - where can I find it AND how can I access it in the code itself.
I.e.: string uniqueID = Something.getProductID() or whatever...
There are two methods to get GUID,
Fristly, you can get GUID in Assembly Information.
//Gets the assembly that contains the code that is currently executing.
Assembly asm = Assembly.GetExecutingAssembly();
Guid id= asm.GetType().GUID;
Secondly, It is not taken from the Assembly Information.Stored as a real custom attribute.
var attribute = (GuidAttribute)asm.GetCustomAttributes(typeof(GuidAttribute),true)[0].;
var id = attribute.Value;
More info you can see
Assembly.GetCustomAttributes Method (Type, Boolean)
http://msdn.microsoft.com/en-us/library/88d17d13.aspx
Assembly.GetExecutingAssembly Method
http://msdn.microsoft.com/en-us/library/system.reflection.assembly.getexecutingassembly.aspx

difference between device id and pnp device id

can somebody please explain difference between those two terms, when I'm trying to print
structs from Win32_AllocatedResource() I can find pnp device id (something like PCI\\VEN_...)
and when I'm trying to print structs from Win32_IDEControllerDevice() I can find device id (something like IDE\\CDROM...)
but what is the difference why do I need both of them? thanks in advance
Win32_AllocatedResource gives you the assignment of a given resource (e.g. a DMA starting address) to some "device" (or "object"), which when ResultClass = Win32_IDEController, is the controller.
Win32_IDEControllerDevice gives you the list of "devices" (or "object") that are connected to a certain controller, the Antecedent key is the DeviceID of the controller whereas the Dependent key is the DeviceID of the storage unit.

Resources