Event - Log to file


The "Log to file" alert writes data to a text file whenever alert conditions are met.

Log times for entire route?

This option specifies if you want to write data to the text file just for the monitored host, or the entire route.  Leaving this off means that for each time alert conditions are met, one data item will be written to the file - for the monitored host.  If the switch is turned on, then data for the entire route will be written.

Filename:

The filename is *required* to have the $host variable in it (or some variable that changes depending on which host / target is being logged).  If it is missing, then the file will be nonsensical if you attach this alert to more than one host.  The following variables can be used as part of the filename.  Note there is no way to "escape" the following sequences, so these are always parsed and can't be specified as literals in the filename.

$hostHost name (or IP address, if no name exists).
$hostipThe host IP address
$hostdnsnameThe resolved DNS name for the host
$yearCurrent Year
$monthCurrent Month
$dayCurrent day of month
$hourCurrent hour
$minuteCurrent minute
$secondCurrent second
$dateSame as $year-$month-$day.
$timeThe same as $hour$minute - note the absence of any punctuation - that's to make sure the file name is valid, if this mask is being used in a file name.

 

Note that only one directory level of depth will be created automatically if it doesn't already exist, so you can specify c:\ping data\$host\filename.txt and the $host directory will be created as needed.  Only one directory of depth will be created, however, so if the c:\ping data directory didn't already exist, an error would occur.