NRPE: Conditional parsing of nrpe.cfg supporte d?

Ralph.Grothe at itdz-berlin.de Ralph.Grothe at itdz-berlin.de
Thu Aug 4 16:17:46 CEST 2005


Hi Chester,

thanks for advising me how this could be hacked.

I have to admit however that I've never used the macro processor
m4 yet,
other than scratching the surface in conjunction with Sendmail
configuration.

I am no C hacker, only can read it (most of the times).
Therefore I have had little need for this tool until now.

I think for what I had in mind it wouldn't be worth the effort,
though I admit it shouldn't hurt to get a grip on m4.


> -----Original Message-----
> From: nagios-users-admin at lists.sourceforge.net
> [mailto:nagios-users-admin at lists.sourceforge.net]On Behalf Of 
> Chester R.
> Hosey
> Sent: Thursday, August 04, 2005 3:42 PM
> To: nagios-users at lists.sourceforge.net
> Subject: Re: [Nagios-users] NRPE: Conditional parsing of
nrpe.cfg
> supported?
> 
> 
> On Thu, 2005-08-04 at 13:52 +0200, Ralph.Grothe at itdz-berlin.de
wrote:
> > Hi,
> >  
> > I wonder if something like this is possible in nrpe.cfg (with
> > liberal artistic macrolike syntax here)
> > 
> > 
> > 
> > #if defined dont_blame_nrpe
> > command[check_tns]=/export/oracle/V9.2.0
> > PATH=/usr/bin:/export/oracle/V9.2.0/bin
> > /usr/local/nagios/libexec/check_oracle --tns $ARG1$
> > #else
> > command[check_tns]=/export/oracle/V9.2.0
> > PATH=/usr/bin:/export/oracle/V9.2.0/bin
> > /usr/local/nagios/libexec/check_oracle --tns MY_SID
> > #endif
> > 
> > 
> > 
> > Regards
> > --
> > Ralph Grothe
> 
> Not that I know of, but if you're looking for a preprocessor,
use a
> preprocessor!
> 
> I'd cp nrpe.cfg nrpe.cfg.m4, and edit nrpe.cfg.m4 to include
something
> like the following:
> 
> dnl This is the preprocessor source to nrpe.cfg
> dnl Run it through m4 with 'm4 nrpe.cfg.m4' to
> dnl generate usable output.
> 
> define(`DONT_BLAME_NRPE', `0')
> 
> # normal stuff... blah blah blah
> 
> dont_blame_nrpe=DONT_BLAME_NRPE
> 
> # more stuff... blah blah blah
> 
> ifelse(DONT_BLAME_NRPE, 0,
>         `command[check_tns]=do_what_i_want',
>         `command[check_tns]=do_what_nrpe_allows');
> 
> 
> If you're feeling really ambitious, you could even come up with
a
> makefile:
> 
> all: nrpe.cfg
> 
> nrpe.cfg: nrpe.cfg.m4
>         m4 nrpe.cfg.m4 > nrpe.cfg
> 
> 
> 
> 
> -------------------------------------------------------
> SF.Net email is Sponsored by the Better Software Conference &
EXPO
> September 19-22, 2005 * San Francisco, CA * Development 
> Lifecycle Practices
> Agile & Plan-Driven Development * Managing Projects & Teams * 
> Testing & QA
> Security * Process Improvement & Measurement * 
http://www.sqe.com/bsce5sf
_______________________________________________
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


-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
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