<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=US-ASCII">
<META NAME="Generator" CONTENT="MS Exchange Server version 5.5.2658.34">
<TITLE>RE: [Nagios-users] More than one command defined</TITLE>
</HEAD>
<BODY>

<P><FONT SIZE=2>Thanks for the input everyone. Much appreciated. </FONT>
</P>

<P><FONT SIZE=2>I'll try with merlin and see where that goes. And the script idea as well. The trouble is Nagios is a complicated beast (to me anyway). Coupled with that and getting pnp4nagios working as well this week, my head hurts from config file overload :) </FONT></P>

<P><FONT SIZE=2>Anyway all food for thought! </FONT>
</P>

<P><FONT SIZE=2>Thanks again. </FONT>
<BR><FONT SIZE=2>Deborah  </FONT>
</P>

<P><FONT SIZE=2>-----Original Message-----</FONT>
<BR><FONT SIZE=2>From: Andreas Ericsson [<A HREF="mailto:ae@op5.se">mailto:ae@op5.se</A>] </FONT>
<BR><FONT SIZE=2>Sent: 18 November 2010 17:10</FONT>
<BR><FONT SIZE=2>To: Nagios Users List</FONT>
<BR><FONT SIZE=2>Cc: Deborah Martin</FONT>
<BR><FONT SIZE=2>Subject: Re: [Nagios-users] More than one command defined</FONT>
</P>

<P><FONT SIZE=2>On 11/18/2010 05:25 PM, Deborah Martin wrote:</FONT>
<BR><FONT SIZE=2>> Hi,</FONT>
<BR><FONT SIZE=2>> </FONT>
<BR><FONT SIZE=2>> I have a need to run two different commands when processing the performance</FONT>
<BR><FONT SIZE=2>> data from Nagios (3.2.2)</FONT>
<BR><FONT SIZE=2>> </FONT>
<BR><FONT SIZE=2>> I want the first  command to run the process-perfdata.pl script from</FONT>
<BR><FONT SIZE=2>> pnp4nagios and the second command to log various things to a different log</FONT>
<BR><FONT SIZE=2>> file.</FONT>
<BR><FONT SIZE=2>> </FONT>
<BR><FONT SIZE=2>> The reason is that we've only just had a requirement to process performance</FONT>
<BR><FONT SIZE=2>> data for pnp4nagios graphing. But historically we've created our own</FONT>
<BR><FONT SIZE=2>> "performance data" log</FONT>
<BR><FONT SIZE=2>> which is then used within a database to produce SLA reports developed</FONT>
<BR><FONT SIZE=2>> in-house (no graphing just numbers produced for the SLA reports)</FONT>
<BR><FONT SIZE=2>> </FONT>
<BR><FONT SIZE=2>> If I do the following I don't get an errors when I run nagios -v nagios.cfg</FONT>
<BR><FONT SIZE=2>> ... :-</FONT>
<BR><FONT SIZE=2>> </FONT>
<BR><FONT SIZE=2>> define command {</FONT>
<BR><FONT SIZE=2>>          command_name process-service-perfdata-file</FONT>
<BR><FONT SIZE=2>>          command_line<first command>  - process performance data for</FONT>
<BR><FONT SIZE=2>> pnp4nagios</FONT>
<BR><FONT SIZE=2>>          command_line<second command>  - log different data to a different</FONT>
<BR><FONT SIZE=2>> file</FONT>
<BR><FONT SIZE=2>>          }</FONT>
<BR><FONT SIZE=2>> </FONT>
</P>

<P><FONT SIZE=2>I'm not surprised. This is a sort of unintentional fallout that comes from</FONT>
<BR><FONT SIZE=2>using the template system the way it's defined today. I guess only the</FONT>
<BR><FONT SIZE=2>second command_line will get run though, right?</FONT>
</P>

<P><FONT SIZE=2>> I'd like to avoid creating a script with both commands in if I can help it</FONT>
<BR><FONT SIZE=2>> as it's extremely useful to keep it simple and visible in the</FONT>
<BR><FONT SIZE=2>> misccommands.cfg file.</FONT>
<BR><FONT SIZE=2>> </FONT>
<BR><FONT SIZE=2>> Perhaps there is some other way I can do this or is a script with both</FONT>
<BR><FONT SIZE=2>> commands really the only way ?</FONT>
<BR><FONT SIZE=2>> </FONT>
</P>

<P><FONT SIZE=2>You could use Merlin and set the perfdata_table option in the database</FONT>
<BR><FONT SIZE=2>section of the daemon compound. Then you can grab the perfdata items</FONT>
<BR><FONT SIZE=2>from the merlin database. Note that you'll have to drop old entries</FONT>
<BR><FONT SIZE=2>from that table every once in a while though, as the table will surely</FONT>
<BR><FONT SIZE=2>grow huge otherwise.</FONT>
</P>

<P><FONT SIZE=2>That doesn't really let you have things visible in the misccommands.cfg</FONT>
<BR><FONT SIZE=2>file though, so you'll have to pick your poison on this one.</FONT>
</P>

<P><FONT SIZE=2>-- </FONT>
<BR><FONT SIZE=2>Andreas Ericsson                   andreas.ericsson@op5.se</FONT>
<BR><FONT SIZE=2>OP5 AB                             www.op5.se</FONT>
<BR><FONT SIZE=2>Tel: +46 8-230225                  Fax: +46 8-230231</FONT>
</P>

<P><FONT SIZE=2>Considering the successes of the wars on alcohol, poverty, drugs and</FONT>
<BR><FONT SIZE=2>terror, I think we should give some serious thought to declaring war</FONT>
<BR><FONT SIZE=2>on peace.</FONT>
</P>

<BR>
***************************************************************************<BR>
This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. <BR>
<BR>
Any unauthorised distribution or copying is strictly prohibited. <BR>
Whilst Kognitio Limited takes steps to prevent the transmission of viruses via e-mail, we can not guarantee that any email or attachment is free from computer viruses and you are strongly advised to undertake your own anti-virus precautions. <BR>
<BR>
Kognitio grants no warranties regarding performance, use or quality of any e-mail or attachment and undertakes no liability for loss or damage, howsoever caused. <BR>
<BR>
Kognitio Limited, a company registered in England and Wales. Registered number 0212 7833. Registered Office:  3a Waterside Park, Cookham Road, Bracknell, Berks, RG12 1RB. VAT number 864 4378 92.<BR>
<BR>
Kognitio Inc, a company incorporated in Delaware, principal office 180 North Stetson, Suite 3500, Chicago, IL 60601, USA<BR>
***************************************************************************<BR>
</BODY>
</HTML>