How to transfer data between devices using snmp (oid-mib) - snmp

I have some problems with SNMP.
I want to share "different types" of data from 3 devices to the manager device using SNMP.
Do I need to create my own MIB and OID for this?
Is it possible to do this data transfer job in c code?

Related

Linux USB Gadget custom configuration

I am using a i.Mx6 Sabre Lite board running Linux Kernel 3.14.18 and board is supposed to act as a USB Device (USB Gadget). One Vendor specific interface need to be added into CDC/NCM Configuration. CDC/NCM Configuration by default has two standard interfaces - Communication & Data. I have added third interface (Vendor specific) to CDC/NCM Configuration. This interface has two Bulk (IN & OUT) Endpoints. I can verify this newly added interface once board is connected to PC using "lsusb".
Problem:
I cannot see the newly added interface getting exposed to user-space on i.Mx Board or PC, like standard NCM interfaces can be seen as usb0 (Ethernet device) on i.Mx Board as well as on PC and I can PING to/from board using usb0.
If I have to hookup this newly added interface with some g_"driver" (just like standard NCM interfaces are hooked to g_ether); then what is the best choice for BULK I/O?
How to make this newly added vendor specific interface available to i.MX6 user space so as to do read/write on it from Linux Application? I came to know about GadgetFS; but any example would be
Hope someone must have tried similar thing in Linux-USB and can guide.
A vendor-specific interface does not use a standard protocol, so it is not possible to use one of the standard drivers. (And bulk is not a protocol, it is a mechanism to implement your own protocol.)
To access such an interface, you have to use the low-level functions from something like libusb.

How to monitor Windows CPU and fan temperature by SNMP or other ways

I want to monitor 3 kinds of data for windows machines:
cpu temperature,
fan temperature
and fan speed, retrieving these data every 5 minutes. If these data can be retrieved by SNMP, that's my first choice.
I am wondering whether these data's root data source comes from Microsoft or the vendor of the motherboard. If they come from Microsoft, their OID should starts with 1.3.6.1.4.1.311, if they come from motherboard vendor, their OID should starts with 1.3.6.1.4.1.[motherboard vendor private snmp vendor OID], for example 1.3.6.1.4.1.11 for a HP server machine, 11 represents HP's private snmp vendor OID.
If you simply want to know how to query a Windows machine for the relevant SNMP data, this is possibly not the right site to ask this question on as it is a site for Q&A specific to software development. You may have better success asking at Server-Fault - here is a similar question to yours on there.
The OIDs for hardware specific SNMP monitoring are usually vendor specific. Typically you would need the Management Information Base (MIB) files that apply to your specific hardware in order to extract the information about which OIDs pertain to the data you require - as far as I know, CPU and Fan temperature are not generic SNMP properties.
If you cannot find the MIBs for your hardware sets (or there is no SNMP agent for your specific hardware), there is a piece of Windows software called SpeedFan that has an SNMP plugin that allows you to monitor the CPU and fan temperatures via SNMP. However this would require the Speedfan software to run in the background on all machines you wish to monitor. The OIDs for the SpeedFan software SNMP plugin are:
Temperature: .1.3.6.1.4.1.30503.1.5.x
Fans: .1.3.6.1.4.1.30503.1.6.x
Voltages: .1.3.6.1.4.1.30503.1.7.x
To get started monitoring this SNMP data on a Windows client machine you typically would need to:
install SNMP agent service
configure the SNMP service
Install speedfan
Install the Speedfan SNMP plugin
determine which OIDs are pertinent to your hardware (either using SpeedFan or vendor specific MIBs)
use an SNMP tool to perform an SNMP walk or an SNMP get to fetch the relevant SNMP data.
Using the command-line tool netsnmp you can walk the SNMP tree like so:
snmpwalk -v 2c -c public 127.0.0.1 .1.3.6.1.4.1.30503.1.5
(Assuming that your community string is "public" and you want to walk the "SpeedFan termperatures" sub-tree of your machine in this example).
A handy client tool with a gui for viewing snmp data is mibbrowser
The linked to Server-Fault Q&A has other useful information and links to various SNMP monitoring software solutions such as nagios, opennms etc.

Do Beacons Deliver Content?

Using the RadiusNetworks Proximity Kit, I have created a kit. Within the kit, I have created a region and registered my dev beacon. Next, I have attached key/value attributes to the beacon. My question is, once synched are these attributes physically stored on the beacon?
This article confuses me. Per this article:
They don't deliver anything. They simply broadcast a few identifiers.
Beacons broadcast a UUID, Major Value, and Minor Value. No user
consumable content is broadcast, just these IDs.
Along with the other info (UUID, major and minor versions), don’t these beacons also broadcast the key/value pairs?
iBeacons can only transmit one type of data: the UUID number. Beacons using the new Eddystone standard can transmit three types of data: UID (similar to UUID), URL (website addresses) and TLM (telemetry, such as temperature and beacon battery level). Standard beacons don't have any memory to store arbitrary data, but you could work around that by using the Lightblue Bean or building a custom beacon from Raspberry Pi. Like already mentioned, another option would be to use a backend, where you store and retrieve the data. We did a museum application that functioned with iBeacons using our Proximi.io platform, which is able to store the data for temporary offline mode, and re-syncs, when Internet access becomes available again. A third option would be to just build in all the data into the application.
Looking at the Proximity Kit Documentation, step 2 of the lifecycle says that your app will sync with their back end and that your "region data and configuration is cached and can be updated in the background."
I believe that your key/value pairs are stored in the cloud (and synced to your mobile device), and not stored on the beacon (since there is no way for their back end to connect to a beacon).

How unique MAC ID is generated for the each card?

I was wondering that how can all different network devices have different MAC ID's.
is it hardcoded separately for each device ? (extremely unlikely..since in production nobody would like to change the code and recompile and load the program...)
or
a switch is used to set the address
or
is it loaded from the ROM ?
or something else ..
Many networking interfaces use EEPROMs that come pre-programmed with EUI-48 or EUI-64. They use EEPROMs to store configuration settings and other data anyway, so they don't have any additional cost using the pre-programmed EEPROMs other than the chips ending up slightly more expensive per 1k. Programming each device with a unique ID would however incur additional cost.
For instance, 24AA02xE is an I²C SEEPROM with pre-programmed EUI-48/EUI-64 at standard addresses. 93AA46AE48 is an SPI SEEPROM with pre-programmed EUI-48 that's directly compatible with LAN9xxx Ethernet Controllers.
I'm not affiliated with Microchip. I used their chips in a hobby project and noticed the datasheet mentioning the EUI-48 features.

how to use SNMP

I have some linux servers which will work as SNMP agents. I need to use Java and SNMP4J to monitor these servers (agents), and also the SNMP manager must be able to check upon these servers.
How to implement SNMP in the SNMP agent to respond to the queries from SNMP manager?
What is the usage of MIB file? If I hardcode the values in the MIB file, does it mean that I don't need to parse the MIB file?
String product = "1.2.3.1.2.3.6421"
String productmgr = "1.2.3.1.2.3.6421.4"
There are some SO questions that should help.
For #1 look at Getting started with SNMP4J
For #2 you can indeed hardcode OIDs; but that would only work for a trivial scenario, there are many questions regarding MIBs e.g. question about SNMP MIB file
In order to implement SNMP agent on client side, after installing snmp , just execute snmp commands to communicate with the manager.
The Management Information Base (MIB) is a virtual information storage area for network management information, which consists of collections of managed objects. Within the MIB there are collections of related objects, defined in MIB modules. MIB modules are written in the SNMP MIB module language, as defined in STD 58, RFC 2578, RFC 2579, and RFC 2580.
Of course you can hardcode some OIDs in SNMP MIB. But in most of the cases it will not be stable. Even if you hardcode the values in the MIB file, then again you need to reparse the same.

Resources