Command Path with date variable
Posted: Thu May 10, 2012 2:41 am
Hello to everybody
I want to check some logfiles on a remote Windows Server using check_nt.
To perform this check I use the following command:
./check_nt -H $HOSTNAME$ -p 12489 -v FILEAGE -l C:/stocksystem/Arcotronics/dirlog/01_PC-HOST10052012.log
The check works fine, but my problem is that the logfile 01_PC-HOST10052012.log will change everyday the date:
today: 01_PC-HOST10052012.log
tomorrow: 01_PC-HOST11052012.log
So in the command path I have to set a Variable like:
$USER1$/check_nt -H $HOSTADDRESS$ -p 12489 -v FILEAGE -l C:/stocksystem/Arcotronics/dirlog/01_PC-HOST$DATE$.log -w 900-c 1800
The variable $DATE$ I define in resource.cfg like:
$DATE$=date '+%d%m%y' = ex: 10052012
The problem is that it wont work, somebody knows how I can realize a check command with a variable that I can check every day the new logfile?
Thanks
I want to check some logfiles on a remote Windows Server using check_nt.
To perform this check I use the following command:
./check_nt -H $HOSTNAME$ -p 12489 -v FILEAGE -l C:/stocksystem/Arcotronics/dirlog/01_PC-HOST10052012.log
The check works fine, but my problem is that the logfile 01_PC-HOST10052012.log will change everyday the date:
today: 01_PC-HOST10052012.log
tomorrow: 01_PC-HOST11052012.log
So in the command path I have to set a Variable like:
$USER1$/check_nt -H $HOSTADDRESS$ -p 12489 -v FILEAGE -l C:/stocksystem/Arcotronics/dirlog/01_PC-HOST$DATE$.log -w 900-c 1800
The variable $DATE$ I define in resource.cfg like:
$DATE$=date '+%d%m%y' = ex: 10052012
The problem is that it wont work, somebody knows how I can realize a check command with a variable that I can check every day the new logfile?
Thanks