AW: Nagios not recognizing service via send_nsca

Mohr James james.mohr at elaxy.com
Wed Oct 5 08:48:50 CEST 2005


> -----Ursprüngliche Nachricht-----
>> Von: Lori Adams [mailto:ladams at cloudmark.com] 
>> 
>> I think it has to do with you trying to use nsca on the 
>> nagios server.
>> There's no reason to do that.  Just do a local call instead 
>> with active checks instead of passive checks.
>> 
>> -lori

Hi Lori!

Thanks for your response. Well, in my mind, there *is* a reason for doing it. Maybe you or someone else can correct me, but as far as I can tell, Nagios cannot do an active check at a specific time. If we wanted a check, for example, at 08.00 and 18.00, the best we could do is set the check to run every 12 hours and start Nagios close 18.00 (or 08.00). We want a regular scheduled message sent through Nagios. This tells us that Nagios has received and processed the message and was able to sent it corretly. 

So, we were planning to set up a cron job that runs twice a day. This sends a message to a volatile service on the Nagios server, so that it always sends a notification (i.e. SMS). We want to test the nsca server. In princple we could test it from another machine and thus we would also test the actual network connection. However, part of the question at this point is why it is not working as I expect. Is there really a problem with nsca on the nagios server?

Regards,

Jim Mohr

>> 
>> > -----Original Message-----
>> > From: nagios-users-admin at lists.sourceforge.net 
>> [mailto:nagios-users- 
>> > admin at lists.sourceforge.net] On Behalf Of Mohr James
>> > Sent: Tuesday, October 04, 2005 8:43 AM
>> > To: Nagios-users at lists.sourceforge.net
>> > Subject: [Nagios-users] Nagios not recognizing service via 
>> send_nsca
>> > 
>> > Hi All!
>> > 
>> > I want to create a service on the Nagios server (2.0b3) 
>> that accepts 
>> > message via ncsa and sends an SMS. In this way we have tested the
>> chain
>> > through nagios to sending a message. I have two services in
>> service.cfg
>> > defined like this:
>> > 
>> > define service (
>> >         use                             generic-service    
>>      ; Name
>> > of service template to use
>> >         host_name                       nts-mgm-18
>> >         service_description             SendXMS
>> >         is_volatile                     1
>> >         active_checks_enabled           0
>> >         check_command                   check-host-alive
>> > }
>> > 
>> > define service (
>> >         use                             generic-service    
>>      ; Name
>> > of service template to use
>> >         host_name                       nts-mgm-17
>> >         service_description             SendXMS
>> >         is_volatile                     1
>> >         active_checks_enabled           0
>> >         check_command                   check-host-alive
>> > }
>> > The generic service is defined like this:
>> > 
>> > # Generic service definition template
>> > define service{
>> >         name                            generic-service ; 
>> The 'name'
>> of
>> > this service template, referenced in other service definitions
>> >         parallelize_check               1       ; Active service
>> checks
>> > should be parallelized (disabling this can lead to major 
>> performance
>> > problems)
>> >         obsess_over_service             1       ; We should obsess
>> over
>> > this service (if necessary)
>> >         event_handler_enabled           1       ; 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
>> > 
>> >         register                        0       ; DONT 
>> REGISTER THIS
>> > DEFINITION - ITS NOT A REAL SERVICE, JUST A TEMPLATE!
>> >         is_volatile                     0
>> >         check_period                    24x7
>> >         active_checks_enabled           1
>> >         passive_checks_enabled          1
>> >         max_check_attempts              3
>> >         normal_check_interval           5
>> >         retry_check_interval            1
>> >         contact_groups                  datacenter
>> >         notification_interval           120
>> >         notification_period             24x7
>> >         notification_options            c
>> >         notifications_enabled           0
>> > }
>> > 
>> > After I added the services, I restarted nagios and nsca. 
>> When I am on 
>> > nts-mgm-18, I can run send_nsca, it sends the message and I see the
>> text
>> > in the Nagios GUI. I also see this in the /var/log/messages on the 
>> > Nagios server:
>> > 
>> > Oct  4 17:26:03 nts-mgm-17 nsca[20268]: Connection from 10.2.28.61
>> port
>> > 38666
>> > Oct  4 17:26:03 nts-mgm-17 nsca[20268]: Host address 
>> checks out ok Oct  
>> > 4 17:26:03 nts-mgm-17 nsca[20268]: Handling the connection...
>> > Oct  4 17:26:03 nts-mgm-17 nsca[20268]: SERVICE CHECK -> Host Name:
>> > 'nts-mgm-18', Service Description: 'SendXMS', Return Code: '0',
>> Output:
>> > 'TEST TEST TEST'
>> > Oct  4 17:26:03 nts-mgm-17 nsca[20268]: End of connection...
>> > Oct  4 17:26:03 nts-mgm-17 nagios: EXTERNAL COMMAND:
>> > PROCESS_SERVICE_CHECK_RESULT;nts-mgm-18;SendXMS;0;TEST TEST TEST
>> > 
>> > However, when I run the command from nts-mgm-17 (the 
>> Nagios server),
>> in
>> > the /var/log/messages all I see is this:
>> > 
>> > Oct  4 17:27:23 nts-mgm-17 nsca[20268]: Connection from 10.2.28.48
>> port
>> > 35050
>> > Oct  4 17:27:23 nts-mgm-17 nsca[20268]: Host address 
>> checks out ok Oct  
>> > 4 17:27:23 nts-mgm-17 nsca[20268]: Handling the connection...
>> > Oct  4 17:27:23 nts-mgm-17 nsca[20268]: End of connection...
>> > 
>> > Apparently it does not recognize SendXMS as a valid 
>> service. I have 
>> > ensured that the local machine ist listed in nsca.cfg 
>> file, so I am 
>> > fairly sure it is not simply ignoring this machine. I have looked
>> though
>> > the nsca.c to find a way to be more verbose, but I didn't find
>> anything
>> > useful.
>> > 
>> > I am at a lost to see where the difference is. Does it 
>> have something
>> to
>> > do with the fact that this is the local machine? I would appreciate
>> any
>> > info at all.
>> > 
>> > Regards,
>> > 
>> > Jim Mohr
>> > 
>> > 
>> > -------------------------------------------------------
>> > This SF.Net email is sponsored by:
>> > Power Architecture Resource Center: Free content, downloads,
>> discussions,
>> > and more. http://solutions.newsforge.com/ibmarch.tmpl
>> > _______________________________________________
>> > Nagios-users mailing list
>> > Nagios-users at lists.sourceforge.net
>> > https://lists.sourceforge.net/lists/listinfo/nagios-users
>> > ::: Please include Nagios version, plugin version (-v) and OS when 
>> > reporting any issue.
>> > ::: Messages without supporting info will risk being sent 
>> to /dev/null
>> 


-------------------------------------------------------
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions,
and more. http://solutions.newsforge.com/ibmarch.tmpl
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. 
::: Messages without supporting info will risk being sent to /dev/null





More information about the Users mailing list