This example on a linux system should help ....

[root@jlyonslx test_harness]# /usr/bin/printf "HOST\tSERVICE\tCRITICAL\tMy 
Message ....\n"  | /usr/local/nagios/addons/nsca/send_nsca -H localhost -p 5667 
 -c ./nsca_send.cfg
1 data packet(s) sent to host successfull

Jar Lyons
Senior Software Engineer
Tideworks Technology, Inc.
(206) 344-3016

[cid:image001.gif@01C8E1BC.4F6ACE00]

From: steve f [mailto:a31mod...@hotmail.com]
Sent: Tuesday, March 22, 2011 10:09 AM
To: nagios-users@lists.sourceforge.net
Subject: [Nagios-users] A question on using send_nsca

I am trying to send a test job to my nagios server from a monitored client 
using send_nsca.  I am running suse linux 10 on both client & nagios server.

Currently, everything is working correctly from within nagios using send_nsca 
as I am set up as distributed environment.  I am now in the process of taking 
some in house built scripts & trying to send the results to nagios via 
send_nsca.

My issue is, if I do this from the command line :

/usr/local/nagios/bin/send_nsca -H NAGIOSSERVER -c 
/usr/local/nagios/etc/send_nsca.cfg < /tmp/test

I see the check come across to the nagios server ( granted it doesn't know what 
to do with it as the info is not set up in Nagios.  The /tmp/test file is 
nothing more than a tab delimited file as this :

HOSTNAME       TestMessage     0       This is a test message.

What I have been trying to do is run the same thing above, without the redirect 
to a discrete file. Every way I try it it fails and just shows me the help page 
for send_nsca.

Should I be able to do this some way like this ?

/usr/local/nagios/bin/send_nsca -H NAGIOSSERVER -c 
/usr/local/nagios/etc/send_nsca.cfg  HOSTNAME  TestMessage 0 This is a test 
message

It appears that the format of the message is incorrect.  I am not getting any 
tab in between the parameters.  I have tried using a \t  and [tab] but still 
not working.  Also tried doing an echo -e of the above with a xargs but not 
correct.

Blaming this actually on my  scripting skills more than Nagios :)

Can anyone shed some light / point me in a direction what I am doing wrong here?

Thanks,

Steve

<<inline: image001.png>>

------------------------------------------------------------------------------
Enable your software for Intel(R) Active Management Technology to meet the
growing manageability and security demands of your customers. Businesses
are taking advantage of Intel(R) vPro (TM) technology - will your software 
be a part of the solution? Download the Intel(R) Manageability Checker 
today! http://p.sf.net/sfu/intel-dev2devmar
_______________________________________________
Nagios-users mailing list
Nagios-users@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

Reply via email to