Hello everyone,
In recent months, I've been working on API integrations and SNMP monitoring. So far, I've been successful in monitoring devices, applications, and workflows reliably, triggering alarms accordingly. Now, I've received a new task where I need to filter a specific line in local log files of an application. Once this line appears, I'm supposed to trigger an alarm in the data miner.
Unfortunately, the log file isn't on any share, and we don't have a central logging tool like Loki, Graylog, etc. Therefore, I thought I could write a PowerShell script to check the log files for new entries, and as soon as the corresponding entry appears, I could trigger an SNMP trap via PowerShell.
The log entry has the following structure:
05.04.2024 14:23:24 105ms Change Trunk Navigator Mode from "Active" to "Undefined !!"
Would this be possible with the Generic Trap Receiver? Unfortunately, I haven't had any experience with SNMP traps so far, and there's a possibility that I might misunderstand something here.
With the command below, an example trap should be triggered:
snmptrap -v 2c -c public $trap_rec 1.3.6.1.4.1.1234.1.0.1 s "Test trap" 1.3.6.1.4.1.1234.2.0.1 i 42
When I execute the command, unfortunately, I don't see anything in the stream viewer, even if I specify the port in the address. Could someone perhaps give me a hint whether I'm on the right track here or if I should look for another solution?
Thank you very much. Christoph
Hi Christoph,
As far as I know, you will not be able to see the SNMP trap through the Stream Viewer.
The connector Generic Trap Receiver should be able to capture the trap. The main parameter that you need to check is the Trap Source IP Address. This parameter should point to the IP address where the trap is being sent.
For debugging purposes, the first thing that you could check is if the trap arrives the server where the DMA is running. You could use Wireshark to capture the traffic and confirm that the SNMP trap arrives the server.
The next step is to check the logging of the SLSNMPManager process. You could check this log file in Cube (System Center -> Logging -> Tab 'DataMiner '-> SNMP Manager. In order to see the traps you will need to override the log levels to 5 (Log Everything). More information can be found in DataMiner Docs (DataMiner logging)
If you are able to see the trap in the log file, then we are sure that the DMA is able to receive successfully the SNMP trap. If the trap is not displayed in the 'Trap table', please check the element log file to troubleshoot trap processing issues.
Hope it helps.
You’re welcome!
Hello Miguel,
Just wanted to drop you a quick note to say thanks for your fantastic input. We’ve decided to go with User Defined APIs for now, as they seem to fit the bill perfectly. Appreciate your support!