<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: NRPE check_file_age is a filthy liar</title>
	<atom:link href="http://blog.manjusri.org/2009/08/02/nrpe-check_file_age-is-a-filthy-liar/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.manjusri.org/2009/08/02/nrpe-check_file_age-is-a-filthy-liar/</link>
	<description>Book Reviews and Blather</description>
	<lastBuildDate>Sat, 25 Jun 2011 22:50:21 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
	<item>
		<title>By: binder</title>
		<link>http://blog.manjusri.org/2009/08/02/nrpe-check_file_age-is-a-filthy-liar/comment-page-1/#comment-723</link>
		<dc:creator>binder</dc:creator>
		<pubDate>Sat, 08 Jan 2011 22:19:18 +0000</pubDate>
		<guid isPermaLink="false">http://blog.manjusri.org/?p=191#comment-723</guid>
		<description>That seems consistent with the problem I had in using variable substitution with NRPE. One (probably dumb) thing to try might be not using a variable in your  remote server nrpe configuration but instead having a task in crontab which rewrites the line to have the right filename on a daily basis. Something like

#!/bin/bash
# update_nrpe

TODAY=$(date +%Y%m%d)

### WARNING, completely untested, just an idea, do not use in production environment without testing.
sed -e &#039;s/db_demo_(.*)/${TODAY}/&#039;  /etc/nagios/nrpe_local.cfg &gt; /etc/nagios/nrpe_local.cfg

would remove the variable substitution from the nrpe processing.</description>
		<content:encoded><![CDATA[<p>That seems consistent with the problem I had in using variable substitution with NRPE. One (probably dumb) thing to try might be not using a variable in your  remote server nrpe configuration but instead having a task in crontab which rewrites the line to have the right filename on a daily basis. Something like</p>
<p>#!/bin/bash<br />
# update_nrpe</p>
<p>TODAY=$(date +%Y%m%d)</p>
<p>### WARNING, completely untested, just an idea, do not use in production environment without testing.<br />
sed -e &#8216;s/db_demo_(.*)/${TODAY}/&#8217;  /etc/nagios/nrpe_local.cfg &gt; /etc/nagios/nrpe_local.cfg</p>
<p>would remove the variable substitution from the nrpe processing.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: maxidea</title>
		<link>http://blog.manjusri.org/2009/08/02/nrpe-check_file_age-is-a-filthy-liar/comment-page-1/#comment-722</link>
		<dc:creator>maxidea</dc:creator>
		<pubDate>Fri, 12 Nov 2010 03:11:58 +0000</pubDate>
		<guid isPermaLink="false">http://blog.manjusri.org/?p=191#comment-722</guid>
		<description>Yes, I got same problem when I using check_file_age on a remote server to check a daily backup file.
My configure as below:
Remote server:command[check_db_backup_file]=/usr/local/nagios/libexec/check_file_age -w 86400 -c 93600 -f /u01/backup/db_demo_$(date +%Y%m%d.dmp).gz

Monitoring sevrer: ./check_nrpe -H IPofRemoteServer -c check_db_backup_file

Error:
FILE_AGE CRITICAL: File not found - /u01/backup/db_demo_20101112.dmp.gz$

It also a bonus $ at the end...

But I can run command on remote server with error:
/usr/local/nagios/libexec/check_file_age -w 86400 -c 93600 -f /u01/backup/db_demo_$(date +%Y%m%d.dmp).gz
FILE_AGE OK: /u01/backup/db_demo_20101112.dmp.gz is 33861 seconds old and 685676145 bytes

Please let me know if any idea to fix it. Thanks!</description>
		<content:encoded><![CDATA[<p>Yes, I got same problem when I using check_file_age on a remote server to check a daily backup file.<br />
My configure as below:<br />
Remote server:command[check_db_backup_file]=/usr/local/nagios/libexec/check_file_age -w 86400 -c 93600 -f /u01/backup/db_demo_$(date +%Y%m%d.dmp).gz</p>
<p>Monitoring sevrer: ./check_nrpe -H IPofRemoteServer -c check_db_backup_file</p>
<p>Error:<br />
FILE_AGE CRITICAL: File not found &#8211; /u01/backup/db_demo_20101112.dmp.gz$</p>
<p>It also a bonus $ at the end&#8230;</p>
<p>But I can run command on remote server with error:<br />
/usr/local/nagios/libexec/check_file_age -w 86400 -c 93600 -f /u01/backup/db_demo_$(date +%Y%m%d.dmp).gz<br />
FILE_AGE OK: /u01/backup/db_demo_20101112.dmp.gz is 33861 seconds old and 685676145 bytes</p>
<p>Please let me know if any idea to fix it. Thanks!</p>
]]></content:encoded>
	</item>
</channel>
</rss>

