## File-Based Performance Data Options

Important: Nagios can be configured to use different methods for processing performance data. This documentation describes how to configure performance data processing if you've compiled Nagios with support for file-based performance data data routines (i.e. using the --with-file-perfdata argument to the configure script).

Introduction

When you compile Nagios with this option, you are able to have host and service performance data written directly to one or two files in a format that you define. This is less flexible that the default method of processing performance data, but it is also much quicker since it does not require spawning a new system process to handle the data.

If you need more flexibility in processing performance data on-the-fly, you might want to use the default method instead.

Processing Host Performance Data

If you want to process host performance data, you need to add a xpdfile_host_perfdata_file directive to your main config file as follows:

xpdfile_host_perfdata_file=<file_name>

This directive is used to specify the file where host performance data should be written. An example entry in your main config file might look like this:

xpdfile_host_perfdata_file=/usr/local/nagios/var/hostperf.log

You must also add a xpdfile_host_perfdata_template entry to your main config file as follows:

xpdfile_host_perfdata_template=<template>

This directive determines how the host performance data is written to the file. The example template definition show below will cause the performance data to be written to the file in tab-delimited format, with one entry per line (\t, \r and \n are interpreted as tab, carriage return, and newline characters respectively).

xpdfile_host_perfdata_template=$TIMET$\t$HOSTNAME$\t$OUTPUT$\t$PERFDATA$

Processing Service Performance Data

If you want to process service performance data, you need to add a xpdfile_service_perfdata_file directive to your main config file as follows:

xpdfile_service_perfdata_file=<file_name>

This directive is used to specify the file where service performance data should be written. An example entry in your main config file might look like this:

xpdfile_service_perfdata_file=/usr/local/nagios/var/serviceperf.log

You must also add a xpdfile_service_perfdata_template entry to your main config file as follows:

xpdfile_service_perfdata_template=<template>

This directive determines how the service performance data is written to the file. The example template definition show below will cause the performance data to be written to the file in tab-delimited format, with one entry per line (\t, \r and \n are interpreted as tab, carriage return, and newline characters respectively).

xpdfile_service_perfdata_template=$TIMET$\t$HOSTNAME$\t$SERVICEDESC$\t$OUTPUT$\t$PERFDATA$

Notes

You can point the xpdfile_host_perfdata_file and xpdfile_service_perfdata_file directives to the same file if you want both host and service performance data to be written to a single file.