More than one command defined

Deborah Martin Deborah.Martin at Kognitio.com
Thu Nov 18 21:17:13 CET 2010


Thanks for the input everyone. Much appreciated. 

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 :) 

Anyway all food for thought! 

Thanks again. 
Deborah  

-----Original Message-----
From: Andreas Ericsson [mailto:ae at op5.se] 
Sent: 18 November 2010 17:10
To: Nagios Users List
Cc: Deborah Martin
Subject: Re: [Nagios-users] More than one command defined

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

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

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

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

That doesn't really let you have things visible in the misccommands.cfg
file though, so you'll have to pick your poison on this one.

-- 
Andreas Ericsson                   andreas.ericsson at op5.se
OP5 AB                             www.op5.se
Tel: +46 8-230225                  Fax: +46 8-230231

Considering the successes of the wars on alcohol, poverty, drugs and
terror, I think we should give some serious thought to declaring war
on peace.


***************************************************************************
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. 

Any unauthorised distribution or copying is strictly prohibited. 
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. 

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. 

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.

Kognitio Inc, a company incorporated in Delaware, principal office 180 North Stetson, Suite 3500, Chicago, IL 60601, USA
***************************************************************************
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.monitoring-lists.org/archive/users/attachments/20101118/4b0a857e/attachment.html>
-------------- next part --------------
------------------------------------------------------------------------------
Beautiful is writing same markup. Internet Explorer 9 supports
standards for HTML5, CSS3, SVG 1.1,  ECMAScript5, and DOM L2 & L3.
Spend less time writing and  rewriting code and more time creating great
experiences on the web. Be a part of the beta today
http://p.sf.net/sfu/msIE9-sfdev2dev
-------------- next part --------------
_______________________________________________
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