Monitor NCache Using SNMP Counters
SNMP, which is short for Simple Network Management Protocol, is considered to be a standard protocol through which different devices on a network communicate and share information with each other.
NCache now provides support for monitoring of its counters using SNMP.
Configure NCache for SNMP Monitoring
You have to follow some steps before you are able to monitor NCache counters using SNMP. These steps are as follows.
Prerequisites
- You need to enable SNMP and metrics publishing on your machine.
- NCache service must be running.
- The cache(s) which you wish to monitor must be up and running.
Configure NCache Service Config
The Alachisoft.NCache.Service.dll.config
config file shipped at %NCHOME%\bin\service allows you to enable and disable cache counter monitoring via SNMP through configurable tags. These tags are as follows:
<add key="NCacheServer.EnableSnmpMonitoring" value="true"/>
<add key="NCacheServer.SnmpListenersInfoPort" value="8256"/>
<add key="NCacheServer.EnableMetricsPublishing" value="true"/>
Important
The value for NCacheServer.EnableMetricsPublishing
tag must be set to True in order to monitor NCache counters using SNMP.
Set
NCacheServer.EnableSnmpMonitoring
tag as True: TheNCacheServer.EnableSnmpMonitoring
tag allows you to enable/disable the monitoring of NCache cache counters via SNMP. This tag is set to False by default.Set the value of
NCacheServer.SnmpListenersInfoPort
tag as True: TheNCacheServer.SnmpListenersInfoPort
tag allows you to configure the port at which SNMP listens to. By default the value of this is set to 8256, but you can change this value as per your requirements.Set
NCacheServer.EnableMetricsPublishing
tag as True: TheNCacheServer.EnableMetricsPublishing
tag is used to enable/disable metrics publishing to NCache service. By default, this tag is set to False.Save Changes: Save the config file and restart the NCache service, cache host process, and client application(s) on all client and server machines for the changes to take effect.
Note
Make sure to restart the NCache service after you have made the respective changes to the service config files
Monitoring Using SNMP
MIB, which is short for Management Information Base is a key component of SNMP. It is a text file where SNMP network elements are described as a list of data objects. Consider the MIB as a dictionary of the SNMP language, where every object that is being referred in an SNMP message must be listed in the MIB. If a network component isn't described in the MIB, it practically doesn't exist.
NCache provides the MIB files for the counters which can be monitored with SNMP. These are shipped at %NCHOME%\bin\resources. The MIB files are as follows:
Important
The alachisoft-metric-listeners.mib
file returns the listening ports for the cache instance on request. If you want to fetch the published counters, you will have to send your requests to the returned cache instance port instead of the SNMP listening port.
alachisoft-metric-listeners.mib
is the main file for SNMP monitoring. It basically informs you about all the ports where the cache, bridge, bridge cache, and client counters are being published. 8255 is the default TCP port for the metrics server.alachisoft-bridge.mib
is used for monitoring the counters of the bridge. The bridge itself is used for the purposes of WAN replication. It contains components like the queue and the replicator queue, etc. For more details on the bridge, click here. The default UDP port range for SNMP bridge listeners is between 13000 - 13999.alachisoft-bridgedcache.mib
is used for monitoring the counters of the bridge cache. The bridge cache refers to the cache that is present inside the bridge itself. The default UDP port range for SNMP bridge cache listeners is between 14000 - 14999.alachisoft-cache.mib
is used for monitoring the counters of the cache. The default UDP port range for SNMP cache listeners is between 11000 - 11999.alachisoft-lucene-cache.mib
is used for monitoring the counters for a Distributed Lucene cache. The default UDP port range for SNMP Distributed Lucene cache listeners is between 11000 - 11999.alachisoft-persistence-cache.mib
is used for monitoring the counters for a Distributed Cache with Persistence. The default UDP port range for SNMP Distributed Cache with Persistence listeners is between 11000 - 11999.alachisoft-client.mib
is used for monitoring the counters of the cache client. The default UDP port range for SNMP client listeners is between 12000 - 12999.
To monitor these cache counters with SNMP you have to load these MIB files into the tool which you are using for monitoring the network or browsing MIB files.
See Also
Cache Counters
Monitor NCache Using Prometheus
Monitor NCache Using Grafana