I hope someone can help me with the following problem I am experiencing with passive checks on NAGIOS Core.
We've started only recently to deploy passive checks so I am not at all experienced in implementing these. It might be I am making a stupid mistake, but we've looked for problems for a while without finding any. Therefore I hope to find someone here that can help me get this up and running.
I have a crontabbed script on the NAGIOS host itself that retrieves the state of a number of internet MPEG streams and looks if they are up or down. The script runs every 10 minutes and, after some processing, drops PROCESS_SERVICE_CHECK_RESULT records in the command file. When I tail the command file (standard location and name) during the time the script runs I see it correctly submitting the commands so everything from running the script, retrieving the info, processing it and writing output into the cmd file apparently is ok:
example of submitted records in the cmd file:
Code: Select all
[1517587415] PROCESS_SERVICE_CHECK_RESULT;Streams;Stream1;2;Stream is OFFLINE
[1517587415] PROCESS_SERVICE_CHECK_RESULT;Streams;Stream2;2;Stream is OFFLINE
[1517587416] PROCESS_SERVICE_CHECK_RESULT;Streams;Stream3;0;Stream is ONLINE
[1517587416] PROCESS_SERVICE_CHECK_RESULT;Streams;Stream4;0;Stream is ONLINE
Code: Select all
define host {
use linux-server
host_name Streams
alias Check Streams
address 127.0.0.1
check_period 24x7
check_command check-host-alive
notification_period 24x7
}
Code: Select all
define service {
use generic-service
host_name Streams
service_description Stream1
active_checks_enabled 0 ; Active service checks are disabled
passive_checks_enabled 1
parallelize_check 1
is_volatile 1
obsess_over_service 0
check_freshness 1 ; Check service 'freshness'
freshness_threshold 4800 ; How fresh must the check be?
check_command gone_stale ; Report staleness
}
Code: Select all
define command {
command_name gone_stale
command_line /usr/lib/nagios/plugins/check_dummy 2 “There hasn’t been an update recently!”
}
switches in nagios.cfg enabled:
Code: Select all
accept_passive_service_checks=1
check_service_freshness=1
- I receive 7 OFFLINE critical submits and around 11 ONLINE.
- Only 3 of those OFFLINE services go critical, the other 4 remain PENDING
- ALL return code 0 services do not change state in the GUI and stay PENDING
- Although the script deposits close to 20 results in the command file the nagios.log only shows 3 out of 7 critical records processed and no Ok records processed.
- Submitting passive check results via the GUI do not seem to adapt the service state to the result entered and check stays on PENDING. The record can be seen in the cmd file but nagios.log doesn't mention any processing of the record. This is both when submitting an Ok or a Critical.
I would like to see NAGIOS set all online (return code 0) services to green/Ok and the offline ones (return code 2) to red/critical. If the state of the service changes NAGIOS should adapt the service color/state. Unfortunately I get neither of those to work.
My thanks in advance for any response! If you need any additional data please let me know!
Best regards, Joost