<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META NAME="Generator" CONTENT="MS Exchange Server version 5.5.2650.12">
<TITLE>How to get NSCA running? Any HOWTO's out there?</TITLE>
</HEAD>
<BODY>
<BR>
<P><FONT SIZE=2 FACE="Courier New">I'm running into issues trying to get NSCA up and running. I looked through the archives and saw a few posts that deal with what looks to me like the same issue, but no response that actually makes things click.</FONT></P>
<P><FONT SIZE=2 FACE="Courier New">I'm trying to run a utility, any utility, in this case though I am using check_disk on another node and send back the results via NSCA. (I'm using this over NRPE or check_by_ssh because eventually I will need applications to submit their results back to the master-server if they encounter an error. So I thought testing a simple Nagios plugin and sending back the results would be fine to test it).</FONT></P>
<P><FONT SIZE=2 FACE="Courier New">So this is a passive check test.</FONT>
</P>
<P><FONT SIZE=2 FACE="Courier New">I read the notes, compiled the mcrypt libraries, and then compiled the NSCA plugin. I set the passwords and encryption level, configured NSCA to run a a daemon. Made the nsca_send client, populated it, etc. No issues.</FONT></P>
<P><FONT SIZE=2 FACE="Courier New">I turned on check_external_commands in the nagios.cfg file.. no issue there either.</FONT>
</P>
<P><FONT SIZE=2 FACE="Courier New">So I run this on my remote host by manual execution and format it and pipe it into NSCA.. </FONT>
<BR><FONT SIZE=2 FACE="Courier New">My line basically looks like this : </FONT>
</P>
<P><FONT SIZE=2 FACE="Courier New">testserver1 check_remote_disk 1 DISK CRITICAL - free space: /usr 93 MB (5%);| /usr=1636MB;1209;1555;0;1728</FONT>
</P>
<P><FONT SIZE=2 FACE="Courier New">cat bob|./send_nsca -H xx.xx.xx.xx -p 5667 -c send_nsca.cfg</FONT>
<BR><FONT SIZE=2 FACE="Courier New">And its accepted after my formatting.. : 1 data packet(s) sent to host successfully.</FONT>
</P>
<P><FONT SIZE=2 FACE="Courier New">It appears in my $NAGIOS/rw/nagios.cmd dir : [1108561917] PROCESS_HOST_CHECK_RESULT;testserver1 check_remote_disk;1;DISK CRITICAL - free space: /usr 93 MB (5%);| /usr=1636MB;1209;1555;0;1728</FONT></P>
<P><FONT SIZE=2 FACE="Courier New">In the Nagios log file on the master server I get : </FONT>
</P>
<P><FONT SIZE=2 FACE="Courier New">[1108559934] Warning: Unrecognized external command -> PROCESS_HOST_CHECK_RESULT;testserver1 check_remote_disk;1;DISK CRITICAL - free space: /usr 93 MB (5%);| /usr=1636MB;1209;1555;0;1728</FONT></P>
<P><FONT SIZE=2 FACE="Courier New">I define a passive service template in services.cfg.</FONT>
</P>
<P><FONT SIZE=2 FACE="Courier New">define service{</FONT>
<BR><FONT SIZE=2 FACE="Courier New"> name generic-service-passive ; The 'name' of this service template</FONT>
<BR><FONT SIZE=2 FACE="Courier New"> active_checks_enabled 0 ; Active service checks are enabled</FONT>
<BR><FONT SIZE=2 FACE="Courier New"> passive_checks_enabled 1 ; Passive service checks are enabled/accepted</FONT>
<BR><FONT SIZE=2 FACE="Courier New"> parallelize_check 1 ; Active service checks should be parallelized </FONT>
<BR><FONT SIZE=2 FACE="Courier New"> obsess_over_service 1 ; We should obsess over this service (if necessary)</FONT>
<BR><FONT SIZE=2 FACE="Courier New"> check_freshness 0 ; Default is to NOT check service 'freshness'</FONT>
<BR><FONT SIZE=2 FACE="Courier New"> notifications_enabled 1 ; Service notifications are enabled</FONT>
<BR><FONT SIZE=2 FACE="Courier New"> event_handler_enabled 1 ; Service event handler is enabled</FONT>
<BR><FONT SIZE=2 FACE="Courier New"> flap_detection_enabled 1 ; Flap detection is enabled</FONT>
<BR><FONT SIZE=2 FACE="Courier New"> process_perf_data 1 ; Process performance data</FONT>
<BR><FONT SIZE=2 FACE="Courier New"> retain_status_information 1 ; Retain status information across program restarts</FONT>
<BR><FONT SIZE=2 FACE="Courier New"> retain_nonstatus_information 1 ; Retain non-status information across program restarts</FONT>
<BR><FONT SIZE=2 FACE="Courier New"> register 0 ; TEMPLATE, DO NOT REGISTER!</FONT>
<BR><FONT SIZE=2 FACE="Courier New"> }</FONT>
</P>
<P><FONT SIZE=2 FACE="Courier New">I define utility2 as a valid machine with this template.. but I'm having some difficulty figuring out "how" to define this. (assuming the template I have above is even right)</FONT></P>
<P><FONT SIZE=2 FACE="Courier New">define service{</FONT>
<BR><FONT SIZE=2 FACE="Courier New"> use generic-service-passive</FONT>
</P>
<P><FONT SIZE=2 FACE="Courier New"> host_name testserver1</FONT>
<BR><FONT SIZE=2 FACE="Courier New"> service_description check_remote_disk</FONT>
<BR><FONT SIZE=2 FACE="Courier New"> is_volatile 0</FONT>
<BR><FONT SIZE=2 FACE="Courier New"> check_period 24x7</FONT>
<BR><FONT SIZE=2 FACE="Courier New"> max_check_attempts 3</FONT>
<BR><FONT SIZE=2 FACE="Courier New"> normal_check_interval 5</FONT>
<BR><FONT SIZE=2 FACE="Courier New"> retry_check_interval 1</FONT>
<BR><FONT SIZE=2 FACE="Courier New"> contact_groups aixadmin</FONT>
<BR><FONT SIZE=2 FACE="Courier New"> notification_interval 120</FONT>
<BR><FONT SIZE=2 FACE="Courier New"> notification_period 24x7</FONT>
<BR><FONT SIZE=2 FACE="Courier New"> notification_options w,u,c,r</FONT>
<BR><FONT SIZE=2 FACE="Courier New"> check_command check_disk <--- what should this be?</FONT>
<BR><FONT SIZE=2 FACE="Courier New"> }</FONT>
</P>
<P><FONT SIZE=2 FACE="Courier New">[1108561237] Warning: Unrecognized external command -> PROCESS_HOST_CHECK_RESULT;utility2 check_remote_disk;1;DISK CRITICAL - free space: /usr 93 MB (5%);| /usr=1636MB;1209;1555;0;1728</FONT></P>
<P><FONT SIZE=2 FACE="Courier New">I'm not sure what all I need to do here.</FONT>
</P>
<P><FONT SIZE=2 FACE="Courier New">I've tried multiple ways to define the service including putting it into checkcommands.cfg and then redoing the entry : </FONT></P>
<P><FONT SIZE=2 FACE="Courier New">define service{</FONT>
<BR><FONT SIZE=2 FACE="Courier New"> use generic-service-passive</FONT>
</P>
<P><FONT SIZE=2 FACE="Courier New"> host_name utility2</FONT>
<BR><FONT SIZE=2 FACE="Courier New"> service_description check_remote_disk</FONT>
<BR><FONT SIZE=2 FACE="Courier New"> is_volatile 0</FONT>
<BR><FONT SIZE=2 FACE="Courier New"> check_period 24x7</FONT>
<BR><FONT SIZE=2 FACE="Courier New"> max_check_attempts 3</FONT>
<BR><FONT SIZE=2 FACE="Courier New"> normal_check_interval 5</FONT>
<BR><FONT SIZE=2 FACE="Courier New"> retry_check_interval 1</FONT>
<BR><FONT SIZE=2 FACE="Courier New"> contact_groups aixadmin</FONT>
<BR><FONT SIZE=2 FACE="Courier New"> notification_interval 120</FONT>
<BR><FONT SIZE=2 FACE="Courier New"> notification_period 24x7</FONT>
<BR><FONT SIZE=2 FACE="Courier New"> notification_options w,u,c,r</FONT>
<BR><FONT SIZE=2 FACE="Courier New"> check_command check_remote_disk</FONT>
<BR><FONT SIZE=2 FACE="Courier New"> }</FONT>
</P>
<P><FONT SIZE=2 FACE="Courier New">I've tried adding the check_remote_disk command to the checkcommands.cfg file as well...</FONT>
</P>
<P><FONT SIZE=2 FACE="Courier New"># 'check_remote_disk' command definition</FONT>
<BR><FONT SIZE=2 FACE="Courier New">define command{</FONT>
<BR><FONT SIZE=2 FACE="Courier New"> command_name check_remote_disk</FONT>
<BR><FONT SIZE=2 FACE="Courier New"> command_line $USER$/check_disk -w $ARG1$ -c $ARG2$ -p $ARG3$</FONT>
<BR><FONT SIZE=2 FACE="Courier New"> }</FONT>
</P>
<P><FONT SIZE=2 FACE="Courier New">I'm kind of puzzled as to how I make the nagios server process what is in that external commands file.. I know that its making it there and its getting inserted. The documentation says you have to define a service with it.. but it doesn't say very much on "how" to do that. I tried looking for some howto's on this subject, but none of them seem to address this. I tried to drop the whole "check_command" stanza but Nagios didn't like that at all. (I'm not sure why I would need to have it though since I already passed it the return code for critical... and all it needs to do is put it into nagios. In fact if I code this into an application, it is definately not going to have the "agent" on the master server to even corrolate with, so I shouldn't need anything in checkcommands.cfg.. by my thinking).</FONT></P>
<P><FONT SIZE=2 FACE="Courier New">... on another note...</FONT>
<BR><FONT SIZE=2 FACE="Courier New">The send_nsca command lists 2 ways of sending checks : </FONT>
</P>
<P> <FONT SIZE=2 FACE="Courier New">Service Checks:</FONT>
<BR> <FONT SIZE=2 FACE="Courier New"><host_name>[tab]<svc_description>[tab]<return_code>[tab]<plugin_output>[newline]</FONT>
</P>
<P> <FONT SIZE=2 FACE="Courier New">Host Checks:</FONT>
<BR> <FONT SIZE=2 FACE="Courier New"><host_name>[tab]<return_code>[tab]<plugin_output>[newline]</FONT>
</P>
<P><FONT SIZE=2 FACE="Courier New">I'm not sure what the difference is... </FONT>
</P>
<P><FONT SIZE=2 FACE="Courier New">Any help/wisdom/howto info you could drop upon me would be much appreciated! </FONT>
</P>
<P><FONT SIZE=2 FACE="Courier New">-Spencer</FONT>
</P>
<BR>
<FONT SIZE=3 COLOR=BLUE><PRE>
***********************************************************************
This message, including any attachments, may contain
confidential information intended for a specific individual
and purpose, and may be protected by law. If you are not
the intended recipient, please notify the sender by e-mail
or telephone immediately, and then immediately delete this
message. Any disclosure, copying or distribution of this
message, or the taking of any action based on it, by any
unintended recipient is strictly prohibited.
Checked by the Safelite e-mail scanner which may have
resulted in the attachments being modified or removed.
</PRE></FONT>
</BODY>
</HTML>