[Nagiosplug-help] Emulation of traps by NSCA and passive checks doesn't trigger notifications
Ralph.Grothe at itdz-berlin.de
Ralph.Grothe at itdz-berlin.de
Wed Jan 3 14:31:41 CET 2007
Hello,
according to the recommendations in the Nagios documentation
I tried to set up a service that has only passive checks enabled
and is volatile
to catch a trap generated by a virtual host, which is merely a
cluster package,
whenever the package switches or fails over to its adoptive node.
Although the Nagios event.log in the web interface, as well as
the filesystem nagios.log,
do report a pending external command to be in nagios'es command
fifo,
somehow the notifications don't seem to be churned out yet.
Tail from nagios.log:
[1167826389] EXTERNAL COMMAND:
PROCESS_SERVICE_CHECK_RESULT;sms;sms_pkg_state;2;Package sms
halting on cluster node1
[1167826401] HOST ALERT: sms;DOWN;SOFT;1;123.123.123.123 is DOWN
- rta: nan, lost 100%
[1167826412] HOST ALERT: sms;DOWN;SOFT;2;123.123.123.123 is DOWN
- rta: nan, lost 100%
[1167826423] HOST ALERT: sms;DOWN;SOFT;3;123.123.123.123 is DOWN
- rta: nan, lost 100%
[1167826434] HOST ALERT: sms;DOWN;SOFT;4;123.123.123.123 is DOWN
- rta: nan, lost 100%
[1167826446] HOST ALERT: sms;DOWN;HARD;5;123.123.123.123 is DOWN
- rta: nan, lost 100%
[1167826446] SERVICE ALERT:
sms;sms_pkg_state;CRITICAL;HARD;1;Package sms halting on cluster
node1
[1167826567] SERVICE ALERT:
sms;icmp-host-alive;CRITICAL;HARD;1;CRITICAL - 123.123.123.123:
rta nan, lost 100%
This is what this service's definition on the nagios server looks
like:
# Service for testing SMS notifications
define service {
use generic-service
service_description sms_pkg_state
servicegroups groupA_cluster
host_name sms
notification_options c,r
contact_groups nagiosadmin,admin_mobile
max_check_attempts 1
is_volatile 1
active_checks_enabled 0
passive_checks_enabled 1
check_command passive-check-pad
}
N.B. The check_command seems to be a required directive in a
service definition
because nagios -v complains about a missing directive until this
one is provided.
But on the other hand I would say that a check_command is
redundant when only
passive checks are enabled.
That was why I supplied it with this dummy command:
define command {
command_name passive-check-pad
command_line $USER1$/check_dummy 3 "won't do active
checks"
}
In the use-d service template "generic-service" notifications are
enabled
and notification periods or options aren't confined.
$ grep -E notification\|name services_template.cfg
name generic-service
notification_interval 30
notification_period 24x7
notification_options w,u,c,r
notifications_enabled 1
Also both contacts nagiosadmin and admin_mobile are correct and
were tested separetly
to receive notifications.
The nsca daemon on my Nagios server is started by inetd
$ grep nsca /etc/inetd.conf
nsca stream tcp nowait nagios /opt/sw/nagios/bin/nsca
nsca -c /opt/sw/nagios/etc/nsca.cfg --inetd
and inetd is listening on the nsca port
(well, otherwise above messages wouldn't have made it into the
log I would assume)
$ netstat -an|grep 5667
tcp4 0 0 *.5667 *.*
LISTEN
What still puzzles me, are some of the config options of the nsca
daemon.
Is for instance, the allowed_hosts directive of any relevance if
nsca
is spawned by inetd, as in my case?
If so, I guess I would have to add all the hosts which are
expected to feed
external commands by passive checks, which could become quite a
long list.
Therefore I wouldn't consider nsca.cfg an ideal place such a list
of allowed host.
So far I only have the loopback device's IP in it:
$ grep ^[^#] /opt/sw/nagios/etc/nsca.cfg|grep -v password
server_port=5667
allowed_hosts=127.0.0.1
nsca_user=nagios
nsca_group=nagios
debug=1
command_file=/opt/sw/nagios/var/rw/nagios.cmd
alternate_dump_file=/opt/sw/nagios/var/rw/nsca.dump
aggregate_writes=0
append_to_file=0
max_packet_age=30
decryption_method=3
Btw, is nsca.cfg evaluated each time the nsca daemon is spawned
by inetd?
I would hope so, as this would not require me sending inetd a
SIGHUP every
time I make a change to nsca.cfg.
Many thanks for your kind notice.
Regards
Ralph
More information about the Help
mailing list