I am very new to SNMP and I need to get "system uptime" using our own enterprise OID.
I have already obtained an IANA number and created a MIB file.
The problem is when I use snmpget command with our OID, I get an object not found error at the command prompt.
Although when I do a snmptranslate on our object, I get the exact OID of that object.
If any additional information is required from my side, please let me know.
When you use snmpget, an SNMP request is made via IP to an SNMP agent on a remote (or local) host to return a specific piece of data. A MIB is used to describe in human readable terms, what that data is and where to find it. On the other hand, snmptranslate is a tool used to parse a given MIB. It parses a local MIB file, and doesn't make any contact with an agent.
Since you mentioned creating a new MIB, I assume your trying to add new functionality to an SNMP agent. To do this, the agent must be extended. If you're using Net-SNMP, there are a few options including compiling new source code into the agent, using a sub-agent, and using external scripts via pass and pass-persist protocol. Take a look at:
http://www.net-snmp.org
http://vincent.bernat.im/en/blog/2012-extending-netsnmp.html
Related
I am running a snmpsimd.py command with a specific ip and port and a data directory.But i am not getting any response?
how to have multiple agents?
When we are specifying data directory how to separates which snmprec file belongs to which agents?
Take a look at snmpsimd startup logging - it should note all data files it finds and which SNMP v1/v2c community corresponds to each of them.
In general, each data file path (relative to the data directory) serves as SNMP community or SNMPv3 context) name.
The documentation should explain that in greater details.
I'm trying to read data off a Cisco Meraki MX84 using SNMP. I can successfully get data from the oids using snmpget and the OSX tool MIBBrowser. The problem I'm having is that the oid is hard to interpret. Is there a command I can run with snmpwalk or using another tool to see the human readable description of each oid?
You need the MIB to get the information about the MIB objects (including their name, meaning, etc). A google search "Cisco Meraki MIB" will give you the answer.
I'm running Zabbix 2.2.5 and I'm trying to create a template with a couple of SNMP items.
I want to setup my template such that it uses the hostname macro within the SNMP OID, however no matter which macro I try and use I can't seem to get Zabbix to correctly resolve it.
An example of the SNMP OID I'm trying to query is:
NET-SNMP-EXTEND-MIB::nsExtendOutputFull.\"racka1-exhaust_temperature\"
Where the parent host of the item has the hostname: racka1.
Where I manually specify the OID already including the hostname as above to test, I successfully return a value.
When I set the OID as follows, I get problems:
NET-SNMP-EXTEND-MIB::nsExtendOutputFull.\"{HOST.NAME1}-exhaust_temperature\"
I've checked through the list of macro's and their usage locations but I can't judge which might cover SNMP OIDs, without looking through the source code.
I've got logging turned up to 4 in an effort to try and understand what is going on however I'm compounded in my testing by Zabbix setting the item to Not Supported and even though this check is set to run every 60 seconds, once I change the OID, I can't get Zabbix to quickly requeue the changed items.
Is it even possible to use a macro in a SNMP OID? If so which should I be using to mirror the hostname?
According to the linked documentation, under "Additional support for user macros" heading it says that user macros (the ones that look like {$MACRO}) are supported in SNMP OID field. However, {HOST.NAME}-like macros are not supported in SNMP OID and this can be confirmed by looking at the source code.
If you wish to have such support, please register a new ZBXNEXT.
I have RFC1628_UPS_MIB (UPS-MIB) and SNMPv2-SMI (SNMPv2-SMI) installed on my system.
I am using net-snmp tool snmptrapd to receive traps.
Traps from my Liebert NPower UPS are being translated through SNMPv2-SMI rather than UPS-MIB as I expect.
I get SNMPv2-SMI::mib-2.33.1.6.3.16 when I am expecting UPS-MIB::upsAlarmFanFailure
Some troubleshooting information:
# snmptranslate -On UPS-MIB::upsAlarmFanFailure
.1.3.6.1.2.1.33.1.6.3.16
# snmptranslate .1.3.6.1.2.1.33.1.6.3.16
SNMPv2-SMI::mib-2.33.1.6.3.16
It seems that both MIBS define the same OID and I lost the coin toss. I am very new to SNMP so I don't expect that I have discovered a flaw in the implementation. Can anybody explain what is happening here or point me to a resource that might?
I am answering my own question.
net-snmp will only use the default set of mibs by default. Adding new mibs to the mibs directory is not enough to get snmptrapd to use the new mib.
The simplest way to get all of the net-snmp tools to see any new mibs added to the mib directory is to add the line mibs ALL to snmp.conf.
My system did not have a default snmp.conf so I created the file /etc/snmp/snmp.conf with the single line mibs ALL
My net-snmp tools including snmptrapd are now able to report the proper oid translations.
Thanks to #LexLi for prompting me to answer my own question.
Thank you nice question and response as well
When someone add enterprise MIB to the standard system MIB. (1.3.6.4.1.#####.1*)
There are most important two steps:
etc/snmp/snmp.conf
mibs: (before) ---> you need to change mibs ALL
Add your mibs to here
/usr/share/snmp/mibs/
After that you must be restart on the system.
and test the command
snmpwalk -v2c -c public address (192.168.1.1)
snmpget -v2c -c public address (192.168.1.1) .1.3.6.1.4.1.#####.1
Keep on going. Well
I wrote simple function for my puppet module. It makes some requests using puppetdb API and I need IP address of puppetdb server. Is there correct way to get settings of connection PuppetMaster to puppetdb to get address of puppetdb server or I should parse puppet.conf by hand?
Parsing puppetdb.conf by hand would be the least desirable way to go about it.
Looking at the code that loads the config, it should be possible to access it using
settings_value = Puppet::Util::Puppetdb.config['main'][setting_name]
for configuration options from the [main] section.
Looking at even more code, you should even be able to use
Puppet::Util::Puppetdb.server
Puppet::Util::Puppetdb.port
I'm not entirely sure whether those APIs are available from parser functions, but it's worth a shot.