John Qualis
John Qualis

Reputation: 1733

nagios passive check configuration

I have written a C++ program which runs on linux and sends snmptraps upon error. The traps are configured using nsca to reach a central linux machine running nagios. The central nagios server has a command configured for passive checks - check_command check_dummy!0 "No Data from passive check". When a trap comes in it is displayed in the servcies section. Then nagios immediately (within 10 seconds) displays "No Data from passive check". The only way then to see the trap is to check the Reports sections for Notifications, Alerts etc. Is there a way to configure nagios so that the received trap is displayed for atleast 2 to 3 minutes? Ideally I would like the trap to be displayed till the next trap is received whenever it may be.

Appreciate any help/pointers.

Upvotes: 0

Views: 2003

Answers (2)

Magnus
Magnus

Reputation: 1

Add the following to your service in services.cfg

check_freshness                1
freshness_threshold            300
check_command check_dummy!0 "No Data from passive check"

This will keep the service show your output for 5 minutes, unless you send the SNMP trap again during that period.

Upvotes: 0

Yeonki
Yeonki

Reputation: 11

Nagios have records like the below during passive checking. Have you checked Nagios.log?

For example, This was my Nagios.log that succeeded passive check:

$ tail /var/log/nagios/nagios.log
[1342862795] EXTERNAL COMMAND: PROCESS_SERVICE_CHECK_RESULT;adserver;CPU Load;0;OK CPU Load ok.|'5m'=0%;80;90 '1m'=1%;80;90 '30s'=3%;80;90
[1342862805] PASSIVE SERVICE CHECK: adserver;CPU Load;0;OK CPU Load ok.
[1342862825] EXTERNAL COMMAND: PROCESS_SERVICE_CHECK_RESULT;adserver;CPU Load;0;OK CPU Load ok.|'5m'=0%;80;90 '1m'=2%;80;90 '30s'=2%;80;90
[1342862835] PASSIVE SERVICE CHECK: adserver;CPU Load;0;OK CPU Load ok.
[1342862855] EXTERNAL COMMAND: PROCESS_SERVICE_CHECK_RESULT;adserver;CPU Load;0;OK CPU Load ok.|'5m'=0%;80;90 '1m'=2%;80;90 '30s'=2%;80;90
[1342862865] PASSIVE SERVICE CHECK: adserver;CPU Load;0;OK CPU Load ok.

Upvotes: 1

Related Questions