Hello,
I have a third party server (server-x) that it receive SNMP-Traps from some hosts and sends the SNMP-Traps to my monitoring system (Nagios XI 5.5.4), I have done below stages:
- Related Mibs has been added in Nagios
- I have added server-x in nagios and passive-check is active and have used command check_dummy for host.
- Also I have activated "SNMP Trap Interface", I have modified trap definition and used " /usr/local/nagios/libexec/check_dummy -H $R 2 "DOWN"" as Exec and severity= Critical.
when a host get down, the status of SNMP-Trap service has been changed to critical but status of host is not changed to down.
I sent a fake trap for test and also I changed Exec line in trap to default value but I had the same problem again.
would you please guide me that how can I change host status via passive check?
SNMP Trap- Host status is not changed
Re: SNMP Trap- Host status is not changed
check_dummy will return whatever value you pass to it no matter what the state of the host really is. You'll want to change the host check to use a different plugin that actually returns the status of the host - for example, use check-host-alive to ping the host's IP.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Re: SNMP Trap- Host status is not changed
Thanks @cdienger for your answer.
I wanted to use SNMP-Trap (passive check), so I didn't use "check-host-alive" command and I created some traps but when I send one of the traps to Nagiosxi from a host, the traps show status of a service of the host , while I do the trap configuration for status of hosts.
I think, I have a mistake in configuration of traps that are related to status of hosts because a host get down, I receive a trap on service that the trap changes status of service not status of host.
would you please guide me how I can configure a trap to change status of a host?
I wanted to use SNMP-Trap (passive check), so I didn't use "check-host-alive" command and I created some traps but when I send one of the traps to Nagiosxi from a host, the traps show status of a service of the host , while I do the trap configuration for status of hosts.
I think, I have a mistake in configuration of traps that are related to status of hosts because a host get down, I receive a trap on service that the trap changes status of service not status of host.
would you please guide me how I can configure a trap to change status of a host?
Re: SNMP Trap- Host status is not changed
A service check will not change the status of a host. The host check will need to be changed to get an accurate status of the host.
Instead of having separate checks for a host and service you could do away with the service check and configure the host check to be a passive check.
Instead of having separate checks for a host and service you could do away with the service check and configure the host check to be a passive check.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Re: SNMP Trap- Host status is not changed
I know a service check will not change the status of a host, because of it, I had configured a trap for host and used a command (check_dummy) to check status of host.
Could you explain me how can I configure the host to check as passive check?
As I have told, I configured it as passive check before but it didn't work.
Could you explain me how can I configure the host to check as passive check?
As I have told, I configured it as passive check before but it didn't work.
Re: SNMP Trap- Host status is not changed
The passive check can be pretty much empty. For example:
Under Manage Templates though, make sure that xiwizard_passive_host is selected and the check will inherit the settings from the template.
The tricky part comes in getting snmp traffic to be recognized as results for a host check instead of a service check. This can be done by setting the "service" to PROCESS_HOST_CHECK_RESULT when calling the snmptraphandling.py script. In the snmptt.conf it would look something like:
EVENT linkUp .1.3.6.1.6.3.1.1.5.4 "Status Events" Normal
FORMAT Link up on interface $1. Admin state: $2. Operational state: $3
EXEC /usr/local/bin/snmptraphandling.py "$r" "PROCESS_HOST_CHECK_RESULT" "$s" "$@" "$-*" "Link up on interface $1. Admin state: $2. Operational state: $3"
SDESC
A linkUp trap signifies that the SNMP entity, acting in an
agent role, has detected that the ifOperStatus object for
one of its communication links left the down state and
transitioned into some other state (but not into the
notPresent state). This other state is indicated by the
included value of ifOperStatus.
EDESC
Under Manage Templates though, make sure that xiwizard_passive_host is selected and the check will inherit the settings from the template.
The tricky part comes in getting snmp traffic to be recognized as results for a host check instead of a service check. This can be done by setting the "service" to PROCESS_HOST_CHECK_RESULT when calling the snmptraphandling.py script. In the snmptt.conf it would look something like:
EVENT linkUp .1.3.6.1.6.3.1.1.5.4 "Status Events" Normal
FORMAT Link up on interface $1. Admin state: $2. Operational state: $3
EXEC /usr/local/bin/snmptraphandling.py "$r" "PROCESS_HOST_CHECK_RESULT" "$s" "$@" "$-*" "Link up on interface $1. Admin state: $2. Operational state: $3"
SDESC
A linkUp trap signifies that the SNMP entity, acting in an
agent role, has detected that the ifOperStatus object for
one of its communication links left the down state and
transitioned into some other state (but not into the
notPresent state). This other state is indicated by the
included value of ifOperStatus.
EDESC
You do not have the required permissions to view the files attached to this post.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Re: SNMP Trap- Host status is not changed
it's appreciated. It worked, I could change the host status to reachable by the way but I don't know why the status of the host is not changed to Down yet.
Re: SNMP Trap- Host status is not changed
Set the freshness threshold on the host's "Check Settings" tab. Once this threshold is met, the "check_dummy" command will run. Note that the template causes check_dummy to return OK with a message that no data has been received. You can set it to critical by changing the template or configuring the check_dummy plugin on the host's "General Settings" tab.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.