Passive Checks via NSCA -- Excedrin Headache Vat Numero Uno

John Fox jjf at mind.net
Tue Oct 1 20:49:38 CEST 2002


Before launching into my problem: Giant thanks to all of you on
this list who've helped me thus far.  Your efforts are very much
appreciated!

I am experimenting with passive services and NSCA, and it is driving me nuts!

I'm not sure what details are important to anyone trying to figure this
out, so I'm including a lot of text in this message.

First of all, here are the template and definition for the host I'm doing
this on:

define host{
        name                            generic-host    ; Template name - used in other host definitions
        notifications_enabled           1       ; Host notifications are enabled
        event_handler_enabled           1       ; Host event handler is enabled
        flap_detection_enabled          1       ; Flap detection is enabled
        process_perf_data               1       ; Process performance data
        retain_status_information       1       ; Retain status information across program restarts
        retain_nonstatus_information    1       ; Retain non-status information across program restarts
        register                        0       ; DONT REGISTER THIS DEFINITION - ITS NOT A REAL HOST, JUST A TEMPLATE!
}



##
## Testing with morpheus
##

define host{
        use                     generic-host
        host_name               foo.bar.baz
        alias                   foo.bar.baz
        address                 206.101.72.12
        max_check_attempts      3
        notification_interval   5 
        notification_period     24x7
        notification_options    d,u,r
}

------------------

And here is the template and definition for the service:

define service{
        name                            disk-template   ; Template 'name' - referenced in other service definitions
        active_checks_enabled           0       ; Active service checks are disabled
        passive_checks_enabled          1       ; Passive service checks are enabled
        parallelize_check               1       ; Active service checks should be parallelized (recommeneded)
        obsess_over_service             1       ; We should obsess over this service (if necessary)
        check_freshness                 0       ; Default is to NOT check service 'freshness'
        freshness_threshold             180     ; Status should be updated every three minutes
        notifications_enabled           1       ; Service notifications are enabled
        event_handler_enabled           0       ; Service event handler is enabled
        flap_detection_enabled          1       ; Flap detection is enabled
        process_perf_data               1       ; Process performance data
        retain_status_information       1       ; Retain status information across program restarts
        retain_nonstatus_information    1       ; Retain non-status information across program restarts
        max_check_attempts              3
        normal_check_interval           3
        retry_check_interval            3 
        check_period                    24x7
        notification_interval           3
        notification_period             24x7
        notification_options            w,c,r,u
        contact_groups                  systems
        register                        0       ; Don't register -- it's a template, dummy!
}

# Disk usage
define service{
        use                     disk-template
        host_name               foo.bar.baz
        service_description     disk-/
        check_command           stale-service-alert
        }

------------------

Because I am using send_nsca on foo.bar.baz, I have wrapped 'df' and parsed its
output.  I take these results and pipe them to send_nsca.  My fields are tab-separated,
and each record looks like this:

         foo.bar.baz       disk-/  1       57% utilization

According to send_nsca, the fields stand for:

         <hostname>\t<svc. description>\t<return code>\t<plugin output>\n

where '\t' is a TAB and '\n' is a newline character.

And it seems to me that I've conformed to this requirement.

I then open a pipe to send nsca using the following command line

'/usr/local/sbin/send_nsca nagios.bar.baz -c /usr/local/etc/nagios/send_nsca.cfg'

and then write the status record to the pipe on STDOUT.

Again, this seems to be the prescribed method.

When I run my wrapper script, it tells me "1 data packet(s) sent to host successfully."
which certainly sound positive.

The problem is that the service never gets out of "PENDING" status.  In the Service Detail
screen, the 'Last Checked' column is marked "N/A", the 'Attempt' column is perpetually
'0/3', and the 'Duration' and 'Status Information' columns are both regularly updated.
(By this I mean that the Duration numbers are increasing and that the Status column
regularly updates the time when the next Service Check is scheduled.

----------------


I don't know if it's important, but I'll mention also that I'm using inetd on nagios
server to activate NSCA.



This is driving me batty and totally ruining my day, so any input is greatly appreciated.

Thanks a heap,

John
-- 
+---------------------------------------------------------------------------+
| John Fox <jjf at mind.net> | System Administrator | Internet Ventures Oregon |
+---------------------------------------------------------------------------+
| "You can't talk about George W. without addressing the strange            |
| Bilbo-Baginnian language that spurts out from between his lips like       |
| melted marshmallows coming out of a squirt gun." -- Dennis Miller         |
+---------------------------------------------------------------------------+


-------------------------------------------------------
This sf.net email is sponsored by: DEDICATED SERVERS only $89!
Linux or FreeBSD, FREE setup, FAST network. Get your own server 
today at http://www.ServePath.com/indexfm.htm




More information about the Users mailing list