More than one command defined

Kaiwang Chen kaiwang.chen at gmail.com
Fri Nov 19 17:08:06 CET 2010


Not sure about 3.2.2.

In 3.2.3 nagios can be configured to both write to log and run a
defined command on each copy of perfdata.
PNP bulk mode relies on the former, and the following configure
directive are involved:
process_performance_data
host_perfdata_file
service_perfdata_file
host_perfdata_file_mode
service_perfdata_file_mode
host_perfdata_file_processing_interval
service_perfdata_file_processing_interval
host_perfdata_file_processing_command
service_perfdata_file_processing_command
Don't worry about uncommpleted files, Nagios will close the file,
invoke the file processing command, then reopen the file. The
performance data is logged in the file, you can then do what you like
in the defined processing command, which can be simply a /bin/mv to
move it to another place as PNP bulk mode with NPCD, or processing the
whole perfdata log file as PNP bulk mode.

the PNP default mode relies on the latter, and the following configure
directives are involved:
process_performance_data
host_perfdata_command
service_perfdata_command
Nagios simple invokes the comands passing in perfdata and other
infomation in NAGIOS_XXX environment variables (have a look at
parse_env() in process_perfdata.pl).


Let me know if it works.

Thanks,
kc

2010/11/19 Daniel Wittenberg <daniel.wittenberg.r0ko at statefarm.com>:
> I’m looking at the same issue and our thoughts are to use NDO utils or
> possibly custom NEB to grab perf data that way, but then still let
> pnp4nagios run the ‘normal’ way.
>
> Dan
>
>
>
>
>
> From: Deborah Martin [mailto:Deborah.Martin at Kognitio.com]
> Sent: Thursday, November 18, 2010 10:26 AM
> To: 'Nagios Users List'
> Subject: [Nagios-users] More than one command defined
> Importance: High
>
>
>
> 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'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 ?
>
> Any help / pointers would be really appreciated. If I'm being dense about
> this and the answer is staring right at me feel free to say so!
>
> Thanks,
> Deborah
>
> ***************************************************************************
> 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
> ***************************************************************************
>
> ------------------------------------------------------------------------------
> 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
> _______________________________________________
> 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
>

------------------------------------------------------------------------------
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
_______________________________________________
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