Scripting within nrpe.cfg

StinkyBob stinkybob at gmail.com
Tue Mar 22 21:31:22 CET 2005


This is an easy one.

Just write a wrapper script to contain your dynamic values in it.

like this:

---begin script---
#!/bin/sh
NAGIOSDIR="/usr/local/nagios/libexec"
PLUGIN="check_file_age"
WARN=600
CRIT=1200
LOG="/usr/hns/pdreceiver/received/`ls -t /usr/hns/pdreceiver/received
| head -n 1`"

$NAGIOSDIR/$PLUGIN -w $WARN -c $CRIT $LOG
---end script---
and then have a corresponding line in nrpe.cfg:

command[check_somelogfileifyoufeellikeit]=/usr/local/nagios/libexec/myownpluginwrapper.sh

-------------------------------------------------------

Hello:

I want to use the check_file_age plugin to tell me the age of the
newest file in a directory.  Something like this works from the
command-line:

"/usr/local/nagios/libexec/check_file_age -w 600 -c 1200
/usr/hns/pdreceiver/received/`ls -t /usr/hns/pdreceiver/received |
head -n 1`"

but if I try to place this line in the nrpe.cfg file it doesn't work
right.  Is there a way to do what I'm trying to accomplish?

Thanks

Aaron


-------------------------------------------------------
This SF.net email is sponsored by: 2005 Windows Mobile Application Contest
Submit applications for Windows Mobile(tm)-based Pocket PCs or Smartphones
for the chance to win $25,000 and application distribution. Enter today at
http://ads.osdn.com/?ad_id=6882&alloc_id=15148&op=click
_______________________________________________
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


-------------------------------------------------------
This SF.net email is sponsored by: 2005 Windows Mobile Application Contest
Submit applications for Windows Mobile(tm)-based Pocket PCs or Smartphones
for the chance to win $25,000 and application distribution. Enter today at
http://ads.osdn.com/?ad_id=6882&alloc_id=15148&op=click
_______________________________________________
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