I want to read data from my sensors on 2 devices with SNMP(net-SNMP).
Do I have to write my own mib code for this?
I want to read the sensor data on these two devices via a manager code.
what do I need to do about this?
You should first check if a MIB for your device already exists: go check to this site.
You should then see if you need a SNMP Subagent: if you want to extend your SNMP Master Agent with MIBs different from the default ones (like system or network), you should use a Subagent (see here on how to extend a Master Agent with a Subagent; usually, this is performed through AgentX protocol).
You may run the entire echosystem on your localhost and see first if all the components are up and operative: in this phase, you may mimic your sensors by returning hard-coded values to your Subagent.
Related
I am building off the XO game from the sawtooth SDK and am running into several issues. First, I am able to sucessfully modify the XOHandler to modify the type of data I am uploading to the network. I have been working with the shell default so I am a little unfamiliar with how the other containers work. I am running some tests and need to run a network with 100, 500 and, 1000 nodes respectivly. I am using a docker enviorment and the yaml file that specifies 5 total validators. For my network I am doing a quorum based consensus so I only want maybe 10 validators that are tcp enabled. Is their a good way of simulating this scenario? I thought I would just need to add a bunch of validators directly in the yaml file but I found this in the Sawtooth documentation. https://sawtooth.hyperledger.org/docs/1.2/sysadmin_guide/pbft_adding_removing_node.html#adding-a-pbft-node-label
This is confusing to me because it sounds like these are the steps taken for the Ubuntu Sawtooth install. I just copied the sawtooth core off of github so I am not sure which steps I should be following. I also have the issue of the yoml file. I found some stuff mentioning that this file stored some information about the validators however when I go the ./etc/sawtooth/ directory inside the docker their is no yoml file. Am I in the wrong place? That is the first question.
Second question concerns the Dependencies array in the transaction header. My network is designed in a way that I will need dependencies set between different blocks. I am also doing a one block per batch network. Whenever I would add dependencies however I run a RepeatGossip error and it says the block has already been added. My input and output fields are the same. Any feedback on this message? Of course the parent has already been added but specifying the parents in dependencies shouldn't block the block upload.
I am making a CAN simulator for GPS trackers, they only record CAN data and doesn't send ACK. Is it possible to send CAN data with raspberry, using mcp2515/tja1050, without any device on bus that would trigger ACK?
This will usually generate a continuous retransmit.
Some devices have a "one-shot" transmit mode when just sends the CAN frame and does not attempt a retransmission. If you transmitter has this mode you can do what you describe, otherwise you will get a lot of retransmissions.
No it isn't possible, you need at least 2 nodes that are actively participating in the communication. This can however be fixed by just providing another CAN controller on the bus, which doesn't have to do anything intelligent except the ACK part.
For development/debug/test purposes you can however put your own node in "loopback mode", meaning it will speak to itself. Can be handy if you have to proper hardware available yet.
You can try to set the controlmode presume-ack to on.
Assuming you are using the ip command for creating your can sockets that would be something like
ip link set <DEVICE> type can presume-ack on
This will ignore missing ACKs. However I am not sure whether this works with all controllers.
I am having issues of writing a very huge mib, as due to the senario that I have only one agent connected with many devices which do not have snmp. All Devices are sending same type of data to agent by pushing and agent is then sending snmp traps to SNMP manager. Also Manager is sending SNMP GETs to agent. I want to write a standard mib, which applies to every device and Manager has to send only some OIDs to get values against, not hundreds of OIDs.
A very huge mib means a lot of branches.
A sub-agent is an additional SNMP daemon that extends functionality of the master agent. Basically, OID sub-trees are assigned to the sub-agent(s). There are also a few other ways of extending functionality. For example, Here's a nice article on different ways of extending an Net-SNMP agent.
Some of the differences pointed out in the article include:
No configuration is needed for the master agent to accept an
additional sub-agent. A sub-agent registers to the master agent the
MIB modules (or part of them) it wants to take care of.
A sub-agent is decoupled from the master agent. It can run with a
different identity or be integrated into another daemon to export its
internal metrics, send traps or allow remote configuration through
SNMP.
AgentX protocol can be carried over TCP. Sub-agents can therefore run
on a foreign host or in a jailed environment.
64bit types are fully supported. Traps are also supported.
From what I can understand, you have remote devices pushing data to an agent, who in turn needs to be able to process and return this data to an SNMP manager using SNMP traps and/or SNMP gets. One thing to keep in mind is that your SNMP agent may be blocking when processing the incoming data. A sub-agent could be helpful in taking care of this work independently.
In regards to having a large amount of branches to cover each device, a table could be used. Depending on what kind of data your sending, bit fields can also be useful. Defined bitfields can be used to send large amounts of information on one device via one transaction.
I've been given a task to write some code to notify administrators if the device sends a trap. Also I'd like to be able to check upon the device as well.
I'm not so sure where to begin. Is there a test server online where I can test if I setup the device correctly? (Whether it send traps according to the condition I set?)
If I were to write code to monitor this device, I think I should learn how the snmp and mib files work exactly. Is there good summary and reference for me?
Is there some simple example code for snmp?
download any trial based S/W to receive traps on your system like LoriotProV6 or SolarWids.
In windows based sys open run evntwin.exe n select ur preferred options to generate traps like SNMP.
Here you need to check for Trapping column if it says "Yes" then only select it..
or else it wont mean any thing.
then click add run ur SNMP services.
To rum SNMP services go to control panel-> Add/Remove -> Add/Remove Windows component -> check Management & Monitoring click on details n check SNMP & WMI options.
now go to control panel-> Administrator tools -> Services -> search SNMP services n& start it.
You can consider 2 basic ways to check whether the device of interest generating/sending out SNMP traps.
You can just run wireshark on the device (if possible) or on the target server (where the traps supposed to arrive). Then you can filter the traffic using default SNMP ports. For example it could be one of the following: 161, 162, 10161, 10162.
You can install a MIB browser on the target server and see if any traps arrive. There are number of available free applications on the web.
I guess I have missed the obvious, maybe, but I am lost for a good answer.
I am developing a stand alone program that will be running on a Linux (Ubuntu?) embedded PC inside a piece of hardware. I want it to be the "thing" SNMP talks to. Well, short of compiling in my own SNMD "daemon" code and persuading Linux to let a general user have access to port 161, I think I'll opt for Net-SNMP's snmpd. I am open to suggestions for better products to use. LGPL, BSD, MIT, licenses, please.
I am working separately on the MIB and assigning OIDs, etc. I know what vars I want to set and get, etc.
I have read and reread the stuff on making an SNMP/snmpd Agent and/or subagent. Near as I can tell, they are both compiled into snmp or linked to it as a shared library. Right?
So, how do I get that agent to talk to my sepaprate program running in a separate general user session? Is there a direct technique to use? D-Bus? ppen()? Named pipes? Shared memory? Temp files? UDP port? Something better? Or do I really want to turn my program into a .SO and let snmpd launch it? I assume at that point I'd be abe to tell snmpd where to call in to me to get/set vars. Right?
Thanks!
The "AgentX" protocol is a way for arbitrary applications to supply SNMP services to a running system SNMP daemon. Your application listens on some port other than 161 (typically a library will take care of the details for you), and the system snmpd will forward requests for your OIDs to your subagent. This method doesn't involve linking any code into the system snmpd.
Often an easier way is to configure the system snmpd to run a script to get or set data. The script can, if you like, use some other kind of IPC to talk to your application (such as JSON to an HTTP server, for example).