SNMP Trap Difficulty

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
jeremyindenver
Posts: 1
Joined: Tue Mar 30, 2021 1:14 pm

SNMP Trap Difficulty

Post by jeremyindenver »

I'm a Nagios newb trying to setup my Nagios Core server on Centos 7 to receive traps from my APC UPS. Looking for some insight as I'm stuck. Here is what I'm seeing in /usr/local/nagios/var/nagios.log

Code: Select all

[1617374188] Warning:  Passive check result was received for service 'SNMP Traps' on host 'apcUPS', but the service could not be found!
[1617374188] Error: External command failed -> PROCESS_SERVICE_CHECK_RESULT;apcUPS;SNMP Traps;0;APC UPS: Utility power restored: Returned from battery backup power; utility power restored. / mtrapargsString.0 (OCTETSTR):UPS: No longer on battery power.
[1617374188] External command [1617374186] PROCESS_SERVICE_CHECK_RESULT;apcUPS;SNMP Traps;0;APC UPS: Utility power restored: Returned from battery backup power; utility power restored. / mtrapargsString.0 (OCTETSTR):UPS: No longer on battery power. returned error Command failed
Would appreciate some next step suggestions on troubleshooting.

- Jeremy
User avatar
mcapra
Posts: 3739
Joined: Thu May 05, 2016 3:54 pm

Re: SNMP Trap Difficulty

Post by mcapra »

Could you describe how you went about configuring Nagios Core to accept SNMP traps? The specifics are relevant to the answer. Presumably you're doing some translation of those traps into Nagios Core check results. Most people are using NSTI for this.

I suspect this is your problem:

Code: Select all

Passive check result was received for service 'SNMP Traps' on host 'apcUPS', but the service could not be found!
Nagios Core is trying to map a particular SNMP trap, received as a passive check result, to a service named "SNMP Traps" associated with host "apcUPS", and one or both of those things do not exist. The PROCESS_SERVICE_CHECK_RESULT external command, which is what your SNMP traps are being translated into, expects both the host_name and service_description you pass it to be tied to a real-deal Nagios service definition.

So if you don't have a service definition that looks something like this:

Code: Select all


define service{
...
    host_name    apcUPS
    service_description    SNMP Traps
...
}
You're gonna see that error.
Former Nagios employee
https://www.mcapra.com/
Locked