View FAQ

[ Return To FAQ Index | Search The FAQs ]


FAQ Database : Nagios : Error and Warning Messages

Title:Debugging "unknown variable" errors during runtime or configuration verification
FAQ ID:F0040
Submitted By:Ethan Galstad 
Last Updated:06/02/2009

Description:

When trying to run Nagios or verify your configuration file data using the -v command line argument, Nagios may print out a message like "Error in configuration file 'xxxxxxx.cfg' - Line 34 (Unknown variable)".

 

Solution:

  1. Make sure you are passing the path to the main configuration file on the command line. The correct syntax would be as follows (paths modified for your system, of course):
    /usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg

  2. Make sure that you don't have any invalid variables defined in your configuration files. Notice that the error message will contain a reference to the name of the configuration file and the line number on which the error was encountered. Make sure that all comment lines contain a pound sign (#) in the first character of the line. If you're not sure about what variables are valid, check the documentation for the main and object configuration files.

  3. Make sure all variable identifiers are in lower case. Example:
    "admin_email=someaddress@somedomain.com" instead of "ADMIN_EMAIL=somedomain@nowhere.com"

 

Keywords:unknown variable