so, i think i've done some advance
maybe it's ok that files in checkresults are results and thats the reason they dont stay in that directory? and nagios work with this results and moving them to others files?
i've change my service description to "memoria" so its more easy to search in files.
when ncpa sends messages to my nagios server it put the messages on checkresults directory.
when execute grep -r memoria /usr/local/nagios
first is the log who is telling me that "memoria" don't receivie any passive_check so it will execute dummy check
/usr/local/nagios/var/nagios.log:[1455761533] Warning: The results of service 'memoria' on host '192.168.56.1' are stale by 0d 0h 1m 0s (threshold=0d 0h 8m 0s). I'm forcing an immediate check of the service.
again log showing dummy check
/usr/local/nagios/var/nagios.log:[1455761533] SERVICE ALERT: 192.168.56.1;memoria;CRITICAL;SOFT;1;CRITICAL: CRITICAL: No se han recibido resultados en tiempo
/usr/local/nagios/var/objects.precache: service_description memoria
/usr/local/nagios/var/objects.cache: service_description memoria
both files shows
Code: Select all
define service {
host_name 192.168.56.1
service_description memoria
check_period 24x7
check_command sin_resultados
contact_groups admins
notification_period 24x7
initial_state o
importance 0
check_interval 10.000000
retry_interval 2.000000
max_check_attempts 3
is_volatile 1
parallelize_check 1
active_checks_enabled 0
passive_checks_enabled 1
obsess 0
event_handler_enabled 1
low_flap_threshold 0.000000
high_flap_threshold 0.000000
flap_detection_enabled 1
flap_detection_options a
freshness_threshold 480
check_freshness 1
notification_options r,w,u,c
notifications_enabled 1
notification_interval 60.000000
first_notification_delay 0.000000
stalking_options n
process_perf_data 1
notes_url /webcip/doc/doc.php?title=$HOSTNAME$_$SERVICEDESC$
retain_status_information 1
retain_nonstatus_information 1
}
/usr/local/nagios/var/status.dat: service_description=memoria
Code: Select all
servicestatus {
host_name=192.168.56.1
service_description=memoria
modified_attributes=0
check_command=sin_resultados
check_period=24x7
notification_period=24x7
check_interval=10.000000
retry_interval=2.000000
event_handler=
has_been_checked=1
should_be_scheduled=0
check_execution_time=0.002
check_latency=0.070
check_type=0
current_state=2
last_hard_state=0
last_event_id=0
current_event_id=107
current_problem_id=37
last_problem_id=0
current_attempt=1
max_attempts=3
state_type=0
last_state_change=1455761533
last_hard_state_change=1455761533
last_time_ok=1455761533
last_time_warning=0
last_time_unknown=0
last_time_critical=0
plugin_output=CRITICAL: CRITICAL: No se han recibido resultados en tiempo
long_plugin_output=
performance_data=
last_check=1455761533
next_check=1455761653
check_options=0
current_notification_number=0
current_notification_id=0
last_notification=0
next_notification=0
no_more_notifications=0
notifications_enabled=1
active_checks_enabled=0
passive_checks_enabled=1
event_handler_enabled=1
problem_has_been_acknowledged=0
acknowledgement_type=0
flap_detection_enabled=1
process_performance_data=1
obsess=0
last_update=1455762012
is_flapping=0
percent_state_change=0.00
scheduled_downtime_depth=0
}
/usr/local/nagios/var/nagios.tmpHxiQfe: service_description=memoria
No such file or directory
/usr/local/nagios/etc/objects/mipc.cfg: service_description memoria
define service{
use generic-service
host_name 192.168.56.1
service_description memoria
check_command sin_resultados
passive_checks_enabled 1
active_checks_enabled 0
check_freshness 2
freshness_threshold 480
is_volatile 1
parallelize_check 1
obsess_over_service 0
}
i don't unerstand exactly how this work but it didn't look like there is anything wrong...
and if i submit a passive check results from the nagios cgi it works ok.
[root@localhost nagios]# grep -r test_check_result /usr/local/nagios
/usr/local/nagios/var/nagios.log:[1455762716] EXTERNAL COMMAND: PROCESS_SERVICE_CHECK_RESULT;192.168.56.1;memoria;0;test_check_result|
/usr/local/nagios/var/nagios.log:[1455762716] PASSIVE SERVICE CHECK: 192.168.56.1;memoria;0;test_check_result
/usr/local/nagios/var/status.dat: plugin_output=test_check_result
but i don't get the same result when search for the passive check sended from ncpa
read in some forum that status.dat must be nagios:apache (actually nagios:nagios) but don't known where configure that since status.dat is removed when nagios restarted so i've added user apache to group nagios but still can't receive passive check.