Nagios NSCA error

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
ayush1440
Posts: 6
Joined: Wed Dec 28, 2011 6:36 am

Nagios NSCA error

Post by ayush1440 »

Hello Friends,

I am very newbie for Nagios and specially for NSCA. I configured nagios core & plugin successfully and works very well on Ubuntu Server.

Now requirement is to configure nsca for tomcat log4j monitor. I configure nsca as wiki & how to docs and works but I have some confusion on this.

Here is my configuration. : -

Templates.cfg - end Section

Code: Select all

define service{
        use                             generic-service
        name                            passive_service
        active_checks_enabled           0
        passive_checks_enabled          1
        flap_detection_enabled          0
        register                        0
        is_volatile                     0
        check_period                    24x7
        max_check_attempts              3
        normal_check_interval           3
        retry_check_interval            1
        check_freshness                 0
        freshness_threshold             180
        contact_groups                  admins
        notification_interval           60
        notification_period             24x7
        notification_options            w,u,c,r
        stalking_options                w,c,u
        }
Inside localhost.cfg

Code: Select all

define service{
        use                             passive_service
        service_description             TestMessage
        host_name                       Pompei
        check_command                   check_dummy!0
        }
Nagios Error Log

Code: Select all

[1332332789] EXTERNAL COMMAND: PROCESS_SERVICE_CHECK_RESULT;localhost ;TestMessage ;3;This isdsfhksdfjskf a Test Error [return]
[1332332789] Warning:  Passive check result was received for service 'TestMessage ' on host 'localhost ', but the host could not be found!
[1332333079] EXTERNAL COMMAND: PROCESS_SERVICE_CHECK_RESULT;localhost ;TestMessage ;3;This isdsfhksdfjskf a Test Error [return]
[1332333079] Warning:  Passive check result was received for service 'TestMessage ' on host 'localhost ', but the host could not be found!
I tried several things by Google but can't help anything.

Also on my web ui service last checked is shown but Next schedule check shown as a N/A.

kindly please help me on this.

Help would be really appreciated. Further information will be given if required.

Sorry for bad english.. :(

Thanks & Regards,
mguthrie
Posts: 4380
Joined: Mon Jun 14, 2010 10:21 am

Re: Nagios NSCA error

Post by mguthrie »

I think you got bit by the empty whitespace. You're sending:

Code: Select all

localhost ;TestMessage ;3;This isdsfhksdfjskf a Test Error 
Try:

Code: Select all

localhost;TestMessage;3;This isdsfhksdfjskf a Test Error 
You don't want spaces in between the semi-colons.
ayush1440
Posts: 6
Joined: Wed Dec 28, 2011 6:36 am

Re: Nagios NSCA error

Post by ayush1440 »

mguthrie wrote:I think you got bit by the empty whitespace. You're sending:

Code: Select all

localhost ;TestMessage ;3;This isdsfhksdfjskf a Test Error 
Try:

Code: Select all

localhost;TestMessage;3;This isdsfhksdfjskf a Test Error 
You don't want spaces in between the semi-colons.

Thanks a lot for replying.

I am using test.txt for testing purpose. Here is a test.txt detail

Code: Select all

localhost   TestMessage   3    This isdsfhksdfjskf a Test Error
I am using following command :
/usr/local/nagios/bin/send_nsca -H localhost -p 5667 -c /usr/local/nagios/etc/send_nsca.cfg < /root/test.txt
When I executing your code in text I receive .0 data packet(s) sent to host successfully.

Can you please give me some other string for check.

Also I show in my webui, configured Passive check service don't update automatically for this test.
mguthrie
Posts: 4380
Joined: Mon Jun 14, 2010 10:21 am

Re: Nagios NSCA error

Post by mguthrie »

Try this in the text file:

Code: Select all

localhost;TestMessage;3;'This isdsfhksdfjskf a Test Error'

And this command:

Code: Select all

/usr/local/nagios/bin/send_nsca -H localhost -d ';' -p 5667 -c /usr/local/nagios/etc/send_nsca.cfg < /root/test.txt
(added a semi-colon as a delimiter). I would suggest always single quoting your plugin output as well.
ayush1440
Posts: 6
Joined: Wed Dec 28, 2011 6:36 am

Re: Nagios NSCA error

Post by ayush1440 »

Thanks a lot for your help. Given code is looks like working but there is no change in WEB UI.

Here is log detail.

Code: Select all

[1332493662] EXTERNAL COMMAND: PROCESS_SERVICE_CHECK_RESULT;localhost;TestMessage;3;'This isdsfhksdfjskf a Test Error'
[1332493662] Warning:  Passive check result was received for service 'TestMessage' on host 'localhost', but the host could not be found!
May be there is some mistake. Please help me on this too.

Again big big thanks for your help.
Locked