[naemon-users] Naemon not executing notification commands
Vytenis A
vytenis.adm at gmail.com
Wed Jun 15 12:06:17 CEST 2016
Hi List,
I have freshly installed Naemon:
# rpm -qa|grep naemon
naemon-livestatus-1.0.4-1.el7.centos.x86_64
naemon-core-dbg-1.0.4-1.el7.centos.x86_64
libnaemon-1.0.4-1.el7.centos.x86_64
naemon-tools-1.0.4-1.el7.centos.x86_64
naemon-thruk-1.0.4-1.el7.centos.x86_64
naemon-devel-1.0.4-1.el7.centos.x86_64
naemon-debuginfo-1.0.4-1.el7.centos.x86_64
naemon-core-1.0.4-1.el7.centos.x86_64
naemon-1.0.4-1.el7.centos.x86_64
# cat /etc/redhat-release
CentOS Linux release 7.2.1511 (Core)
Running in a ProxMox VM, installed from netinst with Minimal setup, with
There are no pending updates.
The problem is weird - looks like notification commands are not
executed at all. Debug log shows:
[1465984748.476336] [2320.2] [pid=13604] Raw Command Input:
/usr/bin/echo works > /tmp/debug
[1465984748.476364] [2320.2] [pid=13604] Expanded Command Output:
/usr/bin/echo works > /tmp/debug
[1465984748.476378] [032.2] [pid=13604] Raw notification command:
/usr/bin/echo works > /tmp/debug
[1465984748.476391] [2048.1] [pid=13604] **** BEGIN MACRO PROCESSING ***********
[1465984748.476404] [2048.1] [pid=13604] Processing: '/usr/bin/echo
works > /tmp/debug'
[1465984748.476418] [2048.2] [pid=13604] Processing part:
'/usr/bin/echo works > /tmp/debug'
[1465984748.476432] [2048.2] [pid=13604] Not currently in macro.
Running output (32): '/usr/bin/echo works > /tmp/debug'
[1465984748.476446] [2048.1] [pid=13604] Done. Final output:
'/usr/bin/echo works > /tmp/debug'
[1465984748.476459] [2048.1] [pid=13604] **** END MACRO PROCESSING *************
[1465984748.476473] [032.2] [pid=13604] Processed notification
command: /usr/bin/echo works > /tmp/debug
# ls /tmp/debug
ls: cannot access /tmp/debug: No such file or directory
Tried /bin/false, /bin/asdasfasdfasdfasdf - no errors, no result.
Could it be related to this?: https://github.com/naemon/naemon-core/issues/138
Even doing strace -p `cat /var/run/naemon/naemon.pid` makes naemon to exit.
Any help or debug path would be highly appreciated.
My configuration:
# cat naemon.cfg
log_file=/var/log/naemon/naemon.log
cfg_dir=/etc/naemon/conf.d
object_cache_file=/var/lib/naemon/objects.cache
precached_object_file=/var/lib/naemon/objects.precache
resource_file=/etc/naemon/resource.cfg
status_file=/var/lib/naemon/status.dat
status_update_interval=10
check_external_commands=1
command_file=/var/lib/naemon/naemon.cmd
lock_file=/var/run/naemon/naemon.pid
temp_file=/var/lib/naemon/naemon.tmp
temp_path=/var/cache/naemon
event_broker_options=-1
include_dir=module-conf.d
log_archive_path=/var/log/naemon/archives
use_syslog=0
log_notifications=1
enable_notification_suppression_reason_logging=1
log_service_retries=1
log_host_retries=1
log_event_handlers=1
log_initial_states=0
log_current_states=1
log_external_commands=1
log_passive_checks=1
max_concurrent_checks=0
cached_host_check_horizon=15
cached_service_check_horizon=15
enable_predictive_host_dependency_checks=1
enable_predictive_service_dependency_checks=1
soft_state_dependencies=0
service_check_timeout=60
host_check_timeout=30
event_handler_timeout=30
notification_timeout=30
ocsp_timeout=5
perfdata_timeout=5
retain_state_information=1
state_retention_file=/var/lib/naemon/retention.dat
retention_update_interval=60
use_retained_program_state=1
use_retained_scheduling_info=1
retained_host_attribute_mask=0
retained_service_attribute_mask=0
retained_process_host_attribute_mask=0
retained_process_service_attribute_mask=0
retained_contact_host_attribute_mask=0
retained_contact_service_attribute_mask=0
interval_length=60
use_aggressive_host_checking=0
execute_service_checks=1
accept_passive_service_checks=0
execute_host_checks=1
accept_passive_host_checks=1
enable_notifications=1
enable_event_handlers=1
process_performance_data=1
obsess_over_services=0
obsess_over_hosts=0
translate_passive_host_checks=0
passive_host_checks_are_soft=0
check_for_orphaned_services=1
check_for_orphaned_hosts=1
check_service_freshness=1
service_freshness_check_interval=60
service_check_timeout_state=c
check_host_freshness=0
host_freshness_check_interval=60
additional_freshness_latency=15
enable_flap_detection=0
low_service_flap_threshold=5.0
high_service_flap_threshold=20.0
low_host_flap_threshold=5.0
high_host_flap_threshold=20.0
date_format=iso8601
use_timezone=Europe/Vilnius
illegal_object_name_chars=`~!$%^&*|'"<>?,()=
illegal_macro_output_chars=`~$&|'"<>
use_regexp_matching=0
use_true_regexp_matching=0
admin_email=naemon at localhost
admin_pager=pagenaemon at localhost
debug_level=-1
debug_verbosity=2
debug_file=/var/lib/naemon/naemon.debug
max_debug_file_size=1000000
allow_empty_hostgroup_assignment=0
#
# service performance data
#
service_perfdata_file=/usr/local/pnp4nagios/var/service-perfdata
service_perfdata_file_template=DATATYPE::SERVICEPERFDATA\tTIMET::$TIMET$\tHOSTNAME::$HOSTNAME$\tSERVICEDESC::$SERVICEDESC$\tSERVICEPERFDATA::$SERVICEPERFDATA$\tSERVICECHECKCOMMAND::$SERVICECHECKCOMMAND$\tHOSTSTATE::$HOSTSTATE$\tHOSTSTATETYPE::$HOSTSTATETYPE$\tSERVICESTATE::$SERVICESTATE$\tSERVICESTATETYPE::$SERVICESTATETYPE$
service_perfdata_file_mode=a
service_perfdata_file_processing_interval=15
service_perfdata_file_processing_command=process-service-perfdata-file
#
#
#
host_perfdata_file=/usr/local/pnp4nagios/var/host-perfdata
host_perfdata_file_template=DATATYPE::HOSTPERFDATA\tTIMET::$TIMET$\tHOSTNAME::$HOSTNAME$\tHOSTPERFDATA::$HOSTPERFDATA$\tHOSTCHECKCOMMAND::$HOSTCHECKCOMMAND$\tHOSTSTATE::$HOSTSTATE$\tHOSTSTATETYPE::$HOSTSTATETYPE$
host_perfdata_file_mode=a
host_perfdata_file_processing_interval=15
host_perfdata_file_processing_command=process-host-perfdata-file
# cat /var/lib/naemon/objects.cache
########################################
# NAGIOS OBJECT CACHE FILE
#
# THIS FILE IS AUTOMATICALLY GENERATED
# BY NAGIOS. DO NOT MODIFY THIS FILE!
#
# Created: Wed Jun 15 12:56:31 2016
########################################
define timeperiod {
timeperiod_name 24x7
alias 24 Hours A Day, 7 Days A Week
sunday 00:00-24:00
monday 00:00-24:00
tuesday 00:00-24:00
wednesday 00:00-24:00
thursday 00:00-24:00
friday 00:00-24:00
saturday 00:00-24:00
}
define timeperiod {
timeperiod_name 24x7_sans_holidays
alias 24x7 Sans Holidays
july 4 00:00-00:00
january 1 00:00-00:00
december 25 00:00-00:00
thursday 4 november 00:00-00:00
monday 1 september 00:00-00:00
monday -1 may 00:00-00:00
sunday 00:00-24:00
monday 00:00-24:00
tuesday 00:00-24:00
wednesday 00:00-24:00
thursday 00:00-24:00
friday 00:00-24:00
saturday 00:00-24:00
}
define timeperiod {
timeperiod_name none
alias No Time Is A Good Time
}
define timeperiod {
timeperiod_name us-holidays
alias U.S. Holidays
december 25 00:00-00:00
january 1 00:00-00:00
july 4 00:00-00:00
monday -1 may 00:00-00:00
monday 1 september 00:00-00:00
thursday 4 november 00:00-00:00
}
define timeperiod {
timeperiod_name workhours
alias Normal Work Hours
monday 09:00-17:00
tuesday 09:00-17:00
wednesday 09:00-17:00
thursday 09:00-17:00
friday 09:00-17:00
}
define command {
command_name check-host-alive
command_line $USER1$/check_ping -H $HOSTADDRESS$ -w 3000.0,80%
-c 5000.0,100% -p 5
}
define command {
command_name check_dhcp
command_line $USER1$/check_dhcp $ARG1$
}
define command {
command_name check_ftp
command_line $USER1$/check_ftp -H $HOSTADDRESS$ $ARG1$
}
define command {
command_name check_hpjd
command_line $USER1$/check_hpjd -H $HOSTADDRESS$ $ARG1$
}
define command {
command_name check_http
command_line $USER1$/check_http -I $HOSTADDRESS$ -H $ARG1$ -s $ARG2$
}
define command {
command_name check_https
command_line $USER1$/check_http -I $HOSTADDRESS$ -H $ARG1$ -s
$ARG2$ --ssl
}
define command {
command_name check_imap
command_line $USER1$/check_imap -H $HOSTADDRESS$ $ARG1$
}
define command {
command_name check_nrpe
command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -c $ARG1$
}
define command {
command_name check_nt
command_line $USER1$/check_nt -H $HOSTADDRESS$ -p 12489 -v $ARG1$ $ARG2$
}
define command {
command_name check_ntp
command_line $USER1$/check_ntp -w 2 -c 10 -H $HOSTADDRESS$
}
define command {
command_name check_ping
command_line $USER1$/check_ping -H $HOSTADDRESS$ -w $ARG1$ -c $ARG2$ -p 5
}
define command {
command_name check_pop
command_line $USER1$/check_pop -H $HOSTADDRESS$ $ARG1$
}
define command {
command_name check_smtp
command_line $USER1$/check_smtp -H $HOSTADDRESS$ $ARG1$
}
define command {
command_name check_snmp
command_line $USER1$/check_snmp -H $HOSTADDRESS$ $ARG1$
}
define command {
command_name check_ssh
command_line $USER1$/check_ssh $ARG1$ $HOSTADDRESS$
}
define command {
command_name check_ssl_certificate_expiration
command_line $USER1$/check_http -I $HOSTADDRESS$ -H $ARG1$ -C 30,14
}
define command {
command_name check_tcp
command_line $USER1$/check_tcp -H $HOSTADDRESS$ -p $ARG1$ $ARG2$
}
define command {
command_name check_udp
command_line $USER1$/check_udp -H $HOSTADDRESS$ -p $ARG1$ $ARG2$
}
define command {
command_name notify-host-by-email
command_line /usr/bin/printf "%b" "***** Naemon
*****\n\nNotification Type: $NOTIFICATIONTYPE$\nHost:
$HOSTNAME$\nState: $HOSTSTATE$\nAddress: $HOSTADDRESS$\nInfo:
$HOSTOUTPUT$\n\nDate/Time: $LONGDATETIME$\n" | /usr/bin/mail -s "**
$NOTIFICATIONTYPE$ Host Alert: $HOSTNAME$ is $HOSTSTATE$ **"
$CONTACTEMAIL$
}
define command {
command_name notify-service-by-email
command_line /usr/bin/echo works > /tmp/debug
}
define command {
command_name process-host-perfdata-file
command_line /bin/mv /usr/local/pnp4nagios/var/host-perfdata
/usr/local/pnp4nagios/var/spool/host-perfdata.$TIMET$
}
define command {
command_name process-service-perfdata-file
command_line /bin/mv /usr/local/pnp4nagios/var/service-perfdata
/usr/local/pnp4nagios/var/spool/service-perfdata.$TIMET$
}
define command {
command_name testas
command_line /bin/false
}
define contactgroup {
contactgroup_name admins
alias Naemon Administrators
members vytenis.adm
}
define contact {
contact_name vytenis.adm
alias Vytenis Adm
service_notification_period 24x7
host_notification_period 24x7
service_notification_options r,w,u,c,f,s
host_notification_options r,d,u,f,s
service_notification_commands testas,notify-service-by-email
host_notification_commands notify-host-by-email
email vytenis.adm at gmail.com
minimum_value 1
host_notifications_enabled 1
service_notifications_enabled 1
can_submit_commands 1
retain_status_information 1
retain_nonstatus_information 1
}
define host {
host_name web1.example.com
alias web1.example.com
address 192.168.80.68
check_period 24x7
check_command check-host-alive
contact_groups admins
notification_period workhours
initial_state o
hourly_value 1
check_interval 5.000000
retry_interval 1.000000
max_check_attempts 10
active_checks_enabled 1
passive_checks_enabled 1
obsess 1
event_handler_enabled 1
low_flap_threshold 0.000000
high_flap_threshold 0.000000
flap_detection_enabled 0
flap_detection_options a
freshness_threshold 0
check_freshness 0
notification_options r,d,u
notifications_enabled 1
notification_interval 120.000000
first_notification_delay 0.000000
stalking_options n
process_perf_data 1
action_url
/pnp4nagios/index.php/graph?host=$HOSTNAME$&srv=_HOST_' class='tips'
rel='/pnp4nagios/index.php/popup?host=$HOSTNAME$&srv=_HOST_
retain_status_information 1
retain_nonstatus_information 1
}
define service {
host_name web1.example.com
service_description DISK
check_period 24x7
check_command check_nrpe!check_disk
contact_groups admins
notification_period 24x7
initial_state o
hourly_value 1
check_interval 5.000000
retry_interval 2.000000
max_check_attempts 3
is_volatile 1
active_checks_enabled 1
passive_checks_enabled 0
obsess 0
event_handler_enabled 1
low_flap_threshold 0.000000
high_flap_threshold 0.000000
flap_detection_enabled 0
flap_detection_options a
freshness_threshold 0
check_freshness 0
notification_options r,w,u,c
notifications_enabled 1
notification_interval 10.000000
first_notification_delay 0.000000
stalking_options n
process_perf_data 1
action_url
/pnp4nagios/index.php/graph?host=$HOSTNAME$&srv=$SERVICEDESC$'
class='tips' rel='/pnp4nagios/index.php/popup?host=$HOSTNAME$&srv=$SERVICEDESC$
retain_status_information 1
retain_nonstatus_information 1
}
define service {
host_name web1.example.com
service_description HTTPS
check_period 24x7
check_command check_https!cs.example.com!Kayako
contact_groups admins
notification_period 24x7
initial_state o
hourly_value 1
check_interval 5.000000
retry_interval 2.000000
max_check_attempts 3
is_volatile 1
active_checks_enabled 1
passive_checks_enabled 0
obsess 0
event_handler_enabled 1
low_flap_threshold 0.000000
high_flap_threshold 0.000000
flap_detection_enabled 0
flap_detection_options a
freshness_threshold 0
check_freshness 0
notification_options r,w,u,c
notifications_enabled 1
notification_interval 10.000000
first_notification_delay 0.000000
stalking_options n
process_perf_data 1
action_url
/pnp4nagios/index.php/graph?host=$HOSTNAME$&srv=$SERVICEDESC$'
class='tips' rel='/pnp4nagios/index.php/popup?host=$HOSTNAME$&srv=$SERVICEDESC$
retain_status_information 1
retain_nonstatus_information 1
}
define service {
host_name web1.example.com
service_description HTTPS certificate expiration
check_period 24x7
check_command check_ssl_certificate_expiration!cs.example.com
contact_groups admins
notification_period 24x7
initial_state o
hourly_value 1
check_interval 5.000000
retry_interval 2.000000
max_check_attempts 3
is_volatile 1
active_checks_enabled 1
passive_checks_enabled 0
obsess 0
event_handler_enabled 1
low_flap_threshold 0.000000
high_flap_threshold 0.000000
flap_detection_enabled 0
flap_detection_options a
freshness_threshold 0
check_freshness 0
notification_options r,w,u,c
notifications_enabled 1
notification_interval 10.000000
first_notification_delay 0.000000
stalking_options n
process_perf_data 1
action_url
/pnp4nagios/index.php/graph?host=$HOSTNAME$&srv=$SERVICEDESC$'
class='tips' rel='/pnp4nagios/index.php/popup?host=$HOSTNAME$&srv=$SERVICEDESC$
retain_status_information 1
retain_nonstatus_information 1
}
define service {
host_name web1.example.com
service_description LOAD
check_period 24x7
check_command check_nrpe!check_load
contact_groups admins
notification_period 24x7
initial_state o
hourly_value 1
check_interval 5.000000
retry_interval 2.000000
max_check_attempts 3
is_volatile 1
active_checks_enabled 1
passive_checks_enabled 0
obsess 0
event_handler_enabled 1
low_flap_threshold 0.000000
high_flap_threshold 0.000000
flap_detection_enabled 0
flap_detection_options a
freshness_threshold 0
check_freshness 0
notification_options r,w,u,c
notifications_enabled 1
notification_interval 10.000000
first_notification_delay 0.000000
stalking_options n
process_perf_data 1
action_url
/pnp4nagios/index.php/graph?host=$HOSTNAME$&srv=$SERVICEDESC$'
class='tips' rel='/pnp4nagios/index.php/popup?host=$HOSTNAME$&srv=$SERVICEDESC$
retain_status_information 1
retain_nonstatus_information 1
}
define service {
host_name web1.example.com
service_description NTP
check_period 24x7
check_command check_ntp
contact_groups admins
notification_period 24x7
initial_state o
hourly_value 1
check_interval 5.000000
retry_interval 2.000000
max_check_attempts 3
is_volatile 1
active_checks_enabled 1
passive_checks_enabled 0
obsess 0
event_handler_enabled 1
low_flap_threshold 0.000000
high_flap_threshold 0.000000
flap_detection_enabled 0
flap_detection_options a
freshness_threshold 0
check_freshness 0
notification_options r,w,u,c
notifications_enabled 1
notification_interval 10.000000
first_notification_delay 0.000000
stalking_options n
process_perf_data 1
action_url
/pnp4nagios/index.php/graph?host=$HOSTNAME$&srv=$SERVICEDESC$'
class='tips' rel='/pnp4nagios/index.php/popup?host=$HOSTNAME$&srv=$SERVICEDESC$
retain_status_information 1
retain_nonstatus_information 1
}
define service {
host_name web1.example.com
service_description SMTP
check_period 24x7
check_command check_smtp
contact_groups admins
notification_period 24x7
initial_state o
hourly_value 1
check_interval 5.000000
retry_interval 2.000000
max_check_attempts 3
is_volatile 1
active_checks_enabled 1
passive_checks_enabled 0
obsess 0
event_handler_enabled 1
low_flap_threshold 0.000000
high_flap_threshold 0.000000
flap_detection_enabled 0
flap_detection_options a
freshness_threshold 0
check_freshness 0
notification_options r,w,u,c
notifications_enabled 1
notification_interval 10.000000
first_notification_delay 0.000000
stalking_options n
process_perf_data 1
action_url
/pnp4nagios/index.php/graph?host=$HOSTNAME$&srv=$SERVICEDESC$'
class='tips' rel='/pnp4nagios/index.php/popup?host=$HOSTNAME$&srv=$SERVICEDESC$
retain_status_information 1
retain_nonstatus_information 1
}
define service {
host_name web1.example.com
service_description SSH
check_period 24x7
check_command check_ssh
contact_groups admins
notification_period 24x7
initial_state o
hourly_value 1
check_interval 5.000000
retry_interval 2.000000
max_check_attempts 3
is_volatile 1
active_checks_enabled 1
passive_checks_enabled 0
obsess 0
event_handler_enabled 1
low_flap_threshold 0.000000
high_flap_threshold 0.000000
flap_detection_enabled 0
flap_detection_options a
freshness_threshold 0
check_freshness 0
notification_options r,w,u,c
notifications_enabled 1
notification_interval 10.000000
first_notification_delay 0.000000
stalking_options n
process_perf_data 1
action_url
/pnp4nagios/index.php/graph?host=$HOSTNAME$&srv=$SERVICEDESC$'
class='tips' rel='/pnp4nagios/index.php/popup?host=$HOSTNAME$&srv=$SERVICEDESC$
retain_status_information 1
retain_nonstatus_information 1
}
define service {
host_name web1.example.com
service_description SWAP
check_period 24x7
check_command check_nrpe!check_swap
contact_groups admins
notification_period 24x7
initial_state o
hourly_value 1
check_interval 5.000000
retry_interval 2.000000
max_check_attempts 3
is_volatile 1
active_checks_enabled 1
passive_checks_enabled 0
obsess 0
event_handler_enabled 1
low_flap_threshold 0.000000
high_flap_threshold 0.000000
flap_detection_enabled 0
flap_detection_options a
freshness_threshold 0
check_freshness 0
notification_options r,w,u,c
notifications_enabled 1
notification_interval 10.000000
first_notification_delay 0.000000
stalking_options n
process_perf_data 1
action_url
/pnp4nagios/index.php/graph?host=$HOSTNAME$&srv=$SERVICEDESC$'
class='tips' rel='/pnp4nagios/index.php/popup?host=$HOSTNAME$&srv=$SERVICEDESC$
retain_status_information 1
retain_nonstatus_information 1
}
define service {
host_name web1.example.com
service_description Traffic - PPS
check_period 24x7
check_command check_nrpe!check_traffic
contact_groups admins
notification_period 24x7
initial_state o
hourly_value 1
check_interval 5.000000
retry_interval 2.000000
max_check_attempts 3
is_volatile 1
active_checks_enabled 1
passive_checks_enabled 0
obsess 0
event_handler_enabled 1
low_flap_threshold 0.000000
high_flap_threshold 0.000000
flap_detection_enabled 0
flap_detection_options a
freshness_threshold 0
check_freshness 0
notification_options r,w,u,c
notifications_enabled 1
notification_interval 10.000000
first_notification_delay 0.000000
stalking_options n
process_perf_data 1
action_url
/pnp4nagios/index.php/graph?host=$HOSTNAME$&srv=$SERVICEDESC$'
class='tips' rel='/pnp4nagios/index.php/popup?host=$HOSTNAME$&srv=$SERVICEDESC$
retain_status_information 1
retain_nonstatus_information 1
}
define service {
host_name web1.example.com
service_description UPDATES
check_period 24x7
check_command check_nrpe!check_updates
contact_groups admins
notification_period 24x7
initial_state o
hourly_value 1
check_interval 1.000000
retry_interval 2.000000
max_check_attempts 3
is_volatile 1
active_checks_enabled 1
passive_checks_enabled 0
obsess 0
event_handler_enabled 1
low_flap_threshold 0.000000
high_flap_threshold 0.000000
flap_detection_enabled 0
flap_detection_options a
freshness_threshold 0
check_freshness 0
notification_options r,w,u,c
notifications_enabled 1
notification_interval 1.000000
first_notification_delay 0.000000
stalking_options n
process_perf_data 1
action_url
/pnp4nagios/index.php/graph?host=$HOSTNAME$&srv=$SERVICEDESC$'
class='tips' rel='/pnp4nagios/index.php/popup?host=$HOSTNAME$&srv=$SERVICEDESC$
retain_status_information 1
retain_nonstatus_information 1
}
--
Vytenis
More information about the Naemon-users
mailing list